linuxmint/Cinnamon — pull request #2282 by mtwebster (2013-07-21 19:22:29+00:00)
Title: [WIP] Allow translations with xlet settings API

cinnamon-settings portion is functional.

Basically how it will work:

-- Applet devs that wish to ship with translations for their applet settings can flag strings that can be translated by prefixing them with "$" in the settings-schema.json.

i.e. "description" : "$This is a translatable string"

If no translations exist initially, that's fine, the $ will just be ignored and stripped.

To provide translations, a subfolder, *settings-i18n*, will exist in the applet's directory.

Inside that directory, individual json files with the current LANG for a name, like "ja_JP.UTF-8.json" will exist. At runtime, when the settings are loaded by cinnamon-settings, all values in the config file will be translated to the current locale, if that locale's file exists.

The translation .json file will simply be:

```{
"This is a translatable string" : "Translated string",
"Adjust this to increase or decrease the width of this spacer" : "blah blah increase decrease"
}```

Where, the key for each line will be the flagged string ($-prefixed) and the value will be the replacement string.

-- I will develop a simple, easy to use gui for generating these translation files. I think it will be something where you just navigate to the applet's dir, run it, and it takes your current locale (or you can supply a different one) and it creates a list view of string/translation pairs that you can then edit and save - presumably you'd commit then open a pull request to the applet dev.