nations library
Let the people use there languages 💪
Classes
- AppAssetsLoader
-
- to load lang files from 'assets/lang/'
- AppLang
- facilitate controlling the localization process
- LangBuilder
-
- listen and rebuild when locale changes
- LangConfig
- contains the localization config
- LangLauncher
- initialize nations package
- Locale
- An identifier used to select a user's language and formatting preferences.
- NationsAssetsLoader
-
- to load lang files from 'assets/lang/'
- NationsLoader
-
- loads translation form assets or any source
- extend it to build you custom loader if none of the existing
- fits your needs
- PackageAssetsLoader
-
- to load lang files from 'assets/lang/'
- PrefsLauncher
- TransNotifier
- nations base class
Enums
- Gender
-
- model gender enum
Extensions
- NationsLocaleX on Locale
- helper extension for the locale features
- NationsTrans on String
- string translation extension
Functions
-
capitalizeFirstChar(
String str) → String -
takes
foo
returnFoo
takesfoo bar
returnFoo bar
-
capitalizeFirstCharForEachWord(
String str) → String -
takes
foo
returnFoo
takesfoo bar
returnFoo Bar
takesfoo bar zee
returnFoo Bar Zee
-
convertToArabicNumbers(
String str) → String -
arabic numbers are
0123456789
convert numbers to arabic format0123456789
becomes٠١٢٣٤٥٦٧٨٩
-
convertToHindiNumbers(
String str) → String -
arabic numbers are
٠١٢٣٤٥٦٧٨٩
-
numberToLocale(
String str, Locale locale) → String -
localize numbers base on locale
if none provided it will use the app locale
Nations.locale
Make sure you know the difference between arabic and hindi numbers -
replaceArgsOf(
String data, Map< String, Object?> args) → String -
- replace args of map
- in your assets the arg must starts with
:
to be identified as variable- to replace it