我正在尝试使用AngularJS翻译.我遇到的问题是我Unknown provider: $$cookieReaderProvider <- $$cookieReader <- $cookies <- $cookieStore <- $translateCookieStorage <- $translate <- $cookies在尝试使用时遇到错误$translateProvider.useCookieStorage();
我ngCookies在我的应用程序中注入了依赖项:
var nfqApp = angular.module('myApp', ['postServices', 'angularFileUpload', 'ngSanitize', 'ui.date',
'bootstrapLightbox', 'profileServices', 'ngRoute', 'angularMoment', 'pascalprecht.translate', 'ngCookies']);
Run Code Online (Sandbox Code Playgroud)
我还按以下顺序包含了与翻译和cookie相关的以下文件:
我的应用配置(我尝试使用cookieStorage:
myApp.config(['$translateProvider', function ($translateProvider) {
$translateProvider.translations('lt', {
"OTHER_LIKES" : "{peopleCount, plural, one {# kolega tai m?gsta} few {# kolegos tai m?gsta} other {# koleg? tai m?gsta}}",
"YOU_AND_OTHERS_LIKES" : "{peopleCount, plural, one {Tu ir # kolega tai m?gsta} few {Tu ir # kolegos tai m?gsta} other {Tu ir # koleg? tai m?gsta}}",
"YOU_LIKE" : "Tu m?gsti tai"
});
$translateProvider.translations('en', {
"OTHER_LIKES" : "{peopleCount, plural, one {# colleague likes this} few {# colleagues likes this} other {# colleagues likes this}}",
"YOU_AND_OTHERS_LIKES" : "{peopleCount, plural, one {You and # colleague likes this} few {You and # colleagues likes this} other {You and # colleagues likes this}}",
"YOU_LIKE" : "You like this"
});
$translateProvider.preferredLanguage('lt');
$translateProvider.fallbackLanguage('en');
$translateProvider.addInterpolation('$translateMessageFormatInterpolation');
$translateProvider.useCookieStorage();
}]);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5167 次 |
| 最近记录: |