angular-localization
angular-localization copied to clipboard
Setting up default locale
Hi
I am trying to set the default locale and my configuration is as below.
`var localeConf = { basePath: 'languages', defaultLocale: 'ta-IN', sharedDictionary: 'common', fileExtension: '.lang.json', persistSelection: true, cookieName: 'COOKIE_LOCALE_LANG', observableAttrs: new RegExp('^data-(?!ng-|i18n)'), delimiter: '::', validTokens: new RegExp('^[\w.-]+.[\w\s.-]+\w(:.*)?$') };
var localeSupported = [ 'ta-IN', 'fr-FR', 'en-US' ]
var localeFallbacks = { 'ta': 'ta-IN', 'en': 'en-US', 'fr': 'fr-FR' }`
But i could not see the output for ta-IN.
Tested it with en-US and its working. Maintained the same folder structure too.
Try open the page in incognito mode. Iirc the default locale is cache in local storage On Thu, Sep 22, 2016 at 7:28 AM alaksandarjesus [email protected] wrote:
Hi
I am trying to set the default locale and my configuration is as below.
`var localeConf = { basePath: 'languages', defaultLocale: 'ta-IN', sharedDictionary: 'common', fileExtension: '.lang.json', persistSelection: true, cookieName: 'COOKIE_LOCALE_LANG', observableAttrs: new RegExp('^data-(?!ng-|i18n)'), delimiter: '::', validTokens: new RegExp('^[\w.-]+.[\w\s.-]+\w(:.*)?$') };
var localeSupported = [ 'ta-IN', 'fr-FR', 'en-US' ]
var localeFallbacks = { 'ta': 'ta-IN', 'en': 'en-US', 'fr': 'fr-FR' }`
But i could not see the output for ta-IN.
Tested it with en-US and its working. Maintained the same folder structure too.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/doshprompt/angular-localization/issues/98, or mute the thread https://github.com/notifications/unsubscribe-auth/AA0EEM9ALbsuAgzp8dt4KkusDFtqA61kks5qspCNgaJpZM4KD9Ws .
Sincerely, Bret Ikehara
Sent from my iPhone
Looks like I am having the same problem too. Followed everything as in the doc, tried in incognito mode but still the default locale is not changed
After a year later... I changed initialSetLocale() to follow the developer choice, not the client configuration
function initialSetLocale() { setLocale(cookieStore && cookieStore.get(localeConf.cookieName) ? cookieStore.get(localeConf.cookieName) : /* getPreferredBrowserLanguage() */ localeConf.defaultLocale); }