there's a method $translateProvider.storagePrefix()
which you can use for that.
Angular translate: change the cookie name
-
13-10-2022 - |
Pregunta
I'm using angular translate plugin: https://github.com/angular-translate
I'd like to use cookiestorage. When store the preference using
$translateProvider.useCookieStorage();
I see that a new cookie is created and is named: ng_translate_lang_key.
Can I change the cookie name? How can I do this?
Solución
Otros consejos
This should work in latest version,
storagePrefix : Adds prefix to the storageKey
// This is the module constant.
angular.module('pascalprecht.translate').constant('$STORAGE_KEY', 'NG_TRANSLATE_LANG_KEY');
// and this is how you can change this constants in your app.config assuming that you they cookie key will be name 'locale'
$translateProvider.storageKey('locale');
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow