Translations: Difference between revisions

From Citizens Wiki

No edit summary
No edit summary
Line 7: Line 7:
Translation files are a collection of sentences ('strings') in a properties file. This allows Citizens to request a string for a specific action based on a key, such as citizens.notifications.enabled. You can see an example in the messages_en.properties file included with Citizens.
Translation files are a collection of sentences ('strings') in a properties file. This allows Citizens to request a string for a specific action based on a key, such as citizens.notifications.enabled. You can see an example in the messages_en.properties file included with Citizens.


A locale tells Citizens which language to use. The _en, _de suffixes in the property files specifies the locale that the file is translating for. By default, Citizens will use the system locale for translations, using the general.translation.locale setting if present.  
A locale tells Citizens which language to use. The _en and _de suffixes of the file name specify the locale that the file is translating for. By default, Citizens will use the system locale for translations, using the general.translation.locale setting if present.  


To get started with a new translation, make a copy of the messages_en.properties file and change the name to use a new locale, such as messages_fr.properties for French. Translate the strings inside this file, and you're done!
To get started with a new translation, make a copy of the messages_en.properties file and change the name to use a new locale, such as messages_fr.properties for French. Translate the strings inside this file, and you're done!

Revision as of 12:48, 4 October 2012

With the newest releases of Citizens2, Citizens is becoming fully translatable into many languages. This allows Citizens to display customisable strings for languages such as German, French, and more as well as allowing server owners to change what Citizens shows by default. Translation files are placed in the i18n directory of the Citizens folder.

Premade translations

Currently, Citizens has built-in support for english and german translations. If you'd like to contribute your own language files or update existing files, please contact channel moderators/voiced users in #citizens on irc.esper.net. Built-in files are unpacked to the i18n folder.

So how do I make my own?

Translation files are a collection of sentences ('strings') in a properties file. This allows Citizens to request a string for a specific action based on a key, such as citizens.notifications.enabled. You can see an example in the messages_en.properties file included with Citizens.

A locale tells Citizens which language to use. The _en and _de suffixes of the file name specify the locale that the file is translating for. By default, Citizens will use the system locale for translations, using the general.translation.locale setting if present.

To get started with a new translation, make a copy of the messages_en.properties file and change the name to use a new locale, such as messages_fr.properties for French. Translate the strings inside this file, and you're done!