ngx-translate / http-loader

A loader for ngx-translate that loads translations with http calls
MIT License
193 stars 69 forks source link

how to load multiple translation files from different sources? #6

Open yuriykuzin opened 7 years ago

yuriykuzin commented 7 years ago

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!

desfero commented 7 years ago

+1

stgunholy commented 7 years ago

+1

desfero commented 7 years ago

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

stgunholy commented 7 years ago

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

coldhamix commented 7 years ago

+1

webben-de commented 7 years ago

+1

JavanXD commented 7 years ago

+1

Dyskovsky commented 7 years ago

+1

Polgabarro commented 7 years ago

+1

burner-account commented 7 years ago

+1

eugensunic2 commented 7 years ago

This should have been out by now.

jeserkin commented 6 years ago

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

AlbertoFCasarrubias commented 6 years ago

+1

arjen42 commented 6 years ago

+1

CarlosPinedaT commented 6 years ago

+1

broweratcognitecdotcom commented 6 years ago

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.

Macadoshis commented 6 years ago

+1

alesmit commented 6 years ago

+1

ghost commented 6 years ago

same need here +1

Dodobibi commented 6 years ago

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

mischkl commented 6 years ago

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.

svemir commented 6 years ago

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

nirmalpatel59 commented 4 years ago

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');