06c: Use translations in TS code
See original GitHub issueUse TranslateService
in TS classes:
- component’s implementations
- Page Meta Resolvers (search files for phrase
extends PageMetaResolver
) - Http Error Handlers (search files for phrase
extends HttpErrorHandler
) - anything else you find
When posible, it would be good to firstly move hardcoded text from code to HTML template, and then to translate it using cxTranslate
pipe. When it’s not possible, we have to use asynchronous TranslationService.translate
method in the code.
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
06c: Use translations in TS code · Issue #1809 · SAP/spartacus
When posible, it would be good to firstly move hardcoded text from code to HTML template, and then to translate it using cxTranslate...
Read more >i18n Translate.instant with parameters - angular - Stack Overflow
1 Answer 1 · You are sure that your translation files are already loaded and don't need updates: translate.instant('key') · You are not...
Read more >XLIFF 1.2 Specification - OASIS Open
The translated text is contained in a <target> element that has the same inline codes available to it as does the <source> element....
Read more >Angular Localization - Unleash the full power of i18next - locize
You can add your translations either by importing the individual json files or via API or by using the CLI. npm install i18next-locize-backend....
Read more >Angular Internationalization
Extract text for translation into different languages; Format data for a specific locale ... Translated names including time zones, languages, and countries.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Changes has been pushed to
feature/GH-1809_use-translations-in-TS
branch. Few things came up during the work:text
s for adding a message. Will create a ticket for that.<cx-card>
and<cx-sorting>
has been also equipped with cxTranslate but we need to ensure/handle situations where the input data come from backend (OrderHistoryListWsDTO.sorts
). Also chceckout use those components (see above).Hardcoded string that has been founded so far in the TS files: