-
Notifications
You must be signed in to change notification settings - Fork 78
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
Language persistence longer than session #86
Comments
@ivanstojkovicapps that's interesting, let me take a look and debug and get back to you, it should store in the cookie and be permanent but if that's not the case I might need to fix something. Btw, are you loading angular-cookies? What version of ng are you running? |
Hi, angular 1.4.2 I think the only problem is that the cookie expiration date is session. After the session is finished (on new one started) it doesn't have any data in the cookie and uses the default. |
@ivanstojkovicapps I see, that's interesting as I don't think we set the date anywhere. They might've added it in 1.4.x and I will have to take a look and update the codebase to conform. Thanks! |
perfect! |
Seems like we are using |
I don't think the issue is cookie store. @ivanstojkovicapps Please correct if I am wrong, but it seems your user session will clear the cookie at a given interval. If we want to persist the locale beyond the user session, then it has to be set in localStorage or sessionStorage instead of the cookie. |
imo, sessionStorage may suit the requirement, since sessionStorage may store the value longer than desired. |
still facing the same issue............. |
Hi,
is there a way to persist language longer than session.
If i set another language than my defaultLanguage, every time i refresh the page, it first loads the default language and than switches to selected language (i do that manually, after getting the user settings).
The problem would be solved it would be possible to save cookie longer then session.
I can do that manually, but every time the cookie gets overriden by default language because i have: persistSelection: true.
Here is the config:
app.value('localeConf', {
basePath: 'languages',
defaultLocale: 'en-US',
sharedDictionary: 'common',
fileExtension: '.lang.json',
persistSelection: true,
cookieName: 'COOKIE_LOCALE_LANG',
observableAttrs: new RegExp('^data-(?!ng-|i18n)'),
delimiter: '::'
}).value('localeSupported', [
'en-US',
'de-DE'
]).value('localeFallbacks', {
'en': 'en-US',
'de': 'de-DE'
});
Do you have any suggestions?
best regards Ivan
The text was updated successfully, but these errors were encountered: