Ore icon indicating copy to clipboard operation
Ore copied to clipboard

Long term localization

Open parlough opened this issue 6 years ago • 5 comments

Messages are now located in a configuration file, but we have not done much to utilize this to my knowledge. Sponge has quite a large international community with speakers of many languages as is seen by the Docs, and I think localization is quite important for the success, as full adoption, of Ore. You often see people asking to re-post projects on websites like mcbbs or similar, and people should feel comfortable on our own websites.

The requirements for this I suppose would be something along the lines of(feel free to edit):

  • [x] Work out some sort of translation system. Whether that is Crowdin, submitting language files directly as a PR, or whatever will work best.
  • [x] Add a UI element for switching between languages, as well as a percentage translated tag.
  • [x] Don't forget other parts of localization such as date format :)

  • [ ] Maybe add some sort of system for specifying a different home page for a specific language on your plugin page, so if a user has that language set and that project has a home page for that language created, it will automatically go to that language instead of the default. Lower priority but I think could be quite cool.
  • [ ] Eventually when we release a more standardized form of translation support in the API, some place to store language files or whatever the system will be for your plugin, would be fantastic.

parlough avatar May 09 '18 07:05 parlough

To fill in more info here, most stuff in Ore should already be easily localizable using the messages file. https://github.com/SpongePowered/Ore/blob/master/conf/messages

One thing that is currently missing are cases where we fall back to the default language. Cases where we don't have a language availible from a request. Stuff like emails and notifications for example.

Katrix avatar May 15 '18 05:05 Katrix

So, after looking a bit more into this I can share what I have found.

First of, to make it possible to use another language, a few steps need to be followed. First the language code has to be added to the configuration value play.i18n.langs. Next a file containing the strings need to be created called messages.<language code> in the conf directory.

Messages are curly brace formatted, not percentage formatted (My {0} is {1}).

Technically a lot of stuff should be ready just from that, but most likely a lot of things don't work nicely with that.

At the moment we also use the default language in many cases. I've already begun fixing that. Note that we need an additional setting in auth (that's where all the other account settings are) for the user language.

Katrix avatar May 18 '18 17:05 Katrix

@Katrix @phase Linked PR says that it 'partially resolves' this issue.

What remains?

ryantheleach avatar Jul 27 '18 07:07 ryantheleach

It doesn't solve the two lower points. Different home pages for plugins for different versions, and storing translation files on Ore. Both are IMO a bit lower priority than making most other parts of Ore localizable.

Katrix avatar Jul 27 '18 12:07 Katrix

Moving this to 2.0 as the low effort stuff of this has been implemented, and we'd probably need 2.0 wikis for the other stuff

Katrix avatar Feb 02 '19 21:02 Katrix