Flutter Localized Locales

Flutter package which provides locale code to name mappings for 563 locales
Alternatives To Flutter Localized Locales
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Iconfont_builder39
3 years ago15December 28, 2019bsd-2-clauseDart
便捷生成 Iconfont 图标字体在用于 Flutter / use dart build iconfont to Flutter Icon or IconData
Flutter_extractor21
4 years ago2Python
Extracting strings and function names from Flutter apks
Flutter Localized Locales16
5 months agomitDart
Flutter package which provides locale code to name mappings for 563 locales
Flutter Package String To Color8
4 years ago4May 22, 2020otherDart
Flutter package to convert String color names to Color and MaterialColors
Flutter_test24
6 years agoDart
An example of a MongoDB-driven Flutter app
Baby Names Graphql Flutter3
5 years agoDart
A flutter app using GraphQL
Typeweight2
a year agomitC++
More readable font weights for Flutter.
Sanitize_filename2
a year agolgpl-3.0Dart
Dart / Flutter package, which replaces characters in strings that are illegal/unsafe for filenames.
Alternatives To Flutter Localized Locales
Select To Compare


Alternative Project Comparisons
Readme

flutter_localized_locales

pub package

flutter_localized_locales is a Flutter package which enables obtaining localized locale names from locale codes (ISO 6391) for 563 locales.

This package is based on the flutter_localized_countries package. Data is taken from umpirsky/locale-list.

Getting started

Adding the localizations delegate

This package bundles required assets and provides a LocalizationsDelegate for loading them. Specify localizationsDelegates for your MaterialApp, CupertinoApp, or WidgetsApp.

import 'package:flutter_localized_locales/flutter_localized_locales.dart';

void main() {
  runApp(MaterialApp(
    localizationsDelegates: [
      LocaleNamesLocalizationsDelegate(),
      // ... more localization delegates
    ],
    ...
  );

Usage

Locale name

LocaleNames.of(context)!.nameOf(String locale)

// Invalid locale string
print(LocaleNames.of(context)!.nameOf('zzzzz'));    // null

// On a device whose locale is English (en)
print(LocaleNames.of(context)!.nameOf('fr_CA'));   // French (Canada)

// On a device whose locale is Spanish (es)
print(LocaleNames.of(context)!.nameOf('fr_CA'));   // francs (Canad)

// On a device whose locale isn't supported, an attempt is made to find a supported one
// e.g. for a device whose locale is German (United Kingdom), returns German (de) names
print(LocaleNames.of(context)!.nameOf('fr_CA'));   // Franzsisch (Kanada)

// On a device whose selected locale isn't supported, and no supported locale can be found,
// fallback to English (en) names. 
// You can specify a different fallback locale
// e.g. to fallback to Afrikaans (af) names instead of English
LocaleNamesLocalizationsDelegate(fallbackLocale: 'af')

Supported locales are listed in lib/locales.dart.

All locale names, sorted

LocaleNames.sortedByCode()

LocaleNames.sortedByName()

Respective locale names

LocaleNamesLocalizationsDelegate.nativeLocaleNames

For 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.

print(LocaleNamesLocalizationsDelegate.nativeLocaleNames);      // { ... af_ZA: Afrikaans (Suid-Afrika), ... ar:   ) ...  as:  ... fr: Franais ... en: English ... }

Known Bugs

Popular Names Projects
Popular Flutter Projects
Popular Text Processing Categories
Related Searches

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
Plugin
Dart
Flutter
Names
Localization
I18n
Iso
Internationalization
Flutter Plugin