nations library

Let the people use there languages 💪


  • to load lang files from 'assets/lang/'
  • AppLang
    facilitate controlling the localization process
  • listen and rebuild when locale changes
  • LangConfig
    contains the localization config
    initialize nations package
    An identifier used to select a user's language and formatting preferences.
  • 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
    nations base class


  • model gender enum
  • Extensions

    NationsLocaleX on Locale
    helper extension for the locale features
    NationsTrans on String
    string translation extension


    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