http-loader icon indicating copy to clipboard operation
http-loader copied to clipboard

how to load multiple translation files from different sources?

Open yuriykuzin opened this issue 8 years ago • 23 comments

Hi!

Can you please advise how can add additional translation files from some lazy loaded AOT module / library?

As an example, I have basic en.json in my application and want to add additional translations from my-library-en.json inside MyLibraryModule.

Thanks in advance!

yuriykuzin avatar May 23 '17 13:05 yuriykuzin

+1

desfero avatar Jun 13 '17 13:06 desfero

+1

stgunholy avatar Jun 18 '17 19:06 stgunholy

@stgunholy @yuriykuzin after looking at the source code currently it's not supported

desfero avatar Jun 18 '17 19:06 desfero

this would be really great to have. I currently have angular1 with angular-translate and we have like 6000 rows of localisation files and combining it into one file is like suicide...

stgunholy avatar Jun 18 '17 20:06 stgunholy

+1

coldhamix avatar Jul 10 '17 11:07 coldhamix

+1

webben-de avatar Aug 29 '17 15:08 webben-de

+1

JavanXD avatar Sep 06 '17 07:09 JavanXD

+1

Dyskovsky avatar Sep 26 '17 11:09 Dyskovsky

+1

Polgabarro avatar Sep 28 '17 10:09 Polgabarro

+1

burner-account avatar Oct 22 '17 16:10 burner-account

This should have been out by now.

eugensunic2 avatar Oct 26 '17 18:10 eugensunic2

There should be a wiki page IMO with description on how to create own loader.

jeserkin avatar Dec 11 '17 12:12 jeserkin

+1

AlbertoFCasarrubias avatar Dec 12 '17 22:12 AlbertoFCasarrubias

+1

arjen42 avatar Dec 15 '17 12:12 arjen42

+1

CarlosPinedaT avatar Jan 04 '18 14:01 CarlosPinedaT

I would like for my components to load their translations via http instead of doing it by module. So I guess it fits in with this request.

broweratcognitecdotcom avatar Feb 15 '18 09:02 broweratcognitecdotcom

+1

Macadoshis avatar Feb 16 '18 16:02 Macadoshis

+1

alesmit avatar Feb 26 '18 15:02 alesmit

same need here +1

ghost avatar Feb 28 '18 07:02 ghost

+1 TranslateHttpLoader override all translation set by setTranslation() before. Set an option for merging.

Dodobibi avatar Mar 11 '18 14:03 Dodobibi

As a workaround you can create your own TranslateLoader that loads and combines various sources for you. See the http-loader for an example, the interface is super-simple to implement.

mischkl avatar May 11 '18 12:05 mischkl

Also see https://github.com/denniske/ngx-translate-multi-http-loader

svemir avatar Jul 26 '18 21:07 svemir

Also see https://github.com/denniske/ngx-translate-multi-http-loader

@svemir Tried with ngx-translate-multi-http-loader. As per the code, we need to define all modules ( core, shared etc) in app.module.ts however, I am using module loading with ngx translate. e.g. this.translate.use(language + '/' + module);

so for the dashboard page, I am using this.translate.use('en/dashboard'); where this.translate is instance of TranslationService of ngx-translate.

How can I also include some other JSON in dashboard page? e.g. this.translate.use('en/dashboard'); this.translate.use('en/common');

nirmalpatel59 avatar Sep 16 '20 14:09 nirmalpatel59