{"action":"created","issue":{"url":"https://api.github.com/repos/angular-translate/angular-translate/issues/1628","repository_url":"https://api.github.com/repos/angular-translate/angular-translate","labels_url":"https://api.github.com/repos/angular-translate/angular-translate/issues/1628/labels{/name}","comments_url":"https://api.github.com/repos/angular-translate/angular-translate/issues/1628/comments","events_url":"https://api.github.com/repos/angular-translate/angular-translate/issues/1628/events","html_url":"https://github.com/angular-translate/angular-translate/issues/1628","id":184855450,"number":1628,"title":"Angular-translate.useStorage(“customStorage”) is not working with Custom Storage","user":{"login":"omairkhan","id":2535661,"avatar_url":"https://avatars.githubusercontent.com/u/2535661?v=3","gravatar_id":"","url":"https://api.github.com/users/omairkhan","html_url":"https://github.com/omairkhan","followers_url":"https://api.github.com/users/omairkhan/followers","following_url":"https://api.github.com/users/omairkhan/following{/other_user}","gists_url":"https://api.github.com/users/omairkhan/gists{/gist_id}","starred_url":"https://api.github.com/users/omairkhan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/omairkhan/subscriptions","organizations_url":"https://api.github.com/users/omairkhan/orgs","repos_url":"https://api.github.com/users/omairkhan/repos","events_url":"https://api.github.com/users/omairkhan/events{/privacy}","received_events_url":"https://api.github.com/users/omairkhan/received_events","type":"User","site_admin":false},"labels":[{"id":119440754,"url":"https://api.github.com/repos/angular-translate/angular-translate/labels/waiting","name":"waiting","color":"e11d21","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-10-24T14:24:13Z","updated_at":"2016-11-01T13:59:41Z","closed_at":"2016-10-31T12:55:00Z","body":"### Angular-translate.useStorage(“customStorage”) is not working with Custom Storage\n\nhttp://stackoverflow.com/questions/40214521/angular-translate-usestoragecustomstorage-is-not-working-with-custom-storage\n\nI am new in angular-translate. I have implemented everything, but failed to implement customStorage for storing the state of angular-translate.\n\nMy configuration file:\n\n```\nvar app = angular.module('app', ['ngRoute', 'ngToast', 'angularMoment', 'pascalprecht.translate', 'ngCookies'])\n.config(['$translateProvider', function ($translateProvider) {\n        // add translation table\n        $translateProvider.fallbackLanguage('en');\n\n        // remember language\n        $translateProvider.useStorage('customStorage');\n\n```\n\nMy customStorage service use localstorage is defined as below:\n\n```\n(function () {\n    angular.module('app').service('customStorage', function () {\n\n        return {\n            put: function (name, value) {\n                debugger\n                if (typeof (Storage) !== \"undefined\") {\n                    // Store\n                    localStorage.setItem(name, value);\n\n                } else {\n                    \"Sorry, your browser does not support Web Storage...\";\n                }\n            },\n            get: function (name) {\n                debugger\n                // Retrieve\n                localStorage.getItem(name);\n            }\n        }\n    })\n});\n```\n\nI am getting the following error:\n\nError I am facing due to this above code.\n\nI have included all the required files in the configuration in bundle.config file in ASP.NET MVC.\n\n```\nbundles.Add(new ScriptBundle(\"~/js/translation-plugins\")\n\n           .Include(\"~/node_modules/angular-cookies/angular-cookies.min.js\")\n           .Include(\"~/bower_components/angular-translate/angular-translate.min.js\")\n           .Include(\"~/bower_components/angular-translate-storage-cookie/angular-translate-storage-cookie.min.js\")\n           .Include(\"~/bower_components/angular-translate-storage-local/angular-translate-storage-local.min.js\")\n           .Include(\"~/bower_components/angular-translate-loader-static-files/angular-translate-loader-static-files.min.js\")\n           );\n```\n### ASP.NET MVC\n\n*angular-translate - v2.12.1 - 2016-09-15 version of angular-translate\n-  AngularJS v1.3.15 version of angular\n- Firefox, 49.0.2\n### Steps to reproduce\n\nhttp://stackoverflow.com/questions/40214521/angular-translate-usestoragecustomstorage-is-not-working-with-custom-storage\n### Expected behaviour\n\nWhenever I refresh the page, it should fetch the language from custom storage. As useStorage is not working in my case properly. is it compatibility issue with angular version or translate version or anybody can help to identify my mistake? \nwhenever I refresh the page, it throw error that \nError: [$injector:unpr] Unknown provider: customStorageProvider <- customStorage <- $translate\nhttp://errors.angularjs.org/1.3.15/$injector/unpr?p0=customStorageProvider%20customStorage%20%3C-%20%24translate\nreturn new ErrorConstructor(message);\n\n![a](https://cloud.githubusercontent.com/assets/2535661/19649484/678d7d46-9a1f-11e6-8ff3-33879399b66a.png)\n\nhere is the plunker example:\nhttp://plnkr.co/edit/mJhwlmRdqQhvJBJv6sOo?p=preview\n"},"comment":{"url":"https://api.github.com/repos/angular-translate/angular-translate/issues/comments/257573206","html_url":"https://github.com/angular-translate/angular-translate/issues/1628#issuecomment-257573206","issue_url":"https://api.github.com/repos/angular-translate/angular-translate/issues/1628","id":257573206,"user":{"login":"omairkhan","id":2535661,"avatar_url":"https://avatars.githubusercontent.com/u/2535661?v=3","gravatar_id":"","url":"https://api.github.com/users/omairkhan","html_url":"https://github.com/omairkhan","followers_url":"https://api.github.com/users/omairkhan/followers","following_url":"https://api.github.com/users/omairkhan/following{/other_user}","gists_url":"https://api.github.com/users/omairkhan/gists{/gist_id}","starred_url":"https://api.github.com/users/omairkhan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/omairkhan/subscriptions","organizations_url":"https://api.github.com/users/omairkhan/orgs","repos_url":"https://api.github.com/users/omairkhan/repos","events_url":"https://api.github.com/users/omairkhan/events{/privacy}","received_events_url":"https://api.github.com/users/omairkhan/received_events","type":"User","site_admin":false},"created_at":"2016-11-01T13:59:41Z","updated_at":"2016-11-01T13:59:41Z","body":"Thanks Jan. I am sorry to be rude little :)\nbut 👍\n\nجزاک اللہ خیراً\nRana Umair\nWebsite <http://www.accordax.com> | Mob : 0092-3224201085\n\nOn Mon, Oct 31, 2016 at 5:56 PM, Jan Philipp <notifications@github.com>\nwrote:\n\n> A getter must return the value, i.e. https://github.com/angular-\n> translate/angular-translate/blob/2.13.0/src/service/\n> storage-local.js#L35-L41\n>\n> —\n> You are receiving this because you authored the thread.\n> Reply to this email directly, view it on GitHub\n> <https://github.com/angular-translate/angular-translate/issues/1628#issuecomment-257286707>,\n> or mute the thread\n> <https://github.com/notifications/unsubscribe-auth/ACaw7Vz9pYQ410G1FfHZkAHbpwcgu6xQks5q5eVwgaJpZM4Ke2lJ>\n> .\n>\n"}}
{"actor":{"display_login":"omairkhan"}}