-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
[i18n] future 2.x plan #9104
Comments
@vicb I have seen a few postings about i18n in the angular repo. How does this relate to https://github.com/angular/i18n? Is this a new initiative? |
@thelgevold like most things in ng2, the standalone repos existed for early prototyping. major work is typically done inside of this one. |
Hi, there's any document about how it will work?
Coding like this, one external person can edit all supported languages (since they reside in JSON/po file, one file per language). If the main language is in the markup, it blocks all revisions until a developer can change the string in the markup code. Thanks! |
@marcalj The (outdated) spec is https://docs.google.com/document/d/1mwyOFsAD-bPoXTk3Hthq0CAcGXCUw-BtTJMR4nGTY-0/edit. Your use case is supported. |
Thanks Victor! Any plans to include number abbreviations? It's something i18n context aware. |
@marcalj could you please create a separate issue with more details ? Thanks (but probably not for 2.0 anyways) |
Is or will there be support for dynamic translations (loaded from a server)? |
The current plan is to generate a binary per locale. We will work on the doc as the features become available. We should definitely have a minimal doc for the 2.0 release. |
What do you mean by "binary per locale". Is the deployed resource file going to be binary little bit like PO/MO where MO is used insted of PO to improve performance. There are also bad examples in binary deployment such as XAML/BAML. I am not very happy to the current Anguar localization methods. These are the reasons:
What we really need is
I am ready to help if you guys need some help. |
@jaska45 most your wishes should come true. One exception: "Ability to change language without reload.". Changing a language will imply bootstrapping a new app. |
Thanks. Sound very good. Language change is something that occurs seldom and in that case it is acceptable that some state is lost. Definetely lowest priority in my list and not worth spending too much efforts. |
@vicb I'm not sure if I understand this "binary per locale" correctly, but would that mean, that it's not possible to add translations at runtime? We are currently building SAAS with tenant support, where each tenant can extend our system by providing their own set of Form-Definitions and their own set of translations, so in our case it would be really important to be able to add translations at runtime. |
The @angular/common DatePipe (date_pipe.ts) currently contains this TODO on line 15:
Is the ability to pass in a locale string to the DatePipe included in the i18n plans for the 2.0 release? |
@vicb Our app sets the frontend language once we fetch user object from network after bootstrapping the application. So, did you define if this process of re-boostrapping would be easy? |
There's one bit of information I can't find anywhere, just to confirm and be able to sleep at night :) |
There is no plan to support po for 2.0. You should be able to convert from/to xliff. sorry for your nights ! |
What's the thought behind storing strings in XML format? Never ran into any issues extracting to POT and compiling PO to JSON in angular-gettext. It's served us extremely well: // en-GB.json, cached into localStorage after first request
"en-GB": {
"Hello {{firstName}}": "{{firstName}}, Gutentag"
} Random question: any thoughts about translated URLs in the router? |
@vsavkin what are the plans ? |
We are not planning to provide any support for translated URLs until the final is out. We had some ideas on ways to do that after that, but we haven't made any decisions. |
ng2 i18n gave me a headache. I was looking for i18n directive in exports :D to no end... Looking through the test specs, and code the lightning struck me: The template compiler itself will transform and localize the template. Am I right, that the basic workflow for i18n will be like this:
Because if it is, for the time being I will use a custom "i18n" directive to mimic the very-very basics of translation until 2.0 hits. Is this the intended workflow for i18n in angular2 in the future? |
@concept-hf that is right, see the doc that I linker earlier in this discussion. You'll run ng-xi18n to create the xliff. We have a couple of directives and filter for ICU messages |
@vicb Will be available in the upcoming RC5? :) |
Depends on when RC5 is... otherwise will be in RC6 |
What version of XLIFF will be supported? 1.2 or 2.0 or both? |
I found a problem with plurals and select: are you sure it is correctly implemented? If I have just normal string, I can export them with the Using
and
I get many parsing errors like this:
Using the comments syntax I get no error while extracting:
but then what I get in the XLF file is just empty tags:
I am doing something wrong? Edit: using
|
how to translate Date/Time ? |
The date is translated using the date pipe
…On Wed, 4 Jan 2017, 08:12 zh99998, ***@***.***> wrote:
how to translate Date/Time ?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#9104 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABI5-gHZiWOREPwucdqwRhVIs9xwMgorks5rO1RngaJpZM4IxhKY>
.
|
@feloy , your example only let's you switch the lang on the login page, what if you want to switch the lang when logged in, and without a browser refresh? How to manually destroy the application and bootstrap it again? |
@dietergeerts that's only possible with JIT, not with AOT. |
@rolandoldengarm , it's also possible with AOT if you load your translations on application load. I'm currently using something in between ngx-translate and the official i18n, in the sense that we use pipes to get the translations (pure ones), but we only load one language at startup, and switching the language requires a reboot of the application (If only we had routing reload, as the i18n setup is done in one of the root resolves) |
Do you have any updates on the roadmap? Specifically for an i18n implementation for translations outside of templates. |
I am also very interested in the capability to translate strings in TypeScript. Any ETA on this? |
For custom Cucumber steps, you should generate a file using the JUnit formatter and write it to the $CIRCLE_TEST_REPORTS/cucumber directory
new(text, old_name, new_name, comment, singleton = false) Creates a new Alias with a token stream of text that aliases old_name to new_name, has comment and is a singleton context.
@Thomas-Kuipers @thelgevold I'm working on it, and it will be available in 4.1 or 4.2 (most likely) |
@ocombe
string 'empty' can't be translate |
@rayer4u this is not the subject of this issue, for support questions you should use stackoverflow or gitter. The answer is: you can't do it, dynamic translations are not supported by Angular i18n since it works at compile or build time, and not at runtime. |
Off Topic: I Apologize
|
@ocombe I Apologize for off Topic, no need to reply. I just have this need and can't find any quick way to discuss it. I think this may be concerned by angular i18n plan. As Angular i18n plan don't deal with interpolation, a extra mark/find/replace is better build time i18n solution for me right now. |
maybe this is bad idea but can't angular add automatically |
No because we would have to maintain this when you edit the code. |
I confirm it's bad idea, can you explain how angular know to attribut same id to string when we extract again and again, how they keep same ID on string. so powerful but I don't undersand :s |
We are now at v4 so I'm closing this issue, please follow up in #16477 for our plans for v4 and beyond. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Features planned for 2.0:
fix issues:
<ul>
&<li>
around ICU mess… #9283)fix post 2.0:
NgLocalization
implementation per locale#
andoffset
#9117The text was updated successfully, but these errors were encountered: