Skip to content
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

Feature: ng-add add translation to project #671

Open
kyubisation opened this issue Dec 1, 2020 · 1 comment
Open

Feature: ng-add add translation to project #671

kyubisation opened this issue Dec 1, 2020 · 1 comment
Labels
comp: angular Issues related to @sbb-esta/angular effort1: hours enhancement New feature or request help wanted Extra attention is needed

Comments

@kyubisation
Copy link
Collaborator

kyubisation commented Dec 1, 2020

We provide the translation files for german, french and english. We would like to automatically add these the the i18n section in the angular.json, if it is available.

      "i18n": {
        "locales": {
          "de-CH": {
            "translation": "src/i18n/messages.de-CH.xlf",
            "baseHref": "/de/"
          }
        },
        "sourceLocale": {
          "code": "en-CH",
          "baseHref": "/en/"
        }
      },

to

      "i18n": {
        "locales": {
          "de-CH": {
            "translation": [
              "src/i18n/messages.de-CH.xlf",
              "node_modules/@sbb-esta/angular/i18n/xlf/messages.de-CH.xlf"
            ],
            "baseHref": "/de/"
          }
        },
        "sourceLocale": {
          "code": "en-CH",
          "baseHref": "/en/"
        }
      },

DoD:

  • Rule implemented in ng-add, which converts the i18n entries to arrays or simply add the appropriate translation files
  • Check if xlf or xlf2 is used
  • Skip if no i18n entry is found
  • Be aware of the various formats the i18n section can have
@kyubisation kyubisation added comp: core Issues related to @sbb-esta/angular-core effort1: hours enhancement New feature or request help wanted Extra attention is needed labels Dec 1, 2020
@jeripeierSBB
Copy link
Collaborator

We are currently considering writing an importer for angular-t9n.

@kyubisation kyubisation added comp: angular Issues related to @sbb-esta/angular and removed comp: core Issues related to @sbb-esta/angular-core labels Jan 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp: angular Issues related to @sbb-esta/angular effort1: hours enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants