[i18n] ability to dynamically load translations for the app
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
- Tipo di issue
- Bug
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- angular, typescript
- Ambito
- localization
Direzione di ricerca
Inizia con @angular/localize e la documentazione v8 JIT i18n collegata; confronta l’API v9 loadTranslations con il workflow richiesto XLIFF e runtime-locale. Il lavoro è completato quando esiste un approccio supportato per cambiare locale durante lo sviluppo, incluso il modo in cui vengono gestiti i dati XLIFF.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
🐞 bug report
Affected Package
@angular/localize
Is this a regression?
Yes, it's a regression from v8
Description
In v8 was a very handy solution to load your translation data for development.
It's described on this documentation page https://v8.angular.io/guide/i18n#merge-with-the-jit-compiler
With the migration to v9 there's no corresponding solution that will allow to quickly switch locales during runtime for development. As far as I understand, the suggested replacement is to run ng serve with the desired locale every time.
A little bit background here. We have 2 applications, every with 4 languages. For production, we build it with AOT as suggested. For development we use JIT and load corresponding translation depending on the browser URL (German for /de/ for example), this mimics prod behavior. So, to switch translation and check how the interface looks in a different language, you just need to pick up another item in the language menu. The page reloads at the same URL but with a different language. Starting from v9 it's not supported, so we would have to run ng serve every time for a new language and start from the home page for every language again.
What would be a suggested way repeat v8 behavior? I checked loadTranslatios but it accepts a key-value object, not a XLIFF data. Is any function that can transform from XLIFF to a format understandable for loadTranslations
🌍 Your Environment
Angular Version:
Angular CLI: 9.1.9
Node: 12.4.0
OS: darwin x64
Angular: 9.1.11
... animations, common, compiler, compiler-cli, core, forms
... language-service, localize, platform-browser
... platform-browser-dynamic, router
Ivy Workspace: Yes
Package Version
------------------------------------------------------------
@angular-devkit/architect 0.901.9
@angular-devkit/build-angular 0.901.9
@angular-devkit/build-ng-packagr 0.901.9
@angular-devkit/build-optimizer 0.901.9
@angular-devkit/build-webpack 0.901.9
@angular-devkit/core 9.1.9
@angular-devkit/schematics 9.1.9
@angular/cdk 9.2.4
@angular/cli 9.1.9
@angular/material 9.2.4
@angular/material-moment-adapter 9.2.4
@ngtools/webpack 9.1.9
@schematics/angular 9.1.9
@schematics/update 0.901.9
ng-packagr 9.1.5
rxjs 6.5.5
typescript 3.8.3
webpack 4.42.0
- Lingua principale
- TypeScript
- Stelle
- 27k
- Fork
- 11.8k
- Merge medio
- 16h 35m
- PR unite (30g)
- 176
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di angular/angular-cli
-
area: @angular/build gemini-triaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
angular/angular-cli#33955 ·
-
area: @angular/cli gemini-triaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
angular/angular-cli#33055 · 1 commento · 3 reazioni ·
-
unit-test: with --coverage, a setup file's hooks reach only the first spec file of each worker Apertaarea: @angular/build gemini-triaged
Difficoltà 4/5 3-5 giorni Idoneità per principianti 72/100
angular/angular-cli#34137 ·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34131 · 1 assegnatario ·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34130 · 1 assegnatario ·
Tutte le issue di angular/angular-cli
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
ontola/atomic-server#1625 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
melgarafael/DeskcommCRM#1451 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
-
bug via-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
bot:ai-assisted component:compact-js status:untriaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
midnightntwrk/midnight-sdk#403 ·