Languages - flyinghyrax/Elementary GitHub Wiki

Elementary supports several languages already, and can be simply translated into other languages.

Supported languages

Elementary currently includes the following translations:

Language Code
English en
French fr
German de
Dutch nl
Russian ru
Vietnamese vi
Brazilian Portuguese pt-BR
Indonesian id

You can view the translation files for the included languages in the "\Elementary\@Resources\Languages" folder.

Setting the language

  1. Open the file "\Elementary\@Resources\shared.inc" in a plain-text editor, such as Notepad, Notepad++, or Sublime Text.
  2. Find the "language" variable under the "[Variables]" section.
  3. Set the part after the "=" sign to the code for the language in the table above
  4. Save the file
  5. Refresh any loaded Elementary skins

Creating a new translation

To make your own translation file to use with Elementary, look in ...\Elementary\@Resources\Languages\ for the file template.txt. This file lists all the 'keys' for the skins with no 'values' (translations). To make a new translation file:

  1. Make a copy of the template file, naming the new copy appropriately for your language. (see below)
  2. Open your new copy and fill in all the values after the = signs with the appropriate word or phrase in your language. Save your changes.
  3. In shared.inc, set language (see above) to whatever you named your new translation file (without the .txt extension). Save the file and refresh any open Elementary skins. The skins should now use your new translations.

Please check the translation files already included in the ...\Languages\ folder for examples.

Translation file naming

The name of your new translation file is important because of the way the "language" variable is used in the weather skin. It is used in two ways:

  1. It matches the name of a file in the "\Elementary@Resources\Languages" folder
  2. It is inserted into the URL when retrieving data from weather.com, in order to get weather conditions translated to the correct language.

Therefore, in order for translations in the weather skin to work correctly, the file name for your translation should be a valid locale code supported by the weather.com. I use the two letter IS0 639-1 code for the language followed by an optional ISO 3166-1 two letter region identifier if the translation is region-specific (for example, "pt-BR" for Brazilian Portuguese).

Together, the language code and region code separated by a hyphen form a valid RFC 4656 language tag which functions as a locale code when requesting data from weather.com. You can search for and verify language and region tags using this tool. Weather.com does not support all valid locales, but I have not been able to locate documentation which lists the locales which weather.com definitely supports. For now, the only way to verify if a locale code will return a correct translation from weather.com is to check manually. You can substitute your code into the following URL and inspect the response in your browser:

http://wxdata.weather.com/wxdata/weather/local/JAXX0047?unit=m&dayf=3&locale=[CODE HERE]&cc=*

For example: http://wxdata.weather.com/wxdata/weather/local/JAXX0047?unit=m&dayf=3&locale=en-GB&cc=*

Other translation notes

  • The default fonts might not support the special characters needed for some languages. In such cases you will need to change the font to one that includes the correct characters.
  • Translation files with special characters should be encoded with Unicode. You can read more specifics here (see the section "Using Unicode in Rainmeter" for how to save the file in a particular text editor).
  • If a word/phrase in your language is much longer than that word/phrase in English, then there may be some problems with text being cut-off in some of the skins. This should be easily solved with a minor positioning tweak in that skin's .ini file, but consider using shorter synonyms if possible to make it easier to redistribute your translation.

Contributing translations

The preferred way for users to submit new translations is through the GitHub repository. This process makes it easier for me to keep track of submissions and credits. Feel free to fork the Elementary repository, add your translation file, and send a pull request so I can merge your translation into the main repo. You may also email me translations - just attach your translation's .txt file and indicate how you would like to be credited.

⚠️ **GitHub.com Fallback** ⚠️