{"id":14971531,"url":"https://github.com/guidezpl/flutter-localized-locales","last_synced_at":"2025-06-21T06:42:00.617Z","repository":{"id":50826371,"uuid":"235994218","full_name":"guidezpl/flutter-localized-locales","owner":"guidezpl","description":"Flutter package which provides locale code to name mappings for 563 locales","archived":false,"fork":false,"pushed_at":"2023-09-21T06:10:58.000Z","size":1366,"stargazers_count":17,"open_issues_count":2,"forks_count":13,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-15T06:45:07.968Z","etag":null,"topics":["dart","flutter","flutter-i18n","flutter-localization","flutter-localizations","flutter-package","flutter-plugin","i18n","internationalization","localization"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/flutter_localized_locales","language":"Dart","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/guidezpl.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}},"created_at":"2020-01-24T11:54:53.000Z","updated_at":"2025-05-25T14:31:38.000Z","dependencies_parsed_at":"2024-06-19T04:12:36.671Z","dependency_job_id":"64c3dcfb-716f-4aee-92b6-581de8796c73","html_url":"https://github.com/guidezpl/flutter-localized-locales","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/guidezpl/flutter-localized-locales","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guidezpl%2Fflutter-localized-locales","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guidezpl%2Fflutter-localized-locales/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guidezpl%2Fflutter-localized-locales/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guidezpl%2Fflutter-localized-locales/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/guidezpl","download_url":"https://codeload.github.com/guidezpl/flutter-localized-locales/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guidezpl%2Fflutter-localized-locales/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261080113,"owners_count":23106564,"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":["dart","flutter","flutter-i18n","flutter-localization","flutter-localizations","flutter-package","flutter-plugin","i18n","internationalization","localization"],"created_at":"2024-09-24T13:45:20.406Z","updated_at":"2025-06-21T06:41:55.587Z","avatar_url":"https://github.com/guidezpl.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# flutter_localized_locales \n[![pub package](https://img.shields.io/pub/v/flutter_localized_locales.svg)](https://pub.dev/packages/flutter_localized_locales)\n\n[flutter_localized_locales](https://pub.dev/packages/flutter_localized_locales) is a Flutter package which enables obtaining localized locale names from locale codes (ISO 639‑1) for 563 locales.\n\nThis package is based on the [flutter_localized_countries](https://github.com/nickolas-pohilets/flutter-localized-countries) package. Data is taken from [https://github.com/umpirsky/locale-list](https://github.com/umpirsky/locale-list).\n\n## Getting started\n\n### Adding the localizations delegate\nThis package bundles required assets and provides a [LocalizationsDelegate](https://docs.flutter.io/flutter/widgets/LocalizationsDelegate-class.html) for loading them. Specify `localizationsDelegates` for your `MaterialApp`, `CupertinoApp`, or `WidgetsApp`.\n\n```dart\nimport 'package:flutter_localized_locales/flutter_localized_locales.dart';\n\nvoid main() {\n  runApp(MaterialApp(\n    localizationsDelegates: [\n      LocaleNamesLocalizationsDelegate(),\n      // ... more localization delegates\n    ],\n    ...\n  );\n```\n\n## Usage\n\n### Locale name\n```LocaleNames.of(context)!.nameOf(String locale)```\n\n```dart\n// Invalid locale string\nprint(LocaleNames.of(context)!.nameOf('zzzzz'));    // null\n\n// On a device whose locale is English (en)\nprint(LocaleNames.of(context)!.nameOf('fr_CA'));   // French (Canada)\n\n// On a device whose locale is Spanish (es)\nprint(LocaleNames.of(context)!.nameOf('fr_CA'));   // francés (Canadá)\n\n// On a device whose locale isn't supported, an attempt is made to find a supported one\n// e.g. for a device whose locale is German (United Kingdom), returns German (de) names\nprint(LocaleNames.of(context)!.nameOf('fr_CA'));   // Französisch (Kanada)\n\n// On a device whose selected locale isn't supported, and no supported locale can be found,\n// fallback to English (en) names. \n// You can specify a different fallback locale\n// e.g. to fallback to Afrikaans (af) names instead of English\nLocaleNamesLocalizationsDelegate(fallbackLocale: 'af')\n```\n\nSupported locales are listed in [lib/locales.dart](lib/locales.dart).\n\n### All locale names, sorted\n```LocaleNames.sortedByCode()```\n\n```LocaleNames.sortedByName()```\n\n### Respective locale names \n```LocaleNamesLocalizationsDelegate.nativeLocaleNames```\n\nFor convenience, this package provides a map of locale codes to their respective locale names. This always returns the same data, irrespective of the device locale.\n```dart\nprint(LocaleNamesLocalizationsDelegate.nativeLocaleNames);      // { ... af_ZA: Afrikaans (Suid-Afrika), ... ar: ال العربية السعودية) ...  as: অসমীয়া ... fr: Français ... en: English ... }\n```\n\n## Known Bugs\n\n* Sorting by name does not respect the locale, because Flutter does not provide any [API for string collation](https://github.com/flutter/flutter/issues/27549).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguidezpl%2Fflutter-localized-locales","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fguidezpl%2Fflutter-localized-locales","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguidezpl%2Fflutter-localized-locales/lists"}