{"id":14960669,"url":"https://github.com/mukarillo/unitylocalizationmanager","last_synced_at":"2025-06-12T21:34:48.955Z","repository":{"id":126316862,"uuid":"170142747","full_name":"Mukarillo/UnityLocalizationManager","owner":"Mukarillo","description":"Localization system to manage multiple languages including date time, currencies, and other informations that change depending on current language.","archived":false,"fork":false,"pushed_at":"2019-02-12T08:15:38.000Z","size":1866,"stargazers_count":10,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-09-27T23:04:58.031Z","etag":null,"topics":["localization","unity","unity-plugin","unity-tool"],"latest_commit_sha":null,"homepage":null,"language":"ShaderLab","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/Mukarillo.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-11T14:29:27.000Z","updated_at":"2024-03-25T09:21:16.000Z","dependencies_parsed_at":"2023-06-26T22:09:41.925Z","dependency_job_id":null,"html_url":"https://github.com/Mukarillo/UnityLocalizationManager","commit_stats":{"total_commits":5,"total_committers":2,"mean_commits":2.5,"dds":"0.19999999999999996","last_synced_commit":"4f9ede81f007e12863b4336557ae2c8b7322a3ae"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mukarillo%2FUnityLocalizationManager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mukarillo%2FUnityLocalizationManager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mukarillo%2FUnityLocalizationManager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mukarillo%2FUnityLocalizationManager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mukarillo","download_url":"https://codeload.github.com/Mukarillo/UnityLocalizationManager/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219868059,"owners_count":16555878,"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":["localization","unity","unity-plugin","unity-tool"],"created_at":"2024-09-24T13:22:42.448Z","updated_at":"2024-10-10T10:20:47.573Z","avatar_url":"https://github.com/Mukarillo.png","language":"ShaderLab","readme":"# UnityLocalizationManager\r\nLocalization system to manage multiple languages including date time, currencies, and other informations that change depending on current language.\r\n\r\n## How to use\r\n*you can find a pratical example inside this repository in PoolingScene scene*\r\n\r\n### 1 - Exporta a CSV file with all the languages and translations (use [this file](https://github.com/Mukarillo/UnityLocalizationManager/blob/master/Assets/Resources/Localization.csv) as base)\r\n### 2 - Place the file wherever you want in the project and change the path in ```LocalizationManager``` [constructor](https://github.com/Mukarillo/UnityLocalizationManager/blob/d43883b7595f3a5851a15978db43d31b1f1274a2/Assets/Scripts/LManager/LocalizationManager.cs#L25)\r\n```c#\r\npublic LocalizationManager(string filePath = \"PATH/TO/FILE.CSV\")\r\n{\r\n```\r\n### 3 - The project will initially use the system language as default. If you wish to change, use ```LocalizationManager.Instance.ChangeLanguage``` using the language code or Locale (you can find/add Locales in [```Locale.cs```](https://github.com/Mukarillo/UnityLocalizationManager/blob/master/Assets/Scripts/LManager/Locale.cs)\r\n```c#\r\nLocalizationManager.Instance.ChangeLanguage(\"en_US\");\r\n```\r\n### 4 - To get a localized text, use ```LocalizationManager.Instance.Get```. You can also use parameters (explained below)\r\n```c#\r\nLocalizationManager.Instance.ChangeLanguage(\"es_ES\");\r\nvar localizedHello = LocalizationManager.Instance.Get(\"hello\"); //will return Hola\r\n```\r\n### 5 - To use dynamic values with localized text, use the LocalizationManager.PARAMETER_DELIMITER between a key and call ```Get```with the respective dictionary.\r\n```c#\r\n//Example of a localized text with parameter\r\n//playerPoints = You have @points@ points!\r\nvar pp = 10; \r\nvar localizedPoints = LocalizationManager.Instance.Get(\"playerPoints\", new Dictionary\u003cstring, string\u003e() {{\"points\", pp.ToString()}});//will return You have 10 points!\r\n```\r\n\r\n## LocalizationManager `public` overview\r\n### Properties\r\n|name  |type  |description  |\r\n|--|--|--|\r\n|`CurrentLocale` |**Locale** |*The current Locale being use to gather the translations.*  |\r\n|`onLocalizationChanged` |**UnityEvent** |*Callback triggered when language is changed (usefull to change text/sprites that is already on screen)*  |\r\n\r\n### Methods\r\n\r\n\u003c/br\u003e\r\n\r\n\u003e `LocalizationManager.ChangeReferenceFile`\r\n- *Description*: Change the file to get the translations data.\r\n\r\n- *Parameters*:\r\n\r\n|name  |type  |description  |\r\n|--|--|--|\r\n|`filePath` |**string** |*Path to the file.*  |\r\n\r\n\u003c/br\u003e\r\n\r\n\u003e `LocalizationManager.ResetLanguageToDeviceLanguage`\r\n- *Description*: Resets the language to the system's default.\r\n\r\n\u003c/br\u003e\r\n\r\n\u003e `LocalizationManager.ChangeLanguage`\r\n- *Description*: Changes the language.\r\n\r\n- *Parameters* :\r\n\r\n|name  |type  |description  |\r\n|--|--|--|\r\n|`code` |**string** |*ISO language and country code. Previous registered in Locale*  |\r\n\r\n\u003c/br\u003e\r\n\r\n\u003e `LocalizationManager.ChangeLanguage`\r\n- *Description*: Changes the language.\r\n\r\n- *Parameters* :\r\n\r\n|name  |type  |description  |\r\n|--|--|--|\r\n|`locale` |**Locale** |*The locale to be change*  |\r\n\r\n\u003c/br\u003e\r\n\r\n\u003e `LocationManager.Exists`\r\n- *Description*: Returns true if the key is present in the language dictionary.\r\n\r\n- *Parameters* :\r\n\r\n|name  |type  |description  |\r\n|--|--|--|\r\n|`key` |**string** |*Key to compare*  |\r\n\r\n\u003c/br\u003e\r\n\r\n\u003e `LocationManager.Get`\r\n- *Description*: Returns the localized string if it has the key. Otherwise will return DEFAULT_VALUE_MISSING_KEY; \r\n\r\n- *Parameters* :\r\n\r\n|name  |type  |description  |\r\n|--|--|--|\r\n|`key` |**string** |*Key to compare*  |\r\n|`replaces` |**Dictionary\u003c string, string \u003e** |*Replaces texts that are between PARAMETER_DELIMITER character and replace with the value*  |\r\n\r\n- *Variants* :\r\n--GetUpper: Return all the characters in uppercase;\r\n--GetLower: Return all the characters in lowercase;\r\n--GetFirstLetterUpper: Return with just the first letter uppercase and the rest lowercase;\r\n--TryGet: Returns true if there is a translation to that key and out the translation value;\r\n\r\n\u003c/br\u003e\r\n\r\n\u003e `LocationManager.FormatDate`\r\n- *Description*: Format the date based on the locale culture info.\r\n\r\n- *Parameters* :\r\n\r\n|name  |type  |description  |\r\n|--|--|--|\r\n|`dt` |**DateTime** |*Date to be formated*  |\r\n\r\n\u003c/br\u003e\r\n\r\n\u003e `LocationManager.FormatTime`\r\n- *Description*: Format the time based on the locale culture info.\r\n\r\n- *Parameters* :\r\n\r\n|name  |type  |description  |\r\n|--|--|--|\r\n|`dt` |**DateTime** |*Time to be formated*  |\r\n\r\n\u003c/br\u003e\r\n\r\n\u003e `LocationManager.FormatCurrency`\r\n- *Description*: Format the currency based on the locale culture info.\r\n\r\n- *Parameters* :\r\n\r\n|name  |type  |description  |\r\n|--|--|--|\r\n|`value` |**Double** |*Value to be formated*  |\r\n\r\n\u003c/br\u003e\r\n\r\n\u003e `LocationManager.FormatNumber`\r\n- *Description*: Format the number based on the locale culture info.\r\n\r\n- *Parameters* :\r\n\r\n|name  |type  |description  |\r\n|--|--|--|\r\n|`value` |**Double** |*Value to be formated*  |\r\n|`decimals` |**int** |*Value to be formated*  |\r\n\r\n\u003c/br\u003e\r\n\r\n\u003e `LocationManager.FormatPercent`\r\n- *Description*: Format the number percentage based on the locale culture info.\r\n\r\n- *Parameters* :\r\n\r\n|name  |type  |description  |\r\n|--|--|--|\r\n|`value` |**Double** |*Value to be formated*  |\r\n|`percentValue` |**Double** |*Value to be formated*  |\r\n\r\n\u003c/br\u003e\r\n\r\n\u003e `LocationManager.ParseToFloat`\r\n- *Description*: Parse the string into float based on the locale culture info.\r\n\r\n- *Parameters* :\r\n\r\n|name  |type  |description  |\r\n|--|--|--|\r\n|`str` |**string** |*Value to be parsed*  |\r\n\r\n\u003c/br\u003e\r\n\r\n\u003e `LocationManager.ParseToInt`\r\n- *Description*: Parse the string into int based on the locale culture info.\r\n\r\n- *Parameters* :\r\n\r\n|name  |type  |description  |\r\n|--|--|--|\r\n|`str` |**string** |*Value to be parsed*  |\r\n\r\n### Future releases\r\n- [ ] Allow line jump in localized text\r\n- [ ] Allow csv files that are not local (internet)\r\n\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmukarillo%2Funitylocalizationmanager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmukarillo%2Funitylocalizationmanager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmukarillo%2Funitylocalizationmanager/lists"}