{"id":32309196,"url":"https://github.com/magnatronus/flutter-devicelocale","last_synced_at":"2026-02-23T19:30:56.276Z","repository":{"id":34074017,"uuid":"168717019","full_name":"magnatronus/flutter-devicelocale","owner":"magnatronus","description":"A Flutter package to read and return the set device locales","archived":false,"fork":false,"pushed_at":"2025-09-07T15:24:22.000Z","size":172,"stargazers_count":48,"open_issues_count":6,"forks_count":25,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-23T08:23:07.466Z","etag":null,"topics":["android","device","flutter","flutter-package","flutter-plugin","ios","locale","web"],"latest_commit_sha":null,"homepage":"","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/magnatronus.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-02-01T15:21:59.000Z","updated_at":"2025-09-07T15:24:26.000Z","dependencies_parsed_at":"2024-02-01T09:30:39.147Z","dependency_job_id":"e9603c6a-73b4-474c-a7bb-ed636e0d4e2f","html_url":"https://github.com/magnatronus/flutter-devicelocale","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/magnatronus/flutter-devicelocale","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magnatronus%2Fflutter-devicelocale","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magnatronus%2Fflutter-devicelocale/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magnatronus%2Fflutter-devicelocale/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magnatronus%2Fflutter-devicelocale/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/magnatronus","download_url":"https://codeload.github.com/magnatronus/flutter-devicelocale/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magnatronus%2Fflutter-devicelocale/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29752808,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-23T19:23:13.917Z","status":"ssl_error","status_checked_at":"2026-02-23T19:23:11.618Z","response_time":90,"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":["android","device","flutter","flutter-package","flutter-plugin","ios","locale","web"],"created_at":"2025-10-23T08:16:31.921Z","updated_at":"2026-02-23T19:30:56.263Z","avatar_url":"https://github.com/magnatronus.png","language":"Dart","readme":"# devicelocale\n\nGets the device locale data, independent of the app locale settings. \n\n\n## Usage\n\n```dart\nimport 'package:devicelocale/devicelocale.dart';\n```\n\nthen\n\n```dart\nList languages = await Devicelocale.preferredLanguages;\nString locale = await Devicelocale.currentLocale;\n```\n\nthis should return a list of the preferred/current language locales setup on the device, with the current one being the first in the list or just the currently set device locale.\n\n### Android specific implementation (no-op on other platforms if supported)\nAdded per-app language preferences for Android (https://developer.android.com/about/versions/13/features/app-languages#kotlin)\nYou can check if your current device is supported `isLanguagePerAppSettingSupported`\nAnd after checking if your device is supported you can set the per-app language preference with `setLanguagePerApp(Locale)` this will return true if success\n\n### Note for Linux\n\nSince GNU/Linux and POSIX doesn't provide a standard API for getting the preferred languages, `Devicelocale.preferredLanguages` always returns the current locale.\n\n## Updates\n\n### Sept 2023\nmerged pull request for compatibility with AGP 8\n\n### Feb 2023\nAdded  2 new functions for this [iOS issue](https://github.com/magnatronus/flutter-devicelocale/issues/38)\n\n- defaultLocale\n - defaultAsLocale\n \n\n### July 2022\nAdded support for per-app language preferences on Android (https://developer.android.com/about/versions/13/features/app-languages#kotlin)\nYou can now set the per-app language if you have an in app language picker.\nUpdated the demo app\n\n### May 2022\nMerged pull requests\n\n### Oct 2021\nUpdated the code and APIs used by Flutter for an Android plugin - this was the source of the Deprecated API warning in the Android build.\n\n### July 2021\nAdd beta support for Linux\n\n### March 2021\n\nAdded test support for web\n\nUpdated for null safety\n\n### Jul 2020 Locale update v0.3.1\n\nThis is an update from a received request, where prior to 0.3.1  the 2 methods:\n\n- **preferredLanguages**\n- **currentLocale**\n\nreturned string values.\n\nThere are now 2 equivilent methods\n\n- **preferredLanguagesAsLocales**\n- **currentAsLocale**\n\nthat now also return a **Locale** object rather than a string.\n\n### releases\n\n- March 2021 1.0.0 Updated to null safety\n\n- July 2020 0.3.0 Updated Android to support Android Embedding V2\n\n- Apr 2020 0.2.3 Updated Android code from contributions from @ened\n\n- Mar 2020 0.2.2 Updated iOS so that if detected locale is null then it is not included in return value\n\n- Sep 2019 0.2.0 Updated Android following feedback from https://github.com/huzhirento . Fallback to the currentLocale when attempting to get a list of locales fro Android 7 and below as the getLocales() call is a feature of API 24 and failed for Android 7 and below.\n\n## Getting Started\n\nFor help getting started with Flutter, view our\n[online documentation](https://flutter.io/docs), which offers tutorials,\nsamples, guidance on mobile development, and a full API reference.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagnatronus%2Fflutter-devicelocale","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmagnatronus%2Fflutter-devicelocale","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagnatronus%2Fflutter-devicelocale/lists"}