{"id":18898777,"url":"https://github.com/koreezgames/phaser3-i18n-plugin","last_synced_at":"2025-06-10T13:05:32.443Z","repository":{"id":57125464,"uuid":"124197269","full_name":"koreezgames/phaser3-i18n-plugin","owner":"koreezgames","description":"Phaser3 i18n Plugin","archived":false,"fork":false,"pushed_at":"2020-05-28T19:12:33.000Z","size":6735,"stargazers_count":23,"open_issues_count":23,"forks_count":8,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-15T19:24:28.232Z","etag":null,"topics":["game","game-development","game-engine","games","i18n","i18next","internationalization","internationalization-plugin","localization","phaser","phaser-plugin","phaser3"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/koreezgames.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-07T07:34:06.000Z","updated_at":"2025-01-28T20:22:52.000Z","dependencies_parsed_at":"2022-08-31T05:40:31.673Z","dependency_job_id":null,"html_url":"https://github.com/koreezgames/phaser3-i18n-plugin","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koreezgames%2Fphaser3-i18n-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koreezgames%2Fphaser3-i18n-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koreezgames%2Fphaser3-i18n-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koreezgames%2Fphaser3-i18n-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/koreezgames","download_url":"https://codeload.github.com/koreezgames/phaser3-i18n-plugin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koreezgames%2Fphaser3-i18n-plugin/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259081015,"owners_count":22802400,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["game","game-development","game-engine","games","i18n","i18next","internationalization","internationalization-plugin","localization","phaser","phaser-plugin","phaser3"],"created_at":"2024-11-08T08:44:08.166Z","updated_at":"2025-06-10T13:05:32.421Z","avatar_url":"https://github.com/koreezgames.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Phaser3 i18n Plugin\n\n[![GitHub license](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/koreezgames/phaser3-i18n-plugin/blob/master/LICENSE)\n[![Build Status](https://secure.travis-ci.org/koreezgames/phaser3-i18n-plugin.svg?branch=master)](https://travis-ci.org/koreezgames/phaser3-i18n-plugin)\n[![codebeat badge](https://codebeat.co/badges/753f25dc-b8b8-4b55-9559-2bdc00b070e1)](https://codebeat.co/projects/github-com-koreezgames-phaser-i18next-master)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/63e0c72189fa97ca55db/test_coverage)](https://codeclimate.com/github/koreezgames/phaser3-i18n-plugin/test_coverage)\n[![npm version](https://badge.fury.io/js/%40koreez%2Fphaser3-i18n.svg)](https://badge.fury.io/js/%40koreez%2Fphaser3-i18n)\n[![Greenkeeper badge](https://badges.greenkeeper.io/koreezgames/phaser3-i18n-plugin.svg)](https://greenkeeper.io/)\n[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n\nPhaser3 i18n is a plugin for Phaser 3 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.\n\nKey features:\n\n-   Support for translations namespaces\n-   Simple key/value JSON\n-   Seamless switching of languages\n-   No extra function calls for translating strings, directly build into Phaser's Text object\n\n## Getting Started\n\n### Installation\n\n[![npm](https://img.shields.io/npm/dt/@koreez/phaser3-i18n.svg)](https://www.npmjs.com/package/@koreez/phaser3-i18n)\n\n```shell\n$ npm i -g npm\n$ npm i --save  @koreez/phaser3-i18n\n```\n\n## Usage\n\n### Import the plugin\n\n```javascript\nimport { I18nPlugin } from \"@koreez/phaser3-i18n\";\n```\n\n### Load the plugin\n\nYou need to load the plugin in your game. This is done just like any other plugin in Phaser 3.\nSo, to load the plugin, include it in plugins config.\n\n```javascript\nconst config = {\n    type: Phaser.AUTO,\n    parent: \"phaser-example\",\n    width: 800,\n    height: 600,\n    plugins: {\n        scene: [\n            {\n                key: \"i18nPlugin\",\n                plugin: I18nPlugin,\n                mapping: \"i18n\"\n            }\n        ]\n    },\n    scene: {\n        create: create\n    }\n};\n```\n\n### Initialize the plugin\n\nAfter plugin has been loaded you need to initialize it.\n\n```javascript\ncreate () {\n  this.i18n.initialize(\n    {\n      fallbackLng: 'en',\n      loadPath: 'assets/i18n/{{lng}}/{{ns}}.json',\n      debug: false,\n    },\n    function () {\n      console.log('I18nPlugin initialized!')\n    },\n  )\n}\n```\n\nThe plugin will patch _add.text, add.bitmapText and add.dynamicBitmapText / make.text, make.bitmapText and make.dynamicBitmapText_ methods with additional functionality.\n\n### Create localized texts\n\n```javascript\n// x - any\n// y - any\n// font - bitmap font\n// text - should be translation key\n// size - font size\n// interpolations - interpolation for translation (for example { 0: \"value0\", 1: \"value1\" }), note this is not required parameter\nthis.add.bitmapText(x, y, font, text, size, interpolations);\n```\n\n##### **_or via config_**\n\n```javascript\nvar config = {\n    x: 100,\n    y: 100,\n    text: \"translationKey\",\n    font: \"atari-classic\",\n    size: 64,\n    interpolations: { 0: \"value0\", 1: \"value1\" }\n};\nthis.make.dynamicBitmapText(config);\n```\n\n## Manage translations\n\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 manageable by editing your translations in a text file.\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.\n\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.\nThe advantage of using such tools is that it's easier to allow external people work on your translations and they aggregate the statistics of your projects (translation completion, languages managed, etc.)\n\n## Credits\n\nBig thanks to this great repo:\n\nhttps://github.com/orange-games/phaser-i18next\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoreezgames%2Fphaser3-i18n-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkoreezgames%2Fphaser3-i18n-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoreezgames%2Fphaser3-i18n-plugin/lists"}