nations library Null safety

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

    Extensions

    NationsLocaleX
    helper extension for the locale features
    NationsTrans
    string translation extension

    Functions

    capitalizeFirstChar(String str) String
    takes foo return Foo takes foo bar return Foo bar
    capitalizeFirstCharForEachWord(String str) String
    takes foo return Foo takes foo bar return Foo Bar takes foo bar zee return Foo Bar Zee
    convertToArabicNumbers(String str) String
    arabic numbers are 0123456789 convert numbers to arabic format 0123456789 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
  • Enums

    Gender
  • model gender enum