{"_id":"@azerion/phaser-i18next","_rev":"12-52ce5e2207f5f6a9b32f0b0502a28d08","name":"@azerion/phaser-i18next","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.3":{"name":"@azerion/phaser-i18next","version":"1.0.3","author":{"name":"Azerion"},"license":[{"url":"https://github.com/azerion/phaser-i18next/raw/master/LICENSE","type":"MIT"}],"_id":"@azerion/phaser-i18next@1.0.3","maintainers":[{"name":"zbart","email":"b.smallenburg@azerion.com"},{"name":"florisdh","email":"florisdh@gmail.com"},{"name":"fbrq","email":"fabrique@orangegames.com"},{"name":"alebles","email":"a.bles@orangegames.com"}],"contributors":[{"name":"Ale Bles","email":"a.bles@azerion.com"}],"homepage":"https://github.com/azerion/phaser-i18next#readme","bugs":{"url":"https://github.com/azerion/phaser-i18next/issues"},"dist":{"shasum":"4a11608c6ebc5ab3fa2fab77d9e78c09833bd27f","tarball":"https://registry.npmjs.org/@azerion/phaser-i18next/-/phaser-i18next-1.0.3.tgz","fileCount":11,"integrity":"sha512-suFRab74i3iMweSsfxyQkEA8TMVHXIgWAhltCc9rS0o+rzVmkeJkjZT5g5BpCNPpdaqn/Soa7tzjHRmrE0AT5w==","signatures":[{"sig":"MEYCIQCzilt4Wjd52FFwzuYel4zRwoa+IQltRbvI8glphJx6NAIhANM120YOBNrlFD1cg/ilsWSeDevoxUEsn5XSQQarXP5/","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":155790,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJci6UmCRA9TVsSAnZWagAAF5gP/3J53aeThnuFOegWZyEo\nnqPv++OV6JgiDBaIl3vK0AWzE2+ExP2m6wLArf3bzYllXK4O4EsZAssQtssF\n+u+Bowibf1xg3FcttQg+BwZDZAPn164CHq5SKRK6wj4Vyo2cu/XOAhdqZICR\nUTaa1JwZDvgigug1ACssSzu2wRyWtEXp8mMBQAUbFO7uPTb1UkjyvQ7n6HYO\nrXGLOwb2vadpn5GEznIIX3q2dxpSEmztOcAuwgiW6m3wK/e7bx5LbmH8oDbJ\nM6Ud2QxGS9Tzma+eReaFnQH3q7lDiY1cjXk5HOIbXnQrorItPvZXheKMI7L+\nXLT+mASD5pSLN79q3RjInloH0JQ8HXjWSJeHPMZ83TLqdWHoKbyZbTHwuICB\n1Gq5rVACij+YdfexH3X+LjzC1bMBUT1xEZyUvQLt/ElWcOj1PyDPeHzEd099\n7kihNCrkv0JalsCxhoT7Excd+3kPvp7Z8YT92zzCLk8NgiOhZDDffZxIlfHe\n55mLO84i3VFSQcISterth2qlOakF/N+a8UuXgtFf/HZnrR7Y7Ssi63rtgwJg\ng0ZvY4LbFZFopQX2mnrH7nPZKj9wt5rVvWWeHgLfChVrxnJyzibtfnHIYJl8\nynhi2T3fc6MBD2dEh3ZkE57JugvbLENJ3+XrDraKomRVQwr0uC/FgvqXrtZ6\n3PNN\r\n=ljae\r\n-----END PGP SIGNATURE-----\r\n"},"config":{"name":"phaser-i18next"},"gitHead":"35069279e736d9385882689a38eb5d189f8d576d","_npmUser":{"name":"florisdh","email":"florisdh@gmail.com"},"repository":{"url":"git+ssh://git@github.com/azerion/phaser-i18next.git","type":"git"},"_npmVersion":"6.9.0","description":"Phaser plugin for translations using i18next.","directories":{},"_nodeVersion":"8.11.1","dependencies":{"i18next":"^8.4.3"},"_hasShrinkwrap":false,"devDependencies":{"grunt":"1.0.x","phaser":"2.6.2","grunt-ts":"^6.0.0-beta.11","typescript":"2.1.x","grunt-banner":"^0.6.0","@types/i18next":"^2.3.35","grunt-contrib-clean":"0.6.0","grunt-contrib-watch":"^0.6.1","grunt-contrib-concat":"^1.0.1","grunt-contrib-uglify":"^0.11.0","grunt-contrib-connect":"^0.11.2","@azerion/phaser-nineslice":"^2.0.1"},"_npmOperationalInternal":{"tmp":"tmp/phaser-i18next_1.0.3_1552655653305_0.504887898966494","host":"s3://npm-registry-packages"}}},"time":{"created":"2019-03-15T13:14:13.122Z","modified":"2026-06-13T19:00:13.939Z","1.0.3":"2019-03-15T13:14:13.465Z"},"bugs":{"url":"https://github.com/azerion/phaser-i18next/issues"},"author":{"name":"Azerion"},"license":[{"url":"https://github.com/azerion/phaser-i18next/raw/master/LICENSE","type":"MIT"}],"homepage":"https://github.com/azerion/phaser-i18next#readme","repository":{"url":"git+ssh://git@github.com/azerion/phaser-i18next.git","type":"git"},"description":"Phaser plugin for translations using i18next.","contributors":[{"name":"Ale Bles","email":"a.bles@azerion.com"}],"maintainers":[{"email":"a.bles@azerion.com","name":"alebles"},{"email":"adsdk-support@azerion.com","name":"azerbot"},{"email":"a.hulsman@azerion.com","name":"hulsman1986"},{"email":"mr.muhasan@gmail.com","name":"moin.hasan"}],"readme":"Phaser i18next\r\n==============\r\nPhaser i18next is a plugin for [Phaser](http://phaser.io/) that allows you to have seamless translations in your game. It uses [i18next](https://github.com/i18next/i18next) as it's source for translations management, which is widely adopted by the JS community in other projects as well.\r\n\r\nKey features:\r\n* Support for translations namespaces\r\n* Simple key/value JSON\r\n* Seamless switching of languages\r\n* No extra function calls for translating strings, directly build into Phaser's Text object\r\n\r\nGetting Started\r\n---------------\r\nFirst you want to get a fresh copy of the plugin. You can get it from this repo or from npm, ain't that handy.\r\n```\r\nnpm install @azerion/phaser-i18next --save-dev\r\n```\r\n\r\nNext up you'd want to add it to your list of js sources you load into your game\r\n```html\r\n//Local installed version\r\n<script src=\"node_modules/@azerion/phaser-i18next/build/phaser-i18next.js\"></script>\r\n//Or use our cdn:\r\n<script src=\"//cdn.fbrq.io/phaser-i18next/v0.0.1/phaser-i18next.min.js\"></script>\r\n```\r\n\r\nAfter adding the script to the page you can activate it by enabling the plugin:\r\n```javascript\r\n//Load the plugin with the options, for more details on all possible options, see: http://i18next.github.io/i18next/pages/doc_init.html\r\ngame.plugins.add(PhaserI18n.Plugin, {\r\n    fallbackLng: 'en',\r\n    backend: {\r\n        //The path from which we can load the translations, by default this path also includes the translation namespace\r\n        //But since we only have one namespace, we skip this for now.\r\n        loadPath: '/locales/{{lng}}.json'\r\n    }\r\n});\r\n```\r\nPlease note that the backend config in the above example is required for the correct working of i18next with Phaser.\r\nThe loadPath itself can be anything you want as per i18next documentation, but it's required to be set!\r\n\r\nUsage\r\n-----\r\nFirst up, you need to preload the languages you wish to have in the game.\r\n```javascript\r\n//And here we preload all locales for our game\r\ngame.load.locale(\r\n    //all the languages we support: (en, de, nl)\r\n    languages,\r\n    //The namespaces on which the translations are handled, defaults to ['translation']\r\n    ['translation']\r\n);\r\n```\r\n\r\ni18next plugins\r\n---------------\r\ni18next has a very nice set of [plugins](http://i18next.com/docs/ecosystem/) you can use in order to enhance your i18n experience. You can still leverage the power of these plugins by pasing them when you load this Phaser Plugin. All feature should work out of the box.\r\nYou can pass an indefinite amount of plugins to the plugin constructor, just be mindfull that the first argument should be the i18n config:\r\n```javascript\r\n            //Load the plugin with the options, for more details on all possible options, see: http://i18next.github.io/i18next/pages/doc_init.html\r\n            game.plugins.add(PhaserI18n.Plugin, {\r\n                    //Configure the language we fall back to (defaults to 'dev')\r\n                    fallbackLng: 'en',\r\n                    debug: true,\r\n                    load: 'languageOnly'\r\n                },\r\n                //From here we can add any i18next plugin we'd like to use, new plugins can be added comma-seperated\r\n                window.i18nextBrowserLanguageDetector\r\n            );\r\n```\r\n\r\nManage translations\r\n-------------------\r\nWhen you're all done and set up for translations and have your key value file, next up is starting to translate them. For smaller games this is fairly simple and still managable by editing your translations in a text file.\r\nBut when you start with bigger games and more translations (and translation namespaces) you want to manage your translations better, and maybe even use external translator services.\r\n\r\nTwo of those service you could use are [locize](https://locize.com/) and/or [Poeditor](https://poeditor.com). Both these services allow you to online edit key value JSON translations that are used in i18next.\r\nThe advantage of using suchs tools is that it's easier to allow external people work on your translations and they aggragate the statistics of your projects (translation completion, languages managed, etc.) \r\n\r\nDisclaimer\r\n----------\r\nWe at Azerion just love playing and creating awesome games. We aren't affiliated with Phaser.io or i18next. We just needed some awesome translations in our awesome HTML5 games. Feel free to use it for enhancing your own awesome games!\r\n\r\nPhaser i18next is distributed under the MIT license. All 3rd party libraries and components are distributed under their\r\nrespective license terms.\r\n","readmeFilename":"README.md"}