{"id":19703479,"url":"https://github.com/crowdin/xamarin-sdk","last_synced_at":"2025-04-29T14:30:45.621Z","repository":{"id":41293206,"uuid":"497826380","full_name":"crowdin/xamarin-sdk","owner":"crowdin","description":"Crowdin Xamarin SDK delivers all new translations from Crowdin project to the application immediately","archived":true,"fork":false,"pushed_at":"2024-01-03T09:52:03.000Z","size":874,"stargazers_count":7,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-20T13:07:59.594Z","etag":null,"topics":["content-delivery","crowdin","over-the-air","sdk"],"latest_commit_sha":null,"homepage":"https://www.nuget.org/packages/Crowdin.Xamarin.Forms/","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/crowdin.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-05-30T07:01:16.000Z","updated_at":"2024-06-17T06:59:32.000Z","dependencies_parsed_at":"2024-01-02T10:55:05.931Z","dependency_job_id":"c0acc071-5e7d-4897-a6d5-313750d1197c","html_url":"https://github.com/crowdin/xamarin-sdk","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crowdin%2Fxamarin-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crowdin%2Fxamarin-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crowdin%2Fxamarin-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crowdin%2Fxamarin-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crowdin","download_url":"https://codeload.github.com/crowdin/xamarin-sdk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251518790,"owners_count":21602211,"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":["content-delivery","crowdin","over-the-air","sdk"],"created_at":"2024-11-11T21:17:59.172Z","updated_at":"2025-04-29T14:30:43.268Z","avatar_url":"https://github.com/crowdin.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cpicture\u003e\n    \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://support.crowdin.com/assets/logos/symbol/png/crowdin-symbol-cWhite.png\"\u003e\n    \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://support.crowdin.com/assets/logos/symbol/png/crowdin-symbol-cDark.png\"\u003e\n    \u003cimg width=\"150\" height=\"150\" width=\"\"src=\"[https://support.crowdin.com/assets/logos/symbol/png/crowdin-symbol-cDark.png](https://crowdin.com)\"\u003e\n  \u003c/picture\u003e\n\u003c/p\u003e\n\n# Crowdin Xamarin Forms SDK [\u003cimg src=\"https://img.shields.io/badge/beta-yellow\"/\u003e](https://github.com/crowdin/xamarin-sdk)\n\nThe Crowdin Xamarin Forms SDK delivers all new translations from Crowdin project to the application immediately. So there is no need to update the application via Store to get the new version with the localization.\n\n\u003cdiv align=\"center\"\u003e\n\n[**`Example project`**](https://github.com/crowdin/xamarin-sdk/tree/main/examples/TestMobileApp) \u0026nbsp;|\u0026nbsp;\n[**`Online Docs`**](https://crowdin.github.io/xamarin-sdk/api/Crowdin.Xamarin.Forms.html) \u0026nbsp;|\u0026nbsp;\n[**`Crowdin Docs`**](https://support.crowdin.com/content-delivery)  \u0026nbsp;|\u0026nbsp;\n[**`Crowdin Enterprise Docs`**](https://support.crowdin.com/enterprise/content-delivery/)\n\n[![Nuget](https://img.shields.io/nuget/v/Crowdin.Xamarin.Forms?cacheSeconds=5000\u0026logo=nuget)](https://www.nuget.org/packages/Crowdin.Xamarin.Forms/)\n[![Nuget](https://img.shields.io/nuget/dt/Crowdin.Xamarin.Forms?cacheSeconds=800\u0026logo=nuget)](https://www.nuget.org/packages/Crowdin.Xamarin.Forms/)\n![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/crowdin/xamarin-sdk/basic.yml?logo=github\u0026branch=main)\n[![GitHub issues](https://img.shields.io/github/issues/crowdin/xamarin-sdk?cacheSeconds=9000)](https://github.com/crowdin/xamarin-sdk/issues)\n[![GitHub contributors](https://img.shields.io/github/contributors/crowdin/xamarin-sdk?cacheSeconds=9000)](https://github.com/crowdin/xamarin-sdk/graphs/contributors)\n[![GitHub](https://img.shields.io/github/license/crowdin/xamarin-sdk?cacheSeconds=20000)](https://github.com/crowdin/xamarin-sdk/blob/master/LICENSE)\n\n\u003c/div\u003e\n\n### Features\n\n+ Load remote strings from Crowdin Over-The-Air Content Delivery Network\n+ Built-in translations caching mechanism (enabled by default, can be disabled)\n+ Network usage configuration (All, only Wi-Fi or Cellular, Forbidden)\n+ Load static strings from the bundled RESX files (usable as fallback before the CDN strings loaded)\n\n\n### Requirements\n\n* .NET Standard 2.1 support\n* Xamarin Forms 5.0 or newer\n\n### Installation\n\nInstall via NuGet:\n\n```\n// Package Manager\nInstall-Package Crowdin.Xamarin.Forms -Version 0.1.0\n\n// .Net CLI\ndotnet add package Crowdin.Xamarin.Forms --version 0.1.0\n\n// Package Reference\n\u003cPackageReference Include=\"Crowdin.Xamarin.Forms\" Version=\"0.1.0\" /\u003e\n\n// Paket CLI\npaket add Crowdin.Xamarin.Forms --version 0.1.0\n```\n\n### Quick start\n\nFor applications using the XML resource localization files (RESX)\n\n1) Add Crowdin Distribution Hash before any modules initialization:\n\n    ```C#\n    DynamicResourcesLoader.GlobalOptions.DistributionHash = \"{your_distribution_hash}\";\n    ```\n\n2) Load static strings from app resource files to use as fallback:\n\n    ```C#\n    DynamicResourcesLoader.LoadStaticStrings(Translations.ResourceManager, Current.Resources);\n    ```\n\n    The first argument is the source - `ResourceManager` of the generated class from resources group (`Translations.resx` and descendants).\n    The second argument is the destination - `ResourceDictionary` where to place loaded strings:\n\n    * Global: in `Application.Current.Resources`\n    * Per-view: in `ContentPage.Resources`\n\n3) Load strings from Crowdin Distributions CDN:\n\n    ```C#\n    string langCode = DynamicResourcesLoader.CurrentCulture.TwoLetterISOLanguageName;\n    DynamicResourcesLoader.LoadCrowdinStrings($\"Translations.{langCode}.resx\", Current.Resources);\n    ```\n\n    The property `CurrentCulture` provides end-user OS locale by default.\n    It can be overridden by the developer if needed.\n\n    The method `LoadCrowdinStrings` is async and can be awaited if needed.\n\n    In this example, the method is not “awaited” not to block the rendering of the user’s interface.\n\n### Configuration\n\nThe SDK provides developers two ways for resources loading configuration: global and per-request:\n\n```C#\nvar options = new CrowdinOptions\n{\n    DistributionHash = \"\u003cyour_distribution_hash\u003e\",\n    NetworkPolicy = NetworkPolicy.OnlyWiFi,\n    UseCache = true,\n    FileName = \"Translations.resx\"\n};\n```\n\n+ `NetworkPolicy` - for network restrictions\n  + `All` - all network types allowed\n  + `OnlyWiFi` or `OnlyCellular` - only needed type allowed\n  + `Forbidden`\n\n+ `UseCache` - turn on or off built-in translations caching mechanism.\n\nFor global configuration override default `GlobalOptions`:\n\n```C#\nDynamicResourcesLoader.GlobalOptions = options;\n```\n\nFor per-request configuration pass `options` as the first parameter:\n\n```C#\nDynamicResourcesLoader.LoadCrowdinStrings(options, Current.Resources);\n```\n\nIn a last way don't forget to add `options.FileName` value. Please note - for this example we used the 'Translations.resx' file name. This name should correspond to the file name in Crowdin.\n\n### Translations caching algorithm\n\nEvery time the method `DynamicResourcesLoader.LoadCrowdinStrings` is executed the module checks the conditions for obtaining resources, updating or creating a cache (if it does not exist).\n\n1) If the cache is disabled and the network is unavailable - exit;\n2) If the cache is disabled, the network is available - resources are downloaded directly from the Crowdin CDN every time;\n3) If the cache is enabled, not yet created, the network is not available - exit;\n4) If the cache is enabled, not yet created, the network is available - resources are downloaded from the CDN and stored in the cache;\n5) If the cache is enabled, created - the cache is used first. The following is executed in the background thread:\n    * Check network availability. If not - exit;\n    * Update Crowdin manifest with updated translation date;\n    * Comparison of creation dates of cached and remote resources. If they are the same - exit;\n    * Update resources from Crowdin CDN;\n\nP.S. The network is considered unavailable even if the user has forbidden its use in the loader settings.\n\n### Contribution\n\nIf you want to contribute please read the [Contributing](CONTRIBUTING.md) guidelines.\n\n### Seeking Assistance\nIf you find any problems or would like to suggest a feature, please feel free to file an issue on Github at [Issues Page](https://github.com/crowdin/xamarin-sdk/issues).\n\nNeed help working with Crowdin Xamarin Forms SDK or have any questions?\n[Contact Customer Success Service](https://crowdin.com/contacts).\n\n### License\n\u003cpre\u003e\nThe Crowdin Xamarin Forms SDK is licensed under the MIT License.\nSee the LICENSE file distributed with this work for additional\ninformation regarding copyright ownership.\n\nExcept as contained in the LICENSE file, the name(s) of the above copyright\nholders shall not be used in advertising or otherwise to promote the sale,\nuse or other dealings in this Software without prior written authorization.\n\u003c/pre\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrowdin%2Fxamarin-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrowdin%2Fxamarin-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrowdin%2Fxamarin-sdk/lists"}