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
Dart internationalization library is an unusable mess - It needs a total redesign #15796
Comments
cc @alan-knight. |
This isn't very specific, and seems to cover quite a lot of separate points. The main point of the linked article (the link doesn't work for me, but the article is easy enough to find) seems to be that the intl package needs better documentation. It's also incomplete in that it isn't hooked up to a real translation system so you end up hand-writing JSON files in its own custom format, which isn't that useful, but it's mostly there as a hook for tests. That, combined with the lack of visible documentation obviously made it difficult for the author to figure out. For the other points. Transparency: But maybe what you mean by this is that you'd like an application written without any idea of internationalization should be able to be automatically localized by extracting all strings from the application. That seems very difficult to do, and does not necessarily yield the correct results if done. Typically doing translations requires additional information along with the basic strings, particularly when there are values interpolated into them. Integrated: a) Localization data should be included with components and failure to provide it should be an error. I don't think I agree with this. Feedback from users has typically been that the text in widgets is specified by the application. e.g. if I have a button widget, the button doesn't know what its text is, the application provides that. I don't know what "recognized at the language level" means, but anything that requires language changes would be difficult to implement in the short term. b) A unit system and data for all standard units should be included. Automated: b) Picking a locale without an explicit operation. Knowing if a localization file exists requires a round-trip to the server, so it's an async operation. So we require it to be explicitly done so that the application has something to wait on, and the ability to find out if the locale is available or not. c) Not changing other files. For numbers and dates we can either get the localization data from a file or we can have it imported as code. With the hopefully upcoming ability to do deferred loading of code that seems preferable to loading the data from files, so that is the only operation that's been implemented so far. I don't think there's any reason we couldn't also be able to load data from files. Removed Type-Defect label. |
Removed Library-Intl label. |
I don't seem to be getting any more information on this and it's not clear to me what action to take on this. Added WontFix label. |
This comment was originally written by @Emasoft As usual the community was forced to solve the problem with an hack. Here is an implementation of Gettext ( https://en.wikipedia.org/wiki/Gettext ) for Dart that solves with a workaround the localization deficiencies of Dart: The package is called "l10n": There is a discussion going on this on G+: It would be much better to implement a native solution like this into Dart. |
OK, but what do you mean by "like this". This seems quite similar to the mechanism in the Intl package already. It looks like you do the extraction of the messages yourself, it uses a different file format, and it generates all of the translated messages into a single library instead of multiple libraries with a single import point. What is it you're looking for a native mechanism to do differently? |
This comment was originally written by hangglide...@gmail.com @alanknight from your words it seems everything is simple. If Intl so good, please could you give the resource (I do not mean scattered intl readme.md from pub) where we can get the information how to work with Intl breaking messages into separate files? As I can see there is still no information regarding official i18l and l10n tutorial: dart-archive/www.dartlang.org#728 ( |
What sort of things are you looking for in the README but not finding? There's an example with an emphasis on using Polymer at https://github.com/dart-lang/sample-polymer-intl but it's more about using the translated messages in a custom element. There's an example in the example directory of the Intl package which you can see on https://github.com/dart-lang/intl/tree/master/example/basic It doesn't do the translation, it has the hard-coded translated versions there, but is an example of how the results are used. But essentially the steps are.
|
This issue has been moved to dart-lang/i18n#341. |
This issue was originally filed by @Emasoft
Internationalization in Dart it's a mess, and it's a big stumbling-block.
Read the following article for an in depth explanation:
http://japhr.blogspot.it/2013/12/code-generation-and-polymer-i18n.html
We are at the verge of 2014. We need a modern internationalization system integrated right into Dart.
Those are the features we need:
Thank you.
The text was updated successfully, but these errors were encountered: