maptool
maptool copied to clipboard
Tools for MT Script i18n
Is your feature request related to a problem? Please describe. Internationalisation/Localisation can be a pain. I believe BoT has incorporated some, and I just altered my smart doors to allow it. Don't know how Wolph did his but chances are it's different to the way I did it. It would be nice if there were some MT Script functions available that enabled people to do this.
Describe the solution you'd like
A defined i18n data structure and possibly a reserved property name to store it in. I used a straightforward JSON object.
{"en-au": {"stringKey1":"stringValue1", "stringKey2":"stringValue2"}, "en-uk": {}, "en-us":{} etc. }
Functions like
i18n.getLocale() that returns the locale for the campaign/server/client, and
i18n.getText(stringKey) that returns the value based on the current or default locale.
and possibly a simple translation editor people could use to add translations.
Additional context This might (or might not) help give user content a broader reach across the globe.
Love this idea, and love the work on the smart doors exploring it. Here are my ideas that I'd like to add to the pot:
- String Parameters. I'd love to see string parameters supported (e.g. :name uses their weapon)
-
Shorthand function In additional to a long function name, a short alias for the string retrieval function would make it convenient to use. In PHP, I use the double underscore function,
__( _messageKey_ )
. - Crowdsourced default strings. It would be great to have some default translations available. There is an indie game dev polyglot project with thousands of public strings.
- Campaign level storage. I think translations should be campaign-wide, probably using campaign notebooks (#1665). Additional translation strings could be created/updated with macros.
Might be related: Translation support for macros/frameworks
No. Translation support for macros/frameworks is related to this.