{"id":16085530,"url":"https://github.com/subsoap/defglot","last_synced_at":"2025-04-12T20:07:05.480Z","repository":{"id":71235299,"uuid":"100567986","full_name":"subsoap/defglot","owner":"subsoap","description":"A localization module for Defold","archived":false,"fork":false,"pushed_at":"2023-11-13T01:29:01.000Z","size":263,"stargazers_count":24,"open_issues_count":5,"forks_count":8,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-12T20:06:59.036Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/subsoap.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}},"created_at":"2017-08-17T06:11:50.000Z","updated_at":"2024-11-08T20:59:06.000Z","dependencies_parsed_at":"2023-03-11T01:45:54.153Z","dependency_job_id":null,"html_url":"https://github.com/subsoap/defglot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/subsoap%2Fdefglot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/subsoap%2Fdefglot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/subsoap%2Fdefglot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/subsoap%2Fdefglot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/subsoap","download_url":"https://codeload.github.com/subsoap/defglot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248625493,"owners_count":21135513,"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":[],"created_at":"2024-10-09T13:02:00.708Z","updated_at":"2025-04-12T20:07:05.458Z","avatar_url":"https://github.com/subsoap.png","language":"Lua","funding_links":[],"categories":["Libraries"],"sub_categories":["Programming Language"],"readme":"# DefGlot\nA localization module for Defold\n\nEasily support multiple translations of your game.\n\n## Installation\nYou can use DefGlot in your own project by adding this project as a [Defold library dependency](http://www.defold.com/manuals/libraries/). Open your game.project file and in the dependencies field under project add:\n\n\thttps://github.com/subsoap/defglot/archive/master.zip\n  \nOnce added, you must require the main Lua module in your scripts via\n\n```\nlocal defglot = require(\"defglot.defglot\")\n```\n\nThen add your list of languages, language data, init, and set GUI text based on current language.\n\n```\nfunction init(self)\n\tdefglot.language = \"ru\" -- if you do not define the language DefGlot will attempt to use OS lang\n\tdefglot.language_list.ru = \"ru\" -- add one or more langauges to in use language list\n\tdefglot.locale_data = require(\"example.main_locale\") -- this is the locale data\n\tdefglot.init() -- you must init DefGlot so that it can ensure proper setup\n\t\n\tdefglot.set_text(gui.get_node(\"btn_start/label\"))\n\tdefglot.set_text(gui.get_node(\"btn_about/label\"))\n\tdefglot.set_text(gui.get_node(\"btn_exit/label\"))\n\tdefglot.set_text(gui.get_node(\"btn_toggle_profiler/label\")) \n\t-- the toggle profiler text is missing so it will load missing string text in English\nend\n\n```\n\nDefGlot also works with GO labels but if you use it with labels you must always set a key as currently there is no label.get_text.\n\n```\n\tdefglot.set_text(\"#label\", \"MY_KEY\")\n\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsubsoap%2Fdefglot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsubsoap%2Fdefglot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsubsoap%2Fdefglot/lists"}