You use a language code to identify a language.
The language codes are case insensitive.
Note that an error is returned if you specify an invalid language code.
With the language codes, you can specify the language of the text to the Dgraph during a record search or value search query, so that it can correctly perform language-specific operations.
A country locale code is a combination of a language code (such as es for Spanish) and a country code (such as MX for Mexico or AR for Argentina). Thus, the es_MX country locale means Mexican Spanish while es_AR is Argentinian Spanish.
If you specify a country locale code for a Language element, the software ignores the country code but accepts the language code part. In other words, a country locale code is mapped to its language code and only that part is used for tokenizing queries or generating search indexes. For example, specifying es_MX is the same as specifying just es. The exceptions to this rule are the codes listed above (such as pt_BR).
Note, however, that if you create a standard attribute and specify a country locale code in the mdex-property_Language field, the attribute will be tagged with the country locale code, even though the country code will be ignored during indexing and querying.
The Dgraph has two spelling correction engines. If the mdex-property_Language property in a PDR is set to en, then spelling correction will be handled through the English spelling engine (and its English spelling dictionary); if it is set to any other value, then spelling correction will use the non-English spelling engine (and its language-specific dictionaries). All dictionaries are generated from the data records in the Dgraph, and therefore require that the standard attribute PDRs be tagged with a language ID.
All dictionary files are stored in the data domain's index directory.