iso_languages 1.0.1 copy "iso_languages: ^1.0.1" to clipboard
iso_languages: ^1.0.1 copied to clipboard

A Flutter package to work with ISO 639-1 language codes, providing language names, native names, and utility functions.

iso_languages #

A Flutter package for working with ISO 639-1 language codes, providing English and native names for languages in an easy-to-use API.


Features #

  • Retrieve the English name of a language using its ISO code.
  • Retrieve the native name of a language.
  • Supports over 180 ISO 639-1 language codes.
  • Lightweight and developer-friendly.

Installation #

Add the following to your pubspec.yaml file:

dependencies:
  iso_languages: ^1.0.0

Usage #

Import the Package #

  import 'package:iso_languages/iso_languages.dart';

Example: Get Language Names #

 void main() {
   // Get the English name of the language
   String englishName = isoLanguage(shortName: 'en');
   print('English Name: $englishName'); // Output: English
 
   // Get the native name of the language
   String nativeName = isoLanguage(shortName: 'ab', isNativeName: true);
   print('Native Name: $nativeName'); // Output: аҧсуа бызшәа
   
    // Get the Full name of the language
   String name = isoLanguage(shortName: 'bn');
   print('Full Name: $name'); // Output: Bengali
   
    // Get the native name of the language
   String nativeName = isoLanguage(shortName: 'bn', isNativeName: true);
   print('Native Name: $nativeName'); // Output: বাংলা
 
   // Handle unknown codes gracefully
   String unknown = isoLanguage(shortName: 'unknown');
   print('Unknown Code: $unknown'); // Output: (Empty String)
 }
3
likes
0
points
50
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter package to work with ISO 639-1 language codes, providing language names, native names, and utility functions.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on iso_languages