-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cross-platform I18N support #1741
Comments
This would be an extension? |
Well, if it will work on gwt too why not just a gdx package like math, scene2d and so on? |
To me this feels like an extension, not a core package. Maybe others won't |
If you guys feel like that, it's ok for me. I just thought that an extension having only 4 classes is a bit ridicolous, but still. :) |
Yea, you think it's only going to be 4 classes, but I will be willing to bet that it's going to grow a bit. |
Depends I guess; not much more to expand on an already existing and defined On Mon, Apr 21, 2014 at 10:51 PM, Matthew Johnston <notifications@github.com
|
I have to agree with @methius since java ResourceBundle is well defined and rather full featured. |
I have dealt with this problem myself as well and found that the only real problem here is the GWT backend, which doesn't even have Locale. I solved the GWT translations with JSON files and my own "MessageBundle", which I load via the language/country code instead of the Locale. I think something like this would fit well into the libgdx core as it probably will be small and many people might need it, but only if it supports all backends. Otherwise people will still need to come up with their own I18N systems... |
@nooone I fully agree with you about making it a core package and supporting all backends. BTW expect a PR for the Java version very soon. |
Internationalization / localization is a very important aspect of many apps, not least games.
I'm working on a cross-platform I18N package for my libgdx apps.
My work is heavily inspired to ResourceBundle + Control class from java.util which is something all Java developers are used to.
Unlike java.util.ResourceBundle, it works for Android 2.2 too (Control class has been introduced in API level 9).
It provides all the main features of java.util.ResourceBundle but I've removed some less common stuff:
Then I've implemented a FileControl class that can work with any gdx FileType and any encoding. If you don't specify any control when creating a bundle a default control is used, i.e. a FileControl with FileType.Internal and ISO-8859-1 encoding.
Users can also implement their own control class to support other sources (e.g. http instead of file system) and formats (e.g. xml instead of properties).
When it's finished - it works already for desktop and adroid platforms but some code cleanup is needed - I'll do a pull request if you're interested in.
In this case I'll need your help to support the gwt backend too.
What do you think? Suggestions, ideas?
The text was updated successfully, but these errors were encountered: