Andrew Peacock
Posts: 0
Joined: Thu Jan 09, 2014 10:03 pm

AngularTranslate tutorial

Hi team,
Is there any chance you could add a tutorial for AngularTranslate implementation, i the same way you've done i18next for JQ builds, please?

(Or some other Angular translation module, if not).

Regards,
Andy

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

AngularTranslate tutorial

Hello Andrew,

We passed your request to our development team and will get back to you with the update.

Andrew Peacock
Posts: 0
Joined: Thu Jan 09, 2014 10:03 pm

AngularTranslate tutorial

Thanks Evgene.

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

AngularTranslate tutorial

Hi Andrew,

We have published a Development Tip in our blog, please check it out: https://blog.appery.io/2016/03/develo...

Andrew Peacock
Posts: 0
Joined: Thu Jan 09, 2014 10:03 pm

AngularTranslate tutorial

Thanks Illya, I just saw that! Appreciate the prompt and helpful support :-)

Andy

Andrew Peacock
Posts: 0
Joined: Thu Jan 09, 2014 10:03 pm

AngularTranslate tutorial

Hi
I'm almost there - if I use
$translateProvider.preferredLanguage('de');
or
$translateProvider.preferredLanguage('en');

the translation works. So thanks again for your tutorial.

But there's just one thing I'm stuck on - how to change the language dynamically.

I thought it would be:

code
var $translate = Apperyio.get('$translate');
$translate.use(languageCode);
/code

where languageCode is passed in as "en" or "de" in your tutorial. But that doesn't seem to do anything, even though $translate is defined, and can be logged to console as:

code
function (a,b,c,h,j){var m=j&&j!==i?L(j)j:i;if(angular&#46;isArray(a)){var n=function(a){for(var e={},f=[],g=function(a){var f=d&#46;defer(),g=function(b){e[a]=b,f&#46;resolve([a,b])};return R(a,b,c,h,j)&#46;then(g,g),f&#46;promise},i=0,k=a&#46;length;k>i;i++)f&#46;push(g(a));return d&#46;all(f)&#46;then(function(){return e})};return n(a)}var o=d&#46;defer();a&&(a=K&#46;apply(a));var p=function(){var a=e?I[e]:I[m];if(l=0,k&&!a){var b=f&#46;get(v);if(a=I,g&&g&#46;length){var c=J(g,b);l=0===c?1:0,J(g,e)<0&&g&#46;push(e)}}return a}();if(p){var q=function(){j(m=i),ca(a,b,c,h,m)&#46;then(o&#46;resolve,o&#46;reject)};q&#46;displayName="promiseResolved",p"finally"}else ca(a,b,c,h,m)&#46;then(o&#46;resolve,o&#46;reject);return o&#46;promise}/code

Any inspiration you can share?

Regards,
Andy

Andrew Peacock
Posts: 0
Joined: Thu Jan 09, 2014 10:03 pm

AngularTranslate tutorial

Ooh, I lied. I've just republished to make another change, and it's working. Bizarre.
Apologies for the confusion.

Great support from the team - pass on my regards to everyone concerned!

Regards,
Andy

Mark Wong
Posts: 0
Joined: Sat Feb 14, 2015 7:47 am

AngularTranslate tutorial

Would you mind to tell me what solution did you use to solve the problem, I cannot change the language dynamically

Andrew Peacock
Posts: 0
Joined: Thu Jan 09, 2014 10:03 pm

AngularTranslate tutorial

I'm not sure, it just started working. I'll tease out the code later tonight and share here in case it helps.

Mark Wong
Posts: 0
Joined: Sat Feb 14, 2015 7:47 am

AngularTranslate tutorial

Thank you, I tried your code:
code
var $translate = Apperyio&#46;get('$translate');
$translate&#46;use("de");/code
but somehow it doesn't work for me

Return to “Issues”