-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Ionic2 & Angular's official i18n #8542
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
Comments
Hello, thanks for using Ionic! We actually recommend that devs use |
@jgw96 thanks for pointing out the link to docs. Maybe it make sense to add to the page keywords "i18n" and "l10n" so it is searchable? |
Could you please clarify why you recommend an unofficial library over the official one? |
AS of now ng2-trnslate doesn't support the pluralization and contexts. |
Sorry for my necromancy - but I think this is still a valid issue and my findings might at least serve as a warning for others...: I decided to use angular's official i18n lib instead of During development this worked fine and I encountered no problems. However when trying to build an optimized version of my app for deployment, which doesn't take ages to start (by using the The reason for this, is that for production optimization ionic's There is a lot of discussion about this on angular forums... But as far as I understand: Angular's position is not going to change soon in that regard. To still be able to create language switchers, the forums currently recommend to create a landing page or implement server redirect logic. However these approaches will hardly work for a mobile app... (Currently the AOT compilation for ionic seems to be hardcoded NOT to use angular's i18n at all.) Does anyone have a suggestion (a sample app, coming by this issue or at least a hint) or will I have to rewrite everything to work with ng2-translate? |
@lentschi, I feel your pain. Theoretically you can hack Ionic and ship multiple bundles of the app 1 per language. But that is hard, unpredictable and dangerous path. I would advise to go with ng2-translate that was renamed to ngx-translate. It may be boring and time consuming but a predictable way. I've done that with my https://DebtsTracker.io/ and it works fine. |
@astec Yes, I was afraid, that this would be the answer... |
Multiple bundles - increased app size. May be ok for your app but probably is not as a general solution. |
Hmm... Probably.... But I guess the minified app js wouldn't take up much space, even if translated into a lot of languages. |
However - you're right - I don't think that was angular's wisest design choice - that's why there's so much discussion about it. |
Hey. hope this issue will be resolved sometime... |
Also it seems |
also what about the |
Hey. |
Video on the futur of i18n in Angular (Angular connect) https://youtu.be/DWet6RvhHWI?t=21m12s |
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out. |
Short description of the problem:
It's not clear if it is possible to use official Angular 2 way to internationalize Ionic 2 apps.
My understanding it is not currently supported as AoT version of Angular 2 i18n requires to:
what is not the case with Ionic 2 build process as far as I understand.
What behavior are you expecting?
I expect Ionic 2 docs to have a page/section dedicate to i18n & l10n.
Ideally Ionic should support the i18n process provided by Angular 2.
Angular 2 libraries for translation:
Which Ionic Version? 2.x
The text was updated successfully, but these errors were encountered: