mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-3784] support for browser cultures (i18n) (#4066)
* support language cultures * update docs * fix typo * fix tests * correctly replace fallback translations * login dialog fixes * fix error component * [denys-i18n-cultures] Fix error content unit tests
This commit is contained in:
committed by
Eugenio Romano
parent
d6df5bc862
commit
b5f9036545
@@ -117,24 +117,24 @@ describe('UserPreferencesService', () => {
|
||||
|
||||
it('should return as default locale the app.config locate as first', () => {
|
||||
appConfig.config.locale = 'fake-locate-config';
|
||||
spyOn(translate, 'getBrowserLang').and.returnValue('fake-locate-browser');
|
||||
spyOn(translate, 'getBrowserCultureLang').and.returnValue('fake-locate-browser');
|
||||
expect(preferences.getDefaultLocale()).toBe('fake-locate-config');
|
||||
});
|
||||
|
||||
it('should return as default locale the browser locale as second', () => {
|
||||
spyOn(translate, 'getBrowserLang').and.returnValue('fake-locate-browser');
|
||||
spyOn(translate, 'getBrowserCultureLang').and.returnValue('fake-locate-browser');
|
||||
expect(preferences.getDefaultLocale()).toBe('fake-locate-browser');
|
||||
});
|
||||
|
||||
it('should return as default locale the component property as third ', () => {
|
||||
spyOn(translate, 'getBrowserLang').and.stub();
|
||||
spyOn(translate, 'getBrowserCultureLang').and.stub();
|
||||
expect(preferences.getDefaultLocale()).toBe('en');
|
||||
});
|
||||
|
||||
it('should return as locale the store locate', () => {
|
||||
preferences.locale = 'fake-store-locate';
|
||||
appConfig.config.locale = 'fake-locate-config';
|
||||
spyOn(translate, 'getBrowserLang').and.returnValue('fake-locate-browser');
|
||||
spyOn(translate, 'getBrowserCultureLang').and.returnValue('fake-locate-browser');
|
||||
expect(preferences.locale).toBe('fake-store-locate');
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user