{"id":37125113,"url":"https://github.com/creativehandoficial/gm-i18n","last_synced_at":"2026-01-14T14:27:51.934Z","repository":{"id":46743131,"uuid":"354137888","full_name":"CreativeHandOficial/gm-i18n","owner":"CreativeHandOficial","description":"i18n features for you projetct GMS 2.3","archived":false,"fork":false,"pushed_at":"2023-02-04T18:38:28.000Z","size":154,"stargazers_count":16,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-01T16:34:39.984Z","etag":null,"topics":["game-maker-studio-2","gml","gms","gms2","i18n","json"],"latest_commit_sha":null,"homepage":"","language":"Yacc","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/CreativeHandOficial.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-04-02T21:31:20.000Z","updated_at":"2025-01-29T08:33:44.000Z","dependencies_parsed_at":"2024-01-03T04:07:52.880Z","dependency_job_id":"96eeeed4-5913-4bc3-b286-6ca250621177","html_url":"https://github.com/CreativeHandOficial/gm-i18n","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/CreativeHandOficial/gm-i18n","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CreativeHandOficial%2Fgm-i18n","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CreativeHandOficial%2Fgm-i18n/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CreativeHandOficial%2Fgm-i18n/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CreativeHandOficial%2Fgm-i18n/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CreativeHandOficial","download_url":"https://codeload.github.com/CreativeHandOficial/gm-i18n/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CreativeHandOficial%2Fgm-i18n/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28423069,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T13:30:50.153Z","status":"ssl_error","status_checked_at":"2026-01-14T13:29:08.907Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-maker-studio-2","gml","gms","gms2","i18n","json"],"created_at":"2026-01-14T14:27:51.181Z","updated_at":"2026-01-14T14:27:51.921Z","avatar_url":"https://github.com/CreativeHandOficial.png","language":"Yacc","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\u003ch1 align=\"center\"\u003e\n    \u003cimg alt=\"GMi18n\" title=\"#GMi18n\" src=\"./brand.png\" /\u003e\n\u003c/h1\u003e\n\n\u003ch4 align=\"center\"\u003eInternationalization of texts simply and quickly, using JSON files\u003c/h4\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/CreativeHandOficial/gm-i18n/releases/tag/v0.3.2\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/release-v0.3.2-%2348af8f\" alt=\"Release v0.3.2\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://twitter.com/intent/follow?screen_name=CreativeHandOf\"\u003e\n    \u003cimg src=\"https://img.shields.io/twitter/follow/CreativeHandOf.svg?label=Follow%20@CreativeHandOf\" alt=\"Follow @CreativeHandOf\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n---\n\n## Sample demonstration\n\n\u003cbr /\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003cimg alt=\"GMi18n\" title=\"#GMi18n\" src=\"./gm-i18n.gif\" /\u003e\n\u003c/p\u003e\n\n---\n\n## Usage\n\nTo use GM i18n, download [the latest release](https://github.com/CreativeHandOficial/gm-i18n/releases), and import the `.yymps` package into your project.\n\nLocation files must be included in the GMS include file. Example of how to create a file: [en-US.json](https://github.com/CreativeHandOficial/gm-i18n/blob/master/datafiles/en-US.json)\n\nOnce imported to your project, you can use any of the API functions below. Remembering that it is necessary to configure `gmi18nSetup();`\n\n---\n\n## API\n\n### `gmi18nSetup(_locales*, _defaultLocale*, _fallBackLocale)`\n\nThis function is responsible for configuring the creation of the locations configuration file, defining what will be the default location and configuring the return location.\n\n\u003e I recommend using the object `oSetupi18n` to speed up initial setup\n\n```js\n// @desc Method for configuring in18 within your project, using locations as parameters. The default location. And a return location if there is no requested structure.\n// @param\t{array}  _locales*\t\t    Required Locales configuration array, must contain code, file and lang\n// @param\t{string} _defaultLocale*  Required Setting the default location\n// @param\t{string} _fallBackLocale  Optional Setting the return location, if it does not exist at the current location\n// @example\n\n// Configuring gmi18n to generate the information needed to initialize it.\n\nlocales = [\n\t{ code: \"pt-BR\", file: \"pt-BR.json\", lang: \"Portugues\" },\n\t{ code: \"en-US\", file: \"en-US.json\", lang: \"English\" },\n\t{ code: \"es-ES\", file: \"es-ES.json\", lang: \"Espanhol\" }\n];\n\ndefaultLocale = \"pt-BR\";\nfallBackLocale = \"pt-BR\";\n\ngmi18nSetup(locales, defaultLocale, fallBackLocale);\n```\n\n\n### `useTranslation(_param, _varName)`\n\nThis function is responsible for returning the text that was configured in the json file of the chosen location\n\n```js\n// @desc    Method responsible for returning the text within the .json file of the previously chosen location\n// @param\t {string} _param*  | Required | Structure created within your .json localization file\n// @param\t {string} _varName | Optional | The name of the variable that must remain static\n// @returns {string} Returns the text chosen in the parameter\n// @example\n\n// Search for the welcome text according to the chosen location\ndraw_text(x, y, useTranslation('welcome'));\n\n-----------------------------------------------------------------\n\n// Using the function within Create Event, this way it will be possible to update the variable value whenever there is a language change\n\nname = useTranslation('welcome', 'name');\n```\n\n\u003e Recommendation\n\nIt is possible to abbreviate the `useTranslation()` call, to make the code less verbose.\n\nExample:\n\n```js\n// Create\nt = method(self, useTranslation);\n\n// Draw\ndraw_text(x, y, t('welcome'));\n```\n\n\n### `reloadValuesWhenExchanged()`\n\nMethod responsible for updating objects' create event variables\n\n```js\n// Begin Step\n\nreloadValuesWhenExchanged();\n```\n\n\n### `switchLocale(_locale)`\n\nChange your current location\n\n```js\n// @desc     Method responsible for making the language localization change\n// @param    {string} _locale* Required Location to be changed\n// @example\n\n// Changing the language to pt-BR\n\nswitchLocale(\"pt-BR\");\n```\n\n### `getCurrentLocale()`\n\nReturns the current location code\n\n```js\n@desc    Returns the current chosen location\n@returns {string} _locale Return the code\n@example\n\n// Returns the current code: \"pt-BR\"\n\ngetCurrentLocale();\n```\n\n### `getLocales()`\n\nReturns an array with all the locations configured during setup\n\n```js\n// @desc    Returns an array with all the locations configured during setup\n// @returns {Array} _locales Return all locations configured in the setup\n// @example\n\n// Returns the following array:\n// [\n//  { code: \"pt-BR\", file: \"pt-BR.json\", lang: \"Portugues\" },\n//  { code: \"en-US\", file: \"en-US.json\", lang: \"English\" },\n//  { code: \"es-ES\", file: \"es-ES.json\", lang: \"Espanhol\" }\n// ];\n\ngetLocales();\n```\n\n---\n## Contributors\n\n\n\u003cdiv align=\"left\"\u003e\n  \u003ctable\u003e\n    \u003ctr align=\"center\"\u003e\n      \u003ctd align=\"center\"\u003e\n        \u003ca href=\"https://github.com/JujuAdams\"\u003e\n          \u003cimg src=\"https://avatars.githubusercontent.com/u/3970480?v=4\" width=\"100\" /\u003e\n          \u003cbr /\u003e\n          \u003csub\u003e\n            \u003cb\u003eJuju Adams\u003c/b\u003e\n          \u003c/sub\u003e\n        \u003c/a\u003e\n        \u003cbr /\u003e\n        \u003ca href=\"http://www.jujuadams.com/\" title=\"Juju Adams\"\u003e🌈\u003c/a\u003e\u003c/td\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/table\u003e\n\u003c/div\u003e\n\n\n---\n## Author\n\n\u003cdiv align=\"left\"\u003e\n  \u003ctable\u003e\n    \u003ctr align=\"center\"\u003e\n      \u003ctd\u003eCoded By\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr align=\"center\"\u003e\n        \u003ctd align=\"center\"\u003e\n        \u003ca href=\"https://github.com/rbarbosa95\"\u003e\n          \u003cimg src=\"https://avatars0.githubusercontent.com/u/15218743?s=460\u0026u=d76d008067b2ee2fe2f55db081ea78cdad461e57\u0026v=4\" width=\"100\" /\u003e\n          \u003cbr /\u003e\n          \u003csub\u003e\n            \u003cb\u003eRamon Barbosa\u003c/b\u003e\n          \u003c/sub\u003e\n        \u003c/a\u003e\n        \u003cbr /\u003e\n        \u003ca href=\"https://creativehand.com.br/\" title=\"Creative Hand\"\u003e🕹️\u003c/a\u003e\u003c/td\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/table\u003e\n\u003c/div\u003e\n\n---\n\n## Architecture\n\nOnly in Portuguese. [Link Figma](https://www.figma.com/file/kDefQdVCSkPiTdrzNoxQDm/GM-i18n?node-id=0%3A1)\n\n---\n\n## License\n\nThis project is under license [MIT](./LICENSE).\n\nDone with 💚 by [Creative Hand](https://creativehand.com.br/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcreativehandoficial%2Fgm-i18n","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcreativehandoficial%2Fgm-i18n","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcreativehandoficial%2Fgm-i18n/lists"}