angular-i18n

Angular: How to display a date in French format

混江龙づ霸主 提交于 2019-12-11 14:33:09
问题 I am an Angular beginner, I read the documentation of Angular, and it's hard for such an elementary thing... I want that the dates and other things in my application have the French locale, and not the default 'en-US'... I started to read this Angular documentation, that seems a little bit incomplete, cause, I did the doc states, and failed: >...\ClientApp>ng serve --configuration=fr Configuration 'fr' could not be found in project 'ClientApp'. OK, now I look on another documentation page on

Angular 6: i18n: How to update an existing .xlf file that has already been translated?

你离开我真会死。 提交于 2019-12-06 02:23:37
问题 In Angular 6, now that I think I comprehend how to make the i18n files and utilize them (e.g. https://angular.io/guide/i18n), I am wondering about maintenance of said files. If I go in and change the html, as I understand it, I would have to regenerate the messages.xml file using the ng xi18n command, which then implies that I would be required to retranslate the file into the other languages or, at the very least, do some kind of visual matching so I can move the content of some div tag to

angular-i18n select syntax in attribute

烈酒焚心 提交于 2019-12-05 21:01:20
I was trying to use the i18n SELECT syntax to translate a placeholder for an input field: <input placeholder="{userRole, admin{you are an admin} other {you are a user}}" i18n-placeholder="MYAPP.PLACEHOLDER|my placeholder"> this results to the following xlf file entry: <trans-unit id="85f60a0a03b3b4e189252fc0157dd403e806bbcc" datatype="html"> <source>{userRole, admin{you are an admin} other {you are a user}}</source> <context-group purpose="location"> <context context-type="sourcefile">path/to/my/file.component.ts</context> <context context-type="linenumber">4</context> </context-group> <note

Angular 6 - i18n vs. ngx-translate

不问归期 提交于 2019-12-03 06:47:56
问题 I am working on a large project using angular 6. This project needs significant i18n integration. I am trying to make the right decision as to how to proceed. The way I see it is that I can choose between: ngx-translate (https://github.com/ngx-translate/core) Angular i18n (https://angular.io/guide/i18n) I am leaning toward choosing option 2; Angular's i18n. This is because it is Angular's own built in package and that just sits better with me. Apparently it is also better for SEO and

Angular 6 - i18n vs. ngx-translate

◇◆丶佛笑我妖孽 提交于 2019-12-02 23:54:26
I am working on a large project using angular 6. This project needs significant i18n integration. I am trying to make the right decision as to how to proceed. The way I see it is that I can choose between: ngx-translate ( https://github.com/ngx-translate/core ) Angular i18n ( https://angular.io/guide/i18n ) I am leaning toward choosing option 2; Angular's i18n. This is because it is Angular's own built in package and that just sits better with me. Apparently it is also better for SEO and marginally better for performance without any work around. Also, now it is released I think ngx-translate

angular-i18n Angular 6 Internationalisation : How to deal with variables

▼魔方 西西 提交于 2019-12-01 16:06:32
I've read the entire doc here : https://angular.io/guide/i18n I can't make heads or tails of how I'm supposed to handle a html tag of this nature : <div i18n="@@myId" class="title-text">{{currentPage}}</div> or one like this : <div i18n="@@myId" class="title-text" [innerHTML]="currentPage"></div> it doesn't mention any variable text at all as if they just assume we'd have all our names and text hard coded into the html. a language file is supposed to look like this : <?xml version="1.0" encoding="UTF-8" ?> <xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2"> <file source

angular-i18n Angular 6 Internationalisation : How to deal with variables

大兔子大兔子 提交于 2019-12-01 15:23:26
问题 I've read the entire doc here : https://angular.io/guide/i18n I can't make heads or tails of how I'm supposed to handle a html tag of this nature : <div i18n="@@myId" class="title-text">{{currentPage}}</div> or one like this : <div i18n="@@myId" class="title-text" [innerHTML]="currentPage"></div> it doesn't mention any variable text at all as if they just assume we'd have all our names and text hard coded into the html. a language file is supposed to look like this : <?xml version="1.0"

Angular 5 internationalization

大城市里の小女人 提交于 2019-11-28 04:39:10
I'm building an application using the latest Angular5 and what I need is for a user to be able to switch languages. I've never had to implement this in an Angular2+ (actually I'm using Angular5). I need to set translations in two places: Component's template html - change labels to the specified language In code in the component.ts file - I may need to translate some strings that are built dynamically under particular conditions in the code I was looking at ngx-translation and it looks to do everything I need, as in it allows you to change language without rebuilding your code, see here .