From 0afc4672bd669b9718eeae8ba32e76f3402ebaeb Mon Sep 17 00:00:00 2001 From: gentlegiantJGC Date: Wed, 31 Mar 2021 15:23:11 +0100 Subject: [PATCH] Added a description about language files --- contributing/lang.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/contributing/lang.md b/contributing/lang.md index 130b9d4f..cf5bb298 100644 --- a/contributing/lang.md +++ b/contributing/lang.md @@ -2,6 +2,18 @@ This is intended for anyone wishing to contribute translations to the project. +### Language Files +In order to support translations of text in the user interface all of the text has been moved into .lang files located in `amulet_map_editor/lang`. +The name of these lang files are RFC 1766 format language codes. +For example `en` for English, `en_US` for US English and `en_GB` for British English. +The lang files are formatted with one localised string per line with a `=` symbol separating the identifying key and the localised text. +The keys must only contain the characters a-z0-9_. and values can contain any character including the `=` symbol. + +When loading the lang files, first the `en.lang` file is loaded to ensure that there is at least something for any given key. +If the language code contains an `_` symbol (for example `fr_CA`) then the lang file for the language section will be loaded next (`fr.lang`). +This allows languages that do not vary much between regions to share the same language file to minimise duplication. +Finally, if it exists, the region specific language file will be loaded which should only contain entries that vary between regions. + ### Branch Naming A branch must be created in order to contribute to the project. Unless you have permissions to create branches in Amulet-Team you will first need to [fork the repository](https://docs.github.com/en/github/getting-started-with-github/fork-a-repo).