{"action":"created","issue":{"url":"https://api.github.com/repos/angular-translate/angular-translate/issues/1330","labels_url":"https://api.github.com/repos/angular-translate/angular-translate/issues/1330/labels{/name}","comments_url":"https://api.github.com/repos/angular-translate/angular-translate/issues/1330/comments","events_url":"https://api.github.com/repos/angular-translate/angular-translate/issues/1330/events","html_url":"https://github.com/angular-translate/angular-translate/issues/1330","id":121889409,"number":1330,"title":"translate does not work properly with useStaticFilesLoader ","user":{"login":"kenp77","id":10065668,"avatar_url":"https://avatars.githubusercontent.com/u/10065668?v=3","gravatar_id":"","url":"https://api.github.com/users/kenp77","html_url":"https://github.com/kenp77","followers_url":"https://api.github.com/users/kenp77/followers","following_url":"https://api.github.com/users/kenp77/following{/other_user}","gists_url":"https://api.github.com/users/kenp77/gists{/gist_id}","starred_url":"https://api.github.com/users/kenp77/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kenp77/subscriptions","organizations_url":"https://api.github.com/users/kenp77/orgs","repos_url":"https://api.github.com/users/kenp77/repos","events_url":"https://api.github.com/users/kenp77/events{/privacy}","received_events_url":"https://api.github.com/users/kenp77/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-12-13T00:36:59Z","updated_at":"2015-12-13T15:52:57Z","closed_at":null,"body":"Hi,\r\n\r\nWhen i use StaticFilesLoader, the tanslation is not done when i load the page for the first time.\r\n Also, when i click my second link (fr_FR)  for the first time, it translate in english and when click it for the second time, it translated in french !.  It's weird what is happening here.\r\n\r\nHere's my code : \r\n ```JAVASCRIPT\r\n  $translateProvider.useStaticFilesLoader({\r\n    prefix: 'l10n/',\r\n    suffix: '.json'\r\n  });\r\n\r\n // Tell the module what language to use by default\r\n  $translateProvider.preferredLanguage('en_US');\r\n ```\r\n\r\nNote that the Json file is well formated and loaded since i'm able to translate when i hit the translation links for the second time !\r\n\r\nJson files : \r\n\r\nEN : \r\n ```JSON\r\n\r\n{\r\n\t\"HELLO\"        : \"Hi\"\r\n}\r\n```\r\nFR:\r\n ```JSON\r\n{\r\n\t\"HELLO\"        : \"Bonjour\"\r\n}\r\n ```\r\n\r\nMy controller : \r\n ````JAVASCRIPT\r\n$scope.hello= $translate.instant('HELLO');\r\n\t\r\n  $scope.setLang = function(langKey) {\r\n    // You can change the language during runtime\r\n    $translate.use(langKey);\r\n\r\n   $scope.hello= $translate.instant('HELLO');\r\n ```\r\n\r\nView : \r\n\r\n ```HTML\r\n  <p>\r\n    <a href=\"#\" ng-click=\"setLang('en_US')\">English</a>\r\n    |\r\n    <a href=\"#\" ng-click=\"setLang('ru_RU')\">Русский</a>\r\n  </p>\r\n\r\n   <p>{{hello}}</p>\r\n ```\r\n\r\n\r\n\r\nNote that everything works fine when i use this instead of json file :  \r\n\r\n ```\r\n  $translateProvider.translations('en_EN', {\r\n    \"HELLO\"        : \"Hi\"\r\n  });\r\n  $translateProvider.translations('fr_FR', {\r\n    \"HELLO\"        : \"Bonjour\"\r\n  });\r\n```\r\n\r\nAny idea why i'm not able to translate properly when i use the json files ?"},"comment":{"url":"https://api.github.com/repos/angular-translate/angular-translate/issues/comments/164269790","html_url":"https://github.com/angular-translate/angular-translate/issues/1330#issuecomment-164269790","issue_url":"https://api.github.com/repos/angular-translate/angular-translate/issues/1330","id":164269790,"user":{"login":"kenp77","id":10065668,"avatar_url":"https://avatars.githubusercontent.com/u/10065668?v=3","gravatar_id":"","url":"https://api.github.com/users/kenp77","html_url":"https://github.com/kenp77","followers_url":"https://api.github.com/users/kenp77/followers","following_url":"https://api.github.com/users/kenp77/following{/other_user}","gists_url":"https://api.github.com/users/kenp77/gists{/gist_id}","starred_url":"https://api.github.com/users/kenp77/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kenp77/subscriptions","organizations_url":"https://api.github.com/users/kenp77/orgs","repos_url":"https://api.github.com/users/kenp77/repos","events_url":"https://api.github.com/users/kenp77/events{/privacy}","received_events_url":"https://api.github.com/users/kenp77/received_events","type":"User","site_admin":false},"created_at":"2015-12-13T15:52:57Z","updated_at":"2015-12-13T15:52:57Z","body":"I created a plunk : http://plnkr.co/edit/U7xbn621mF60UgkxkXiO?p=preview\r\n"}}