Skip to content
This repository has been archived by the owner on Aug 22, 2024. It is now read-only.

Translation support #7

Open
Rycochet opened this issue Sep 18, 2011 · 3 comments
Open

Translation support #7

Rycochet opened this issue Sep 18, 2011 · 3 comments

Comments

@Rycochet
Copy link
Member

Needs a way of choosing which strings are to be translated and which not.

Translated strings are kept within a text file -

plugins/mmoCore/mmoWhatever/text.en.yml

  • The automatic file extraction in MMOPlugin class will extract them to the correct place.

Default built in language must always be "en" - but any language is permitted in the name.

Need to check what languages exist in onEnable, and provide a /reload style command to grab it from storage again.

When no translation is available it should use the default text.

When a language file exists it should automatically add any newly found untranslated strings to it (for updating the file without having to manually compare them).

Internal strings used for id should be the actual English version of the string.

Methods should translate transparently - this means that only the varargs versions of them should be used...

@Xaymar
Copy link

Xaymar commented Oct 2, 2011

i18n per-plugin translation has been added into mmoCore. Language Names should follow ISO-639 or it will throw an exception.
Things left to do:

  • Download languages from (pluginname).mmo.me.uk
  • Allow selection of which to load and enable(i18n.yml in plugin jar)
  • Allow selection of what language to set as default(i18n.yml in plugin jar)

@Rycochet
Copy link
Member Author

Rycochet commented Oct 2, 2011

Having a domain per plugin would make it significantly harder to have mirrors - currently all subdomains are the same as mmo.me.uk/subdomain/ - so thinking that "locale" should be the subdomain used - then when mirrors come along it's just a case of adding them to a list rather than messing with DNS settings.

What's in there is a good start - but needs to migrate over to using Locale and ResourceBundle - use YAML for the file wrapper (looks like it can be done relatively easily, but i might be wrong).

The string key needs to be translated from the "normal" string - it needs to effectively be a URI - so any non-allowed characters should be changed into underscores, and multiple underscores changed into a single one, something like key.replaceAll("[./, :;]+", "_")... While that should be the "standard" way to do it, it should also support custom keys, so maybe have the key transformation as a method, or have an optional boolean arg to tell it not to use it.

The selection and use needs to be separate to the actual translations available - and needs to be within mmoCore itself.

Thinking that there should be a "/language xx,yy,zz" command, so the players can set the order of languages preferred. Fallback would always be the default language, which would need to be the built in one and should always be "en" (other plugins can use what they want, but if it's part of the suite then it needs to follow the standards).

Translating should be left alone for now, but options might include command, file-reload, re-download, and possibly UI.

@ghost ghost assigned Xaymar Oct 2, 2011
@Xaymar
Copy link

Xaymar commented Oct 11, 2011

Modified the i18n Implementation to be easier to understand. Removed myself from being assigned for now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants