{"id":19152660,"url":"https://github.com/rasyidf/rasyidf.localization","last_synced_at":"2025-05-07T05:46:36.597Z","repository":{"id":104095504,"uuid":"94106879","full_name":"rasyidf/Rasyidf.Localization","owner":"rasyidf","description":"Universal Localization Framework for WPF","archived":false,"fork":false,"pushed_at":"2020-04-03T10:23:36.000Z","size":144,"stargazers_count":6,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-19T19:05:18.771Z","etag":null,"topics":["extension","framework","localization","localization-kit","localization-using-json-files","wpf-platform","wpf-ui"],"latest_commit_sha":null,"homepage":"https://rasyidf.github.io/Rasyidf.Localization/","language":"C#","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/rasyidf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"docs/CODE_OF_CONDUCT.md","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,"zenodo":null}},"created_at":"2017-06-12T14:41:31.000Z","updated_at":"2024-12-08T21:18:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"eca3edbb-e186-4754-89b0-ff6fc23b313d","html_url":"https://github.com/rasyidf/Rasyidf.Localization","commit_stats":null,"previous_names":["rasyidf/ufa.localization"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rasyidf%2FRasyidf.Localization","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rasyidf%2FRasyidf.Localization/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rasyidf%2FRasyidf.Localization/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rasyidf%2FRasyidf.Localization/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rasyidf","download_url":"https://codeload.github.com/rasyidf/Rasyidf.Localization/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252823682,"owners_count":21809707,"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":["extension","framework","localization","localization-kit","localization-using-json-files","wpf-platform","wpf-ui"],"created_at":"2024-11-09T08:18:41.579Z","updated_at":"2025-05-07T05:46:36.589Z","avatar_url":"https://github.com/rasyidf.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rasyidf Localization\n![Nuget](https://img.shields.io/nuget/dt/Rasyidf.Localization)\n\nFast and simple localization framework for wpf. allow dynamic loading and multiple language pack.\n\n## Getting Started\n\n### Installation\nTo use this framework. add nuget package:\n\n```powershell\nInstall-Package Rasyidf.Localization\n```\n\nThen register the the services on App.cs\n\n```csharp\n    public partial class App : Application\n    {\n        protected override void OnStartup(StartupEventArgs e)\n        {\n            base.OnStartup(e);\n            // set the language packs folder and default language\n            LocalizationService.Current.Initialize(\"Assets\", \"en-US\");\n        }\n        ...\n```\n\n### Usage\n\nafter installing and loading th assembly, add namespace in the xaml \n``` xml\nxmlns:rf=\"https://rasyidf.github.io/Rasyidf.Localization\"\n```\nAll set, now you can implement Binding in any XAML like this:\n\nBind like this\n``` xml \n\u003cMenuItem Header=\"{rf:Tr File, Uid=11}\"/\u003e\n```\n\nOr this\n\n``` xml\n\u003cTextBlock Text=\"{rf:Tr Default='Default Hello World', Uid=11}\"/\u003e\n\u003cTextBlock Text=\"{rf:Tr FallBackText, Uid=12}\"/\u003e\n```\nOr this, with Format String\n``` xml\n\u003cTextBlock\u003e\n    \u003cRun\u003e\n        \u003crf:Tr Uid=\"24\" Default=\"Language : {0}, Count : {1} \"\u003e\n            \u003cBinding FallbackValue=\"en-US\" Mode=\"OneWay\"\n                Path=\"CurrentLanguage\" /\u003e\n            \u003cBinding FallbackValue=\"0\" Mode=\"OneWay\"\n                Path=\"LanguageCount\" /\u003e\n        \u003c/rf:Tr\u003e\n    \u003c/Run\u003e\n\u003c/TextBlock\u003e\n```\n\nin code, you can consume directly by using : \n\n```csharp\nMessageBox.Show(LocalizationService.GetString(\"511\", \"Text\", \"Default Message\"),LocalizationService.GetString(\"511\", \"Header\",\"Default Title\"));\n```\nanother way is to use String extension. `\"[uid],[vid]\".Localize(\"[Default]\")`\n\n```csharp\nMessageBox.Show(\"511,Text\".Localize(\"Default Message\"),(\"511,Header\").Localize(\"Default Title\"));\n```\n\n### Language Packs\n\nThe Language Pack can be XML or JSON like below, put in the language folder:\n\n\u003e Version 0.5 support some additional metadata (AppId, Author, Type, Version) planned for future version.\n\n\n#### XML Language Pack\n\n\n```xml\n\u003cPack Version=\"0.5\" AppId=\"YourAppId\" Author=\"Rasyid\" EnglishName=\"English\" CultureName=\"English\" Culture=\"en-US\"\u003e\n  \u003cValue Id=\"0\" Header=\"Window Title\" /\u003e\n  \u003cValue Id=\"11\" Header=\"File\" /\u003e\n  \u003cValue Id=\"110\" Header=\"Exit\"  /\u003e \n  ...\n  \u003cValue Id=\"511\" Header=\"Hello Wold\" Text=\"This Is message String\" /\u003e\n\u003c/Pack\u003e\n```\n \n#### JSON Language Pack\n\n\u003e Version 0.5 Support Json Multilingual Package.\n\n##### Single Language Pack\n\n```json\n{   \"AppId\" : \"YourAppId\",\n    \"Version\" : \"0.5\", \"Type\" : \"Single\", \n    \"EnglishName\": \"Indonesian\", \"CultureName\": \"Bahasa Indonesia\",\n    \"Culture\": \"id-ID\",\n    \"Data\": [ \n    { \"Id\": 0, \"Header\": \"Judul Jendela\" }, \n    { \"Id\": 11, \"Header\": \"Berkas\" }, \n    { \"Id\": 110, \"Header\": \"Keluar\" }\n    ]\n}\n```\n\n##### Multi Language Pack\n```json\n{\n  \"AppId\": \"\",\n  \"Version\": \"0.5\",\n  \"Type\": \"Multi\",\n  \"Author\": \"Rasyid\",\n  \"Languages\": [\n    {\n      \"CultureId\": \"en-US\"  \n    },\n    {\n      \"CultureId\": \"de-DE\" \n    }\n  ],\n\n  \"Data\": [\n    {\n      \"data\": [\n        {\n          \"Id\": 0,\n          \"Text\": {\n            \"en-US\": \"Hello\", \"de-DE\": \"Hallo\"\n          }\n        }, \n      ]\n    }\n    ]\n  }\n}\n```\n\nAll Done :)\n\n## What is new\n\n0.5.3\n* Add Localized String - thanks to [SKProCH](https://github.com/SKProCH)\n* Fixed Missing Assets location.\n\n0.5.2\n* Now rf:Tr will automatically find Uid and Property name based on markup.\n* Fixed json stream error when loading metadata. \n* Recreate Demo.WPF because of corrupted file.\n\n0.5.0\n* Translation string extension use `\"UID, VID\".Translate()` to get localized string.\n* Multiple Language pack in single file.\n* Decouple LanguageStream with Language Item.\n\n0.4.0\n* Raw support for xml\n* initial json support\n\n## Authors\n\n* **Rasyid, Muhammad Fahmi** - *Initial work* - [Rasyidf](https://github.com/rasyidf)\n\nSee also the list of [contributors](https://github.com/rasyidf/rasyidf.Localization/contributors) who participated in this project.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details\n\n## Acknowledgments\n\nSee list of third party components for [aditional acknowledgements](https://github.com/rasyidf/rasyidf.Localization/wiki/List-of-Contributors)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frasyidf%2Frasyidf.localization","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frasyidf%2Frasyidf.localization","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frasyidf%2Frasyidf.localization/lists"}