Skip to content

Commit b847826

Browse files
committed
Update configuration doc.
1 parent d9f7146 commit b847826

1 file changed

Lines changed: 44 additions & 7 deletions

File tree

doc/config.md

Lines changed: 44 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ Configuration files, also called transliteration tables, are contained in the
1313
The configuration file names are key to most operations in the software. They
1414
are all-lowercase and use underscores to separate words, e.g.
1515
`church_slavonic`. They have the `.yml` extension and are written in the
16-
[YAML](https://yaml.org/) configuration language. Hence, a transliteration
17-
request to the `/trans` REST API endpoint providing `church_slavonic` as the
18-
transliteration language, uses the `church_slavonic.yml` configuration file.
16+
[YAML](https://yaml.org/) configuration language.
1917

2018
Other files are present in the `data` directory that are not exposed to the end
2119
user via Web UI or REST API. These files may be incomplete transliteration
@@ -35,10 +33,49 @@ transliteration table key names as described previously, and the values are
3533
key-value pairs which can have arbitrary contents. These contents are displayed
3634
to the user in the `/languages` API endpoint.
3735

38-
The only mandatory key for each key-value pair is `name`, which is the
39-
human-readable label that is displayed in the Web UI. Other keys, such as
40-
`description`, may be used to inform the user about the scope of a particular
41-
table.
36+
Each entry of the index file are the following:
37+
38+
### `<entry_name>`
39+
40+
The key for the language/script. This is referred in multiple places across
41+
the application, e.g. the `/trans/mongolian_cyrillic` API method transliterates
42+
a sentence using the `mongolian_cyrillic` index entry. By default, the
43+
`mongolian_cyrillic` entry in the index file (see below) uses the
44+
`mongolian_cyrillic.yml` configuration file in the `data/` folder. This can be
45+
overridden by the `conf` key (see below).
46+
47+
By convention, an entry name uses the name of the language, followed by the
48+
name of the script, separated by an underscore, *only if that language is known
49+
to exist in multiple scripts*. For example, `mongolian_cyrillic` is used for
50+
Mongolian written in Cyrillic, and `mongolian_mongol_bichig` for the native
51+
Mongol Bichig script; while `persian` is only found in Arabic script, so
52+
`arabic` is not added.
53+
54+
### `<entry_name>.name`
55+
56+
Human-readable label that is displayed in the Web UI. Mandatory.
57+
58+
### `<entry_name>.conf`
59+
60+
Override the default configuration file lookup. By default,
61+
the configuration file is inferred from the key name, e.g. `chinese` looks up
62+
`data/chinese.yml`. However, some entries in the index may not have a distinct
63+
configuration and reuse an existing configuration that works for that language.
64+
Several languages in the Cyrillic script use this method.
65+
66+
The value is the full file name relative to the `data/` directory, e.g.
67+
`cyrillic_generic.yml`.
68+
69+
### `<entry_name>.marc_code`
70+
71+
MARC code from the [MARC Standards Office registry
72+
](https://www.loc.gov/marc/languages/language_name.html). This may be used by
73+
external applications to more easily look up entries. Optional.
74+
75+
### `<entry_name>.description`
76+
77+
Additional description that may be used to inform the user about the scope of
78+
a particular table. Optional.
4279

4380
## Inheritance
4481

0 commit comments

Comments
 (0)