Language - Rumsfield/konquest GitHub Wiki
Updated for version 1.8.0
Konquest Language Files
All messages, notices and errors in Konquest are defined in a language file. Language files are kept in the "lang" folder, where the default file is english.yml. Select which language file to use with the language
option in core.yml.
Included Language Files
Language | File |
---|---|
English | english.yml |
Русский | russian.yml |
中國人 | chinese.yml |
Español | spanish.yml |
Türkçe | turkish.yml |
Deutsch | german.yml |
To change which language file is used, modify the language
option in core.yml:
# (*) Language file selection, must match a file name in the /lang folder (e.g. english for lang/english.yml)
language: english
Editing included language files
You can change the messages, labels and other menu descriptions of Konquest by editing the english.yml file directly. All messages must by enclosed in quotation marks. Some messages contain placeholder markers (%s
) that get replaced with things like kingdom names, player names or other information. You can include color codes in messages, like the default &# codes or hex #FFFFFF codes. Messages cannot add or remove any %s
after edits. For example, given an original message:
generic:
notice:
reward-exp: "EXP rewarded: %s"
In the example above, the message generic.notice.reward-exp
must contain a single %s
. An edited message could be:
generic:
notice:
reward-exp: "You received %s EXP!"
Restart the server after making changes to the language file.
Common Syntax Errors
When a message begins with %s
, you must enclose the line in either single '
or double "
quotes. For example:
notice: '%s is attacking!'
When a message contains an apostrophe or single '
quote, or if it contains a colon :
, you must enclose the line in double "
quotes. For example:
notice: "The player's name is: %s."
Making Mistakes
When you edit a language file and cause a syntax error, Konquest will display error messages in the server console when the server starts. The original file that contains the syntax errors will be saved as a new file with the extension .bad
, and the default version of the language file will replace it. If no default version exists, then Konquest will use the english.yml
file.
Making custom language files
You can make your own language files for custom translations by copying an included file (e.g. english.yml) and renaming it. Then, set the language
option to the custom file name in core.yml. Custom language files cannot add or remove any messages, only edit existing ones. All messages must also contain the original number of %s
placeholders.
If you create a language translation YML file, please consider sharing it to be included as a built-in language option for a future Konquest version.
Checking your language file for errors
Before using your custom language file, use online tools to check the YML file for errors.
- YAML Parser will show any errors or wrong formats.
- YAML Checker will show any bad syntax.