Skip to content

[i18n] future 2.x plan #9104

Closed
Closed

Description

@vicb

Features planned for 2.0:

  • gender
  • pluralization
  • runtime compiler
  • offline compiler
  • xliff support
  • hash message ids
  • i18n messages

fix issues:

fix post 2.0:

Activity

  1. thelgevold commented on Jun 9, 2016

    @thelgevold
    Contributor

    @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?

  2. robwormald commented on Jun 9, 2016

    @robwormald
    Contributor

    @thelgevold like most things in ng2, the standalone repos existed for early prototyping. major work is typically done inside of this one.

  3. added this to the Angular 2 Final milestone on Jun 9, 2016
  4. added
    area: i18nIssues related to localization and internationalization
    on Jun 9, 2016
  5. marcalj commented on Jun 10, 2016

    @marcalj

    Hi, there's any document about how it will work?
    I'm wondering if I can write keys in markup and normal text in translation files like I'm using with angular-translate.

    {{ 'HOMEPAGE__ACTION__SIGNUP' | translate }}

    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!

  6. vicb commented on Jun 10, 2016

    @vicb
    ContributorAuthor
  7. marcalj commented on Jun 11, 2016

    @marcalj

    Thanks Victor! Any plans to include number abbreviations? It's something i18n context aware.

  8. vicb commented on Jun 16, 2016

    @vicb
    ContributorAuthor

    @marcalj could you please create a separate issue with more details ? Thanks (but probably not for 2.0 anyways)

  9. self-assigned this
    on Jun 23, 2016
  10. dagerber commented on Jun 24, 2016

    @dagerber

    Is or will there be support for dynamic translations (loaded from a server)?
    Any plans to document i18n in the near future?
    Thanks!

  11. vicb commented on Jun 24, 2016

    @vicb
    ContributorAuthor

    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.

  12. jaska45 commented on Jul 1, 2016

    @jaska45

    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:

    • Several different APIs and methods.
    • You have to modify your templates so much from original that templates become hard to read and maintain.
    • You have to manually update the original resource file and make sure it is in sync with the IDs used in the template

    What we really need is

    • One single official localization method with solid resource format (XML or JSON based)
    • Minimal affect to templates. For example only add "localize" attribute into root element and possible "noloc" attributes into those elements that are not localized.
    • Ability to add localization comments to the strings in the templates.
    • A tool that scans source code extracting orignal strings and comments into resource file. Use as permanent ids as possible. For example use id attributes or if such is not provided use combination of location and original string value.
    • This resource file should be able to store plain strings, strings with patterns ({{...}}), pluralized strings and gender strings little bit like Android's value files.
    • Easy way to package localized resources and to download them as needed
    • Ability to change language without reload.

    I am ready to help if you guys need some help.

  13. vicb commented on Jul 1, 2016

    @vicb
    ContributorAuthor

    @jaska45 most your wishes should come true. One exception: "Ability to change language without reload.". Changing a language will imply bootstrapping a new app.

  14. jaska45 commented on Jul 1, 2016

    @jaska45

    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.

  15. choeller commented on Jul 4, 2016

    @choeller
    Contributor

    @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.

  16. 101 remaining items

  17. ocombe commented on Mar 16, 2017

    @ocombe
    Contributor

    @Thomas-Kuipers @thelgevold I'm working on it, and it will be available in 4.1 or 4.2 (most likely)

  18. rayer4u commented on Mar 21, 2017

    @rayer4u

    @ocombe
    how to deal with static text in interpolation, which can't use select translation.

    <div i18n>{{exercise._desc ? exercise._desc : 'empty'}}</div>
    

    string 'empty' can't be translate

  19. ocombe commented on Mar 21, 2017

    @ocombe
    Contributor

    @rayer4u this is not the subject of this issue, for support questions you should use stackoverflow or gitter.
    I'll answer this one anyway, but don't ask further questions here that are unrelated to i18n future plans please.

    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.

  20. martinmcwhorter commented on Mar 21, 2017

    @martinmcwhorter

    Off Topic: I Apologize
    @rayer4u The solution is to use static translations:

    <div *ngIf="exercise?._desc">{{ exercise?._desc }}</div>
    <div *ngIf="!exercise?._desc" i18n>empty</div>
    
  21. rayer4u commented on Mar 22, 2017

    @rayer4u

    @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.
    @martinmcwhorter Thanks for your reply. We write a lot mixed if/else logic to output diffrent i18n text in template, this is the easiest one. Maybe put runtime text logic in template is a bad choice.

  22. elvisbegovic commented on Mar 29, 2017

    @elvisbegovic
    Contributor

    maybe this is bad idea but can't angular add automatically @@id in our i18n attributes when we extract first time ?

  23. ocombe commented on Mar 29, 2017

    @ocombe
    Contributor

    No because we would have to maintain this when you edit the code.
    Let's say that you have two blocks of i18n code that are the same, we add the ids, and then you change one of them, the ids don't match which means that the next extraction will skip on of those...

  24. elvisbegovic commented on Mar 29, 2017

    @elvisbegovic
    Contributor

    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

    @ocombe

  25. ocombe commented on Mar 29, 2017

    @ocombe
    Contributor
  26. ocombe commented on May 2, 2017

    @ocombe
    Contributor

    We are now at v4 so I'm closing this issue, please follow up in #16477 for our plans for v4 and beyond.

  27. angular-automatic-lock-bot commented on Sep 11, 2019

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  28. locked and limited conversation to collaborators on Sep 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area: i18nIssues related to localization and internationalization

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions