intl_script_recognizer 2.3.1 copy "intl_script_recognizer: ^2.3.1" to clipboard
intl_script_recognizer: ^2.3.1 copied to clipboard

Handle the Locale which offer script language only to corresponded region code in intl package

An adapter helps intl package recognize correct language when Locale specified script language #


Pub version GitHub Sponsors Unit test


The pattern of locale for intl package is (language)_(COUNTRY) only. However, Flutter's Locale format is (language)_(Script)_(COUNTRY) which triggered fallback to (language) only. Therefore, this package aims to handle correct language system by define country code with corresponded scripting.

Get started #

Before start #

The future release in major version number of this package will depend on the latest major version of Dart and Flutter SDK. It may rewrite new syntax to satisify use case which no longer compatable for older release one.

To avoid this issue, you may required to run flutter upgrade before install it.

Install #

Install intl and this package by using command:

flutter pub add intl intl_script_recognizer

or modify dependencies in pubspec.yaml directly:

# pubspec.yaml
depencencies:
    intl: any
    intl_script_recognizer: ^2.2.0

Then, import dependencies into your project:

import 'package:intl/intl.dart';
import 'package:intl_script_recognizer/base.dart';

If DateFormat is required, it is highly recommended to import date format extension package:

import 'package:intl_script_recognizer/date_format.dart';

By default, IntlScriptRecognizer will recognized "Traditional Chinese" (zh_Hant) to "Chinese (Taiwan)" (zh_TW) once the instance has been created. If you preferred to uses another country or region's varient (in this case, Hong Kong), it is possible to override assigned record by activating replaceExisted like example.

License #

BSD-3

0
likes
160
pub points
0%
popularity

Publisher

verified publisherrk0cc.xyz

Handle the Locale which offer script language only to corresponded region code in intl package

Repository (GitHub)
View/report issues

Topics

#intl #locale #l10n #localization

Documentation

API reference

Funding

Consider supporting this project:

github.com

License

BSD-3-Clause (license)

Dependencies

flutter, intl

More

Packages that depend on intl_script_recognizer