flutter_translaty
library
Classes
-
AssetLoader
-
abstract class used to building your Custom AssetLoader
Example:
-
Bidi
-
This provides utility methods for working with bidirectional text. All
of the methods are static, and are organized into a class primarily to
group them together for documentation and discoverability.
-
BidiFormatter
-
Bidi stands for Bi-directional text. According to
Wikipedia:
Bi-directional text is text containing text in both text directionalities,
both right-to-left (RTL) and left-to-right (LTR). It generally involves text
containing different types of alphabets, but may also refer to
boustrophedon, which is changing text directionality in each row.
-
DateFormat
-
DateFormat is for formatting and parsing dates in a locale-sensitive
manner.
-
EasyLocalization
-
EasyLocalization
example:
-
Intl
-
The Intl class provides a common entry point for internationalization
related tasks. An Intl instance can be created for a particular locale
and used to create a date format via
anIntl.date()
. Static methods
on this class are also used in message formatting.
-
MicroMoney
-
Used primarily for currency formatting, this number-like class stores
millionths of a currency unit, typically as an Int64.
-
NumberFormat
-
Provides the ability to format a number in a locale-specific way.
-
OtaService
-
-
RootBundleAssetLoader
-
default used is RootBundleAssetLoader which uses flutter's assetloader
-
TextDirection
-
Represents directionality of text.
Functions
-
localeFromString(String localeString)
→ Locale
-
Convert string locale
localeString
to Locale
-
localeToString(Locale locale, {String separator = '_'})
→ String
-
Convert
locale
to Srting with custom separator
-
plural(String key, num value, {List<String>? args, Map<String, String>? namedArgs, String? name, NumberFormat? format})
→ String
-
function translate with pluralization
key
Localization key
value
Number value for pluralization
BuildContext The location in the tree where this widget builds
args
List of localized strings. Replaces {} left to right
namedArgs
Map of localized strings. Replaces the name keys {key_name} according to its name
name
Name of number value. Replaces {$name} to value
format
Formats a numeric value using a NumberFormat class
-
toBeginningOfSentenceCase(String? input, [String? locale])
→ String?
-
Convert a string to beginning of sentence case, in a way appropriate to the
locale.
-
tr(String key, {List<String>? args, Map<String, String>? namedArgs, String? gender})
→ String
-
Main function for translate your language keys
key
Localization key
BuildContext The location in the tree where this widget builds
args
List of localized strings. Replaces {} left to right
namedArgs
Map of localized strings. Replaces the name keys {key_name} according to its name
gender
Gender switcher. Changes the localized string based on gender string