How to read current language from ng-1 in a hybrid Angular app?
See original GitHub issueI’m submitting a … (check one with “x”)
[ ] bug report => check the FAQ and search github for a similar issue or PR before submitting
[x] support request => check the FAQ and search github for a similar issue before submitting
[ ] feature request
I’m using ng-2 translate in a hybrid ng-1/ng-2 app. My plan is to use Pascal Precht’s angular-translate to handle localization in the ng-1 code, and ng-2 translate to handle localization in the ng-2 code of the app.
In my existing ng-1 implementation, users can change their language from a dropdown, and it gets stored in $rootScope.currentLanguage. E.G. " $rootScope.currentLanguage = ‘de’ ". My question is: how can I read this value from $rootScope when initializing ng-2 translate, and how watch it and change the current language on the fly in ng2-translate when it changes?
Issue Analytics
- State:
- Created 7 years ago
- Comments:5
Top Results From Across the Web
How to translate your Angular app with ngx-translate
1. Add ngx-translate to your Angular application 2. Set up the TranslateService in your app.module.ts 3. Create your main language translation file (in...
Read more >Upgrading from AngularJS to Angular
In a hybrid application you run both versions of Angular at the same time. That means that you need at least one module...
Read more >Angular Hybrid app (use angularjs filters in Angular 4)
We have a huge number of filters to deal with Internationalization (date formats, number formats, language, etc with user profile preferences). Is there...
Read more >Upgrade from AngularJS to Angular 2 | by Gökhan Sari
The aim of this tutorial is to simplify the migration process for developers who want to upgrade their AngularJS applications to Angular 2...
Read more >Preparing your Angular 1 codebase to upgrade to React or ...
Use Webpack (Browserify, Rollup, etc.) to build your application bundle. · Convert stateful services and controllers to ES6 classes. · Abstract ...
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 FreeTop 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
Top GitHub Comments
we should ask @amcdnl, he’s the only one I know using an hydrib app in production
@IonPopescu Hello, I 'm currently working on a hybrid app. my angularJs (using angular-gettext) and angular(ngx-translate). I’m having translation problem when I want to downgrade an angular component used in an angularJs component. Do you managed to make it work ? thanks