server side rendering with multiple langulage translation

106 views
Skip to first unread message

sunnyp...@gmail.com

unread,
Dec 14, 2018, 7:02:30 AM12/14/18
to Angular and AngularJS discussion
Hi everyone, 

I have created angular project with angular and django rest api. and used ngx-translate for multiple language support.
and I need a server side rendering for seo of my site.


So when my first landing page render from from node express server, split time it comes in english after it translates in a selected language. 

I have added 

export class TranslateUniversalLoader implements TranslateLoader {
getTranslation(lang: string): Observable<any> {
return of(TRANSLATIONS[lang].default);
}
}





TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
useClass: TranslateUniversalLoader,
// deps: [HttpClient]
}
}), Is there any solution ?


Sander Elias

unread,
Dec 18, 2018, 12:45:37 AM12/18/18
to Angular and AngularJS discussion
Hi Sunny.

Can you build a minimal representation of your issue? That way, I can take that, and give it a spin, and fix it, or hand it over to the responsible maintainer. 
A minimal representation is a repo with only the code and 3rth parties that are essential to reproduce your issue. (by the way, building such a thing is also a good tool to diagnose your problem to begin with. I solved 90% of my own problems by creating such a thing)

Regards
Sander
Reply all
Reply to author
Forward
0 new messages