question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItĀ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ivy doesn't pick up translation files

See original GitHub issue

šŸž bug report

Affected Package

probably @angular/localize

Is this a regression?

in comparison to v8, yes

Description

I’m not sure is it a bug or problem with my configuration. I’m testing new translation features from v9 and set up a small application following this guide https://next.angular.io/guide/i18n#merge-the-completed-translation-file-into-the-app

I don’t have any error but the compiler says that translation is missed for all string, despite the fact that I provided xlf-file with translation.

Another interesting observation is that string ids are different from the specified in xlf-files, even the string with the fixed id resetButton has another id "resetButton␟878de3ad44e634ecaf219427d948689bd975e1af␟1029122298839770722" in the message.

It looks like ids change every build and that’s probably the reason why compuler is unable to find translations, but it’s only my gues

šŸ”¬ Minimal Reproduction

Here’s the test application I’m playing with https://github.com/fetis/ng9translation

Try ng serve -c=ru to see the problem. The locale is set to Russian but none of the strings are translated.

The same result for ng build --prod or ng build -c=ru

šŸŒ Your Environment

Angular Version: Angular CLI: 9.0.0-rc.7 Node: 12.4.0 OS: darwin x64

Angular: 9.0.0-rc.7 … animations, cli, common, compiler, compiler-cli, core, forms … language-service, platform-browser, platform-browser-dynamic … router Ivy Workspace: Yes

Package Version

@angular-devkit/architect 0.900.0-rc.7 @angular-devkit/build-angular 0.900.0-rc.7 @angular-devkit/build-optimizer 0.900.0-rc.7 @angular-devkit/build-webpack 0.900.0-rc.7 @angular-devkit/core 9.0.0-rc.7 @angular-devkit/schematics 9.0.0-rc.7 @angular/localize 9.0.0-rc.0 @ngtools/webpack 9.0.0-rc.7 @schematics/angular 9.0.0-rc.7 @schematics/update 0.900.0-rc.7 rxjs 6.5.3 typescript 3.6.4 webpack 4.41.2

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10

github_iconTop GitHub Comments

1reaction
mstawickcommented, Jan 4, 2020

I had the same problem. It turned out that ng add added some old rc0 version of @angular/localize. Upgrading to rc7 fixed the issue for me. Also it seemed to work with xlf2 format, even with the old @angular/localize version.

0reactions
angular-automatic-lock-bot[bot]commented, Feb 10, 2020

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Maintaining Multi-language Angular Applications with i18n
Translating files manually​​ Duplicate the <source>... </source> element in the text node, rename it to target , and then replace its content withĀ ......
Read more >
Ivy User Manual - or emacs
Ivy manual, version 0.13.0. Ivy is an interactive interface for completion in Emacs. Emacs uses completion mechanism in a variety of contexts: code,...
Read more >
Documentation (2.1.0) | Apache Ivyā„¢ @version@
Welcome to the official Ivy documentation. What is Ivy? Ivy is a tool for managing (recording, tracking, resolving and reporting) project dependencies.
Read more >
Localizing your app - Angular Hispano
Create translation files for each language by copying the source language file. To avoid confusion with multiple translations, you should organize the languageĀ ......
Read more >
Common Errors with Exporting and Importing Translation Files
The file that you're trying to import doesn't have a valid language code, or the language code is in the wrong place. Make...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found