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.

How to read current language from ng-1 in a hybrid Angular app?

See original GitHub issue

I’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:closed
  • Created 7 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
ocombecommented, Nov 4, 2016

we should ask @amcdnl, he’s the only one I know using an hydrib app in production

0reactions
lionelBcommented, Dec 26, 2017

@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

Read more comments on GitHub >

github_iconTop 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 >

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