Angular Internationalization (i18n): 1 Codebase - 3 Locales (en/fr/de)

Angular Internationalization (i18n): 1 Codebase - 3 Locales (en/fr/de)
I had lots of fun making this project! We look at how to create an Angular project that targets various localizations (en/fr/de) and outputs three separate builds.
Article for this video can be found here: alligator.io/angular/internat...
Learn Ionic 4 From Scratch: leanpub.com/learnionic4fromsc...
Interested in learning more about Ionic? Check out my new site: ionicworkshop.com
Chat with me, join the Slack group! bit.ly/JoinPaulHallidaySlack
Twitter: / ionicworkshop
My personal channels:
/ paulhalliday.io
/ paulhalliday_io
/ paulhal

Пікірлер: 66

  • @blokche_dev
    @blokche_dev5 жыл бұрын

    Hello from France! =) Useful and quality content, as usual. Great to see new tutorials and videos.

  • @paulhalliday

    @paulhalliday

    5 жыл бұрын

    Thanks Blokche! Hopefully my french wasn't too bad. :)

  • @LarsRyeJeppesen
    @LarsRyeJeppesen4 жыл бұрын

    I really wish Angular added support for json files if you want a simpler/faster setup. Xlf tools are either expensive or bad. Just a json file consisting of { id: value } would be sufficient.

  • @edwinabraham6705
    @edwinabraham67053 жыл бұрын

    Simple and straight. super good.

  • @chrissigrilus6390
    @chrissigrilus63904 жыл бұрын

    Super Video! Es hat mir sehr geholfen mein neue Projekt international zu machen. Danke : ) Deine Übersetzung ist korrekt ; )

  • @harish636303
    @harish6363034 жыл бұрын

    This is very clear. Thanks Paul

  • @dond3lta
    @dond3lta5 жыл бұрын

    Hey Paul, thanks for the nice video! Since you asked for the correctness of the german translation: Although the construction header ("Im Bau") is fair enough, as a german I'd rather call it "Im Aufbau" as it is called in the description. To be "im Bau" is actually a german phrase and means to be in jail ;)

  • @not-a-review-channel
    @not-a-review-channel3 жыл бұрын

    Crisp and clear !

  • @LarsRyeJeppesen
    @LarsRyeJeppesen4 жыл бұрын

    Great video. I'm curious about a thing: when you add the "de"/"en" properties in angular.json, what about all the other properties? How does the angular builder know about those? Should you not copy all properties from "production", or are they somehow included when selecting target "de" or "en" ? confusing

  • @alxizr
    @alxizr4 жыл бұрын

    @Paul Halliday #Paul Halliday greate video, thank you. I have a question for you, how do you make i18n to support multiple languages in the same build ? According to this video we need a build for each language we support.

  • @miketan373
    @miketan3733 жыл бұрын

    Well done! Thx for showing. Since Angular 9 is out of today, would it be possible to make a video of dynamic language control with in the app if it would be available?. Different deployments for each language is quite cumbersome, I have never seen an app working on different ports just for languages ;-)

  • @RezetRoy
    @RezetRoy5 жыл бұрын

    Please make video about other angular i18n modules (ngx-translate, angular-i18next)

  • @EvgenyAlterman
    @EvgenyAlterman3 жыл бұрын

    great tutorial! thank you!

  • @JeanBaptistePoujol
    @JeanBaptistePoujol4 жыл бұрын

    Merci pour cette vidéo pédagogique

  • @unreadwitharun
    @unreadwitharun4 жыл бұрын

    Can we get a build of same component in different language on user action ? Rather than deploying a certain build, I want to export a page in different language as per user selects.

  • @thebetacoders4738
    @thebetacoders47385 жыл бұрын

    What VS Code theme you are using in this video. Please mention name.

  • @girlsincode9255
    @girlsincode92553 жыл бұрын

    i love your VSCode and terminal themes, what are their names ? also i like that you zoom properly the screen/text so it's easy to follow it.

  • @paulhalliday

    @paulhalliday

    3 жыл бұрын

    Thanks! I mostly use Shades of Purple these days: marketplace.visualstudio.com/items?itemName=ahmadawais.shades-of-purple

  • @rafaellauxen3577
    @rafaellauxen35775 жыл бұрын

    Nice tutorial!

  • @paulhalliday

    @paulhalliday

    5 жыл бұрын

    Thanks!

  • @johanjurie
    @johanjurie5 жыл бұрын

    Great video! Any options to change locale at run time? Any libraries you can suggest to change languages on the fly?

  • @paulhalliday

    @paulhalliday

    5 жыл бұрын

    Johan, I'd potentially look at ngx-translate: github.com/ngx-translate/core i18n within Angular should be better supported from 8-9+ onward.

  • @biovawan

    @biovawan

    3 жыл бұрын

    @ngneat/transloco. Best at the moment, IMHO. There is also a doc site with comparison

  • @Xeberus18
    @Xeberus184 жыл бұрын

    can you show an example for dynamic translation, f.ex. an {{element.label}} gets multiplie column labels for a table and you need to write the en.js and maybe de.js or some other language and how to solve that situation. i just started with angular some month ago and i can't find a solution online. i know there is ng xi18n out there, but no where i can find an example for my problem only standart translation.

  • @sanyogitalondhe2815
    @sanyogitalondhe28154 жыл бұрын

    Thank you so much..

  • @tuviakhusid4320
    @tuviakhusid43204 жыл бұрын

    Hi, Very helpful video. I have a question: when I run npm run start:fr (for french), even if I set my default port, it is still creating for me another localhost port (for example, localhost:4200). What if I want to use a same port, I mean a same URL and just to change /fr or /ru? Is there any solution for Internationalization using a same port with only /language? Thanks

  • @paulhalliday

    @paulhalliday

    4 жыл бұрын

    This version of i18n is purely build based and you can't do runtime changes like this with the current version. I think this is a proposed feature of 8.x. or 9.x.

  • @poongodia23
    @poongodia232 жыл бұрын

    Can we dynamically modify the language by changing the language code in the url? If so how to do the routing configuration for existing application. e.g localhost/4200/#/home. Is it possible to render localhost/4200/#/en/home

  • @masterlup
    @masterlup4 жыл бұрын

    Maybe a good primer but: + Lets say you now add 2 more elements that need translation. How do I append my 3 files (en, fr, de) so that the two new elements are there but the old working stuff is still here? + How do I change the locale dynamically at runtime? + What is the best practice, copy pasting by hand is not?

  • @sahinnelson1777
    @sahinnelson17773 жыл бұрын

    If i add "npm run int:extract" comment, i get an error like: ERROR in Unexpected value 'undefined' imported by the module 'DynamicModule. can u explain y?

  • @amvwordamr2652
    @amvwordamr26524 жыл бұрын

    hi . thank you for this video , nicely video and very help me . i have a question : "outputPath": "dist/under-construction-de/" this file auto make or i should make Manually this file and i have error "ERROR in EISDIR: illegal operation on a directory, read" and i think outputPath path is failed please help me for this and i thank you very much

  • @MoussaEltayeb
    @MoussaEltayeb5 жыл бұрын

    Hello Paul, perfect as usual. Do you have plans to create a video about Server Side Rendering to handle SEO meta tags for JavaScript apps using Angular/ Firestore /Firebase Hosting?

  • @paulhalliday

    @paulhalliday

    5 жыл бұрын

    This is something I can look at Moussa! Thanks for the comment.

  • @MoussaEltayeb

    @MoussaEltayeb

    5 жыл бұрын

    @@paulhalliday Thanks!

  • @Josecho93

    @Josecho93

    5 жыл бұрын

    @@paulhalliday Hi Paul, there is some video about that topic already? Thanks.

  • @paulhalliday

    @paulhalliday

    5 жыл бұрын

    Not yet, but still looking into creating one for this.

  • @Josecho93

    @Josecho93

    5 жыл бұрын

    Thank you@@paulhalliday , i will stay tunned for that

  • @seeteshwt6592
    @seeteshwt65923 жыл бұрын

    latest version of cli doesnt create the messages file using ng xi18n

  • @mindsteamers
    @mindsteamers2 жыл бұрын

    Das ist korrekt!

  • @kingalex1193
    @kingalex11932 жыл бұрын

    how can be create links for each language

  • @thiepwong
    @thiepwong4 жыл бұрын

    Hi, I have a question. My backend server return a message after an api request. And I need to translate that to other language in component ts file, how can I do that? Thank you!

  • @SampathLokuge

    @SampathLokuge

    4 жыл бұрын

    Do that on the API side according to the locale send with the API request from the front end.

  • @sanyogitalondhe2815
    @sanyogitalondhe28154 жыл бұрын

    Thank you. when trying to run npm run start:fr -- --port=4201 getting error An unhandled exception occurred: Configuration 'fr' is not set in the workspace. need help

  • @robinbehrens9528

    @robinbehrens9528

    4 жыл бұрын

    I have the same problem.. :/

  • @vijaykrishna4738

    @vijaykrishna4738

    3 жыл бұрын

    how did you solve the problem , even Im getting the same

  • @beratsulimani9823
    @beratsulimani98235 жыл бұрын

    Hi Paul, great tutorial, but there if we have 6 languages we will have 6 builds of application, which is insane, i think it will have an improvement in version 8 of i18n, Also to do in a GUI use qt5 lang to open xlf files.

  • @paulhalliday

    @paulhalliday

    5 жыл бұрын

    I'll check qt5 out Berat, thanks!

  • @LarsRyeJeppesen

    @LarsRyeJeppesen

    4 жыл бұрын

    Why is it insane? If you go for performance, you really don't want runtime translation, you want compile-time translation.

  • @cristiansalazar-caxvalencia

    @cristiansalazar-caxvalencia

    4 жыл бұрын

    @@LarsRyeJeppesen no exactly, all depend of the usecase, in my work we need to implement an dynamic translatation from a server external

  • @LarsRyeJeppesen

    @LarsRyeJeppesen

    4 жыл бұрын

    @@cristiansalazar-caxvalencia true - good point. So as I understand it, the new $localize in ng9/ivy will support both

  • @cristiansalazar-caxvalencia

    @cristiansalazar-caxvalencia

    4 жыл бұрын

    ​@@LarsRyeJeppesen Oh that's great :D. Thank you for the info

  • @balduran
    @balduran4 жыл бұрын

    German dev here. Maybe you should use deepl.com for translation. It works with machine learning (google and microsoft translator doesn't) and works far better than most of its competitors. But the language selection is limited though. #NotSponsored #NoAd

  • @michaelgamel4761
    @michaelgamel47615 жыл бұрын

    What if i want to use these translations inside ts files, how we can do it ?

  • @YinonOved

    @YinonOved

    5 жыл бұрын

    exactly. that's an issue i think they still need to resolve

  • @paulhalliday

    @paulhalliday

    5 жыл бұрын

    I agree, looking forward to v8!

  • @YinonOved

    @YinonOved

    5 жыл бұрын

    Paul Halliday did they announce a solution coming next?

  • @alyster8397
    @alyster83972 жыл бұрын

    npm run start:fr -- --port:4201 doesn't work ! What can I do to see the result ?

  • @1ucasum

    @1ucasum

    2 жыл бұрын

    see again: kzread.info/dash/bejne/amycp5qYfZiZg6Q.html

  • @marcosguimaraes9083
    @marcosguimaraes90834 жыл бұрын

    Perfect tutorial, but angular 9 need -> ng add @angular/localize Great

  • @purduetom90
    @purduetom902 жыл бұрын

    good video. These xml files are very clunky and much more error prone than simple JSON files that other solutions use (ngx-translate and @ngneat/transloco

  • @sourandbitter3062
    @sourandbitter30622 жыл бұрын

    starts at 3:56

  • @hocinehope8880
    @hocinehope88803 жыл бұрын

    Why it has to be so complicated...

  • @surajdeshmukh93
    @surajdeshmukh933 жыл бұрын

    This won't work from Angular 10 onwards. Warnings:- Option "i18nFile" is deprecated: Use 'locales' object in the project metadata in stead. Option "i18nFormat" is deprecated: No longer needed as the format will be determ ined automatically. Option "i18nLocale" is deprecated: Use 'localize' instead.

  • @harshilmakwana9089

    @harshilmakwana9089

    3 жыл бұрын

    Same, did you found any solution for that?

  • @IsmayilIsmayilov
    @IsmayilIsmayilov3 жыл бұрын

    this is the worst way to translate web site I guess

Келесі