Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting up default locale #98

Open
alaksandarjesus opened this issue Sep 22, 2016 · 3 comments
Open

Setting up default locale #98

alaksandarjesus opened this issue Sep 22, 2016 · 3 comments

Comments

@alaksandarjesus
Copy link

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.

@bretkikehara
Copy link
Collaborator

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
#98, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AA0EEM9ALbsuAgzp8dt4KkusDFtqA61kks5qspCNgaJpZM4KD9Ws
.

Sincerely,
Bret Ikehara

Sent from my iPhone

@youfacepalm
Copy link

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

@studiocircus
Copy link

studiocircus commented Nov 22, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants