Skip to content

Translations

José Paulo edited this page Oct 21, 2020 · 4 revisions

Translations allow Civs to provide messages in different languages as well as the ability for admins to customize them for each individual server. Currently, the plugin ships with translation files for English, Portuguese, German, Hungarian, Chinese, Spanish, Russian, French, Czech and Vietnamese.

Changing the default language

Set the default-language field in the plugin's config to the desired language. Individual players can override this setting for themselves using the in-game menu.

# Config.yml
default-language: en # en, pt-br, de, hu, zh, zh-tw, es, ru, fr, cs or vi.

Modifying the default translations

To modify the messages in a specific language, open the appropriate file in the plugins/Civs/translations folder and edit the line correspondent to that message. Remember to uncomment the line by removing the leading # or the change won't be read by Civs.

Example

To modify the name of the 'Catapult' to 'Trebuchet' in the english translation, open the en.yml file and change

catapult-name: "Catapult"

to

catapult-name: "Trebuchet"

Placeholders

Some messages have placeholders in them, which are replaced by Civs with different values, depending on the message. They are identified by a dollar sign $ followed by a number, for example $1. When translating a message, you should reposition the placeholder so that the value gets placed in the correct position for that language.

One example of such messages is the pop-desc string:

pop-desc: "$1 Population / $2 Housing / $3 Villagers"

In this instace, $1 is replaced by the population of the town the player is browsing. Similarly, $2and $3 are replaced by the amount of housing and villagers that town currently has.

Colors

Translation messages can contain color codes by using a special syntax. This would make the 'Destroy' text appear red in-game.

destroy: "@{RED}Destroy"