mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ACS-5629] enhanced way of providing translations (#8763)
* enhanced way providing translations * update documentation * update documentation * test fixes * try add missing module import * inject i18n to core module to cause the setup
This commit is contained in:
@@ -28,6 +28,24 @@ export interface TranslationProvider {
|
||||
source: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate translation provider
|
||||
*
|
||||
* @param id Unique identifier
|
||||
* @param path Path to translation files
|
||||
* @returns Provider
|
||||
*/
|
||||
export function provideTranslations(id: string, path: string) {
|
||||
return {
|
||||
provide: TRANSLATION_PROVIDER,
|
||||
multi: true,
|
||||
useValue: {
|
||||
name: id,
|
||||
source: path
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
|
Reference in New Issue
Block a user