angular-translate icon indicating copy to clipboard operation
angular-translate copied to clipboard

Cookies problem

Open miraage opened this issue 12 years ago • 6 comments

So, I've added two files:

<script src="/js/angular-translate.js"></script>
<script src="/js/angular-translate-storage-cookie.js"></script>

Then tryied to init:

config.$inject = ['$translateProvider'];
function config($translateProvider) {
    $translateProvider
        .useUrlLoader('/app/crm/locales.json')
        .useCookieStorage()
        .preferredLanguage('en');
}

Getting error: Unknown provider: $cookieStoreProvider <- $cookieStore <- $translateCookieStorage <- $translate

What I do wrong?

miraage avatar Mar 27 '14 04:03 miraage

Solved problem by installing ngCookies module. Please, update docs according to this issue.

miraage avatar Mar 27 '14 05:03 miraage

Hello. Sorry, but I have same problem when use $translateProvider.useLocalStorage();: Uncaught Error: [$injector:unpr] Unknown provider: $translateLocalStorageProvider <- $translateLocalStorage <- $translate I'm include ngCookies: angular.module('starter', ['ionic', 'ngCookies', 'pascalprecht.translate']) and of course add <script src="lib/angular-cookies/angular-cookies.min.js"></script>. Where can be my error?

zloy531 avatar Jan 11 '15 00:01 zloy531

Hello, @zloy531. Can you show a plunker or something like that?

DWand avatar Jan 11 '15 09:01 DWand

@zloy531 you need to include angular-translate-storage-local.

miraage avatar Jan 11 '15 17:01 miraage

 Unknown provider: $translateLocalStorageProvider

is a general Angular JS error message meaning there is a missing component (named $translateLocaleStorage).

I'd suggest to read the corresponding chapter.

@zloy531 gives you actually the solution already.

knalli avatar Jan 11 '15 17:01 knalli

@zloy531 I had the same error, i included: /angular-translate-storage-cookie/node_modules/angular-cookies/angular-cookies.min.js and /angular-translate-storage-cookie/angular-translate-storage-cookie.min.js and it worked. downloaded from npm

abulazm22 avatar Jan 17 '16 10:01 abulazm22