Hello, I'm using the TranslocoService
in a pipe and I would like to access a lazy loaded scope when I do :
this.transloco.translate('key', {}, 'scopeName')
I've got Missing translation for scopeName.key
. I tried to provide the TRANSLOCO_SCOPE in the module in which the pipe is declared, but it didn't help. Anyone has an idea how to fix that ?
translate
) you need to make sure the translations are loaded.take(1)
?
LanguageFallbackStrategy
in my app to try a set of fallback languages, e.g. fr-CA / fr / en. I think it works for a translation file fails to load.hi everyone, i hava. a problem, i can't get the translation in the scope 'countries'
the default language is 'it' so should get countries/it.json right?
i use nx
i tried also with inject theproviders: [
{
provide: TRANSLOCO_SCOPE,
useValue: 'countries',
},
],
inside the component and use the translate method but don't work 😕
getTranslation
uses an http request and not just import the files and return them as :import de from '@assets/i18n/de.json'
import en from '@assets/i18n/en.json'
export class TranslocoHttpLoader implements TranslocoLoader {
constructor() {}
getTranslation(lang: string): Observable<Translation> {
return lang === 'de' ? of(de) : of(en)
}
}
getScopeAndLangFromFullPath.js
filePath: /home/agent/_work/4/s/apps/frontend/src/assets/i18n/ar.json
translationPath: /home/agent/_work/4/s/apps/frontend/src/assets/i18n
Hello. I'm having trouble loading lang files in a nested component hosted in lazy module. For some reason it only loads on the second time the component is initialized. Repo here... https://github.com/vdiaz1130/transloco-nx
Appreciate the help.
if (isLocaleFormat(val)) {
return val;
}
Hey there Transloco-Team,
we got an Angular-App with an integrated login process (login without translation). We added Transloco's RootModule in our AppModule (like described here) without a default language (because we want the persisted user language to be the default one) -> so Transloco is bootstrapping with his default language 'en'. Additionally after a succesfull login we load the persisted user language from our backend server like described in your recipe "Prefetch the User Language" with the TranslocoService.
thanks in advance!