All Projects → Skyost → EzLocalization

Skyost / EzLocalization

Licence: MIT license
Localize your flutter application quickly and easily.

Programming Languages

dart
5743 projects
HTML
75241 projects
swift
15916 projects

Projects that are alternatives of or similar to EzLocalization

Texterify
The localization management system.
Stars: ✭ 37 (+184.62%)
Mutual labels:  localization, translate
Fluent
Fluent — planning, spec and documentation
Stars: ✭ 818 (+6192.31%)
Mutual labels:  localization, translate
react-translator-component
React language translation module for developing a multilingual project.
Stars: ✭ 13 (+0%)
Mutual labels:  localization, translate
learnrxjs
Русскоязычная документация RxJS
Stars: ✭ 20 (+53.85%)
Mutual labels:  localization, translate
Flutter translate
Flutter Translate is a fully featured localization / internationalization (i18n) library for Flutter.
Stars: ✭ 245 (+1784.62%)
Mutual labels:  localization, translate
React Intl Hooks
React hooks for internationalization without the hassle ⚛️🌍
Stars: ✭ 64 (+392.31%)
Mutual labels:  localization, translate
Angular L10n
An Angular library to translate texts, dates and numbers
Stars: ✭ 350 (+2592.31%)
Mutual labels:  localization, translate
React Translated
A dead simple way to add complex translations (i18n) in a React (DOM/Native) project 🌎🌍🌏
Stars: ✭ 176 (+1253.85%)
Mutual labels:  localization, translate
pdx-ymltranslator
Paradox Interactive YML Translator
Stars: ✭ 18 (+38.46%)
Mutual labels:  localization, translate
sketch-crowdin
Connect your Sketch and Crowdin projects together
Stars: ✭ 35 (+169.23%)
Mutual labels:  localization, translate
ad localize
ADLocalize is a simple way to manage your localization files. Supported wording sources : CSVs and Google Sheets. Localization file generation available for iOS, Android, JSON (i18next), YAML and Java properties
Stars: ✭ 22 (+69.23%)
Mutual labels:  localization
kictor
A dictionary based on the console, 一个基于控制台的词典工具
Stars: ✭ 15 (+15.38%)
Mutual labels:  translate
awesome-i18n
🌍 A curated list of i18n resources for all kind of languages and frameworks
Stars: ✭ 205 (+1476.92%)
Mutual labels:  localization
PoExtractor
Extracts localizable strings from .cs, .vb, .cshtml and .liquid files into POT files
Stars: ✭ 39 (+200%)
Mutual labels:  localization
PersianDataAnnotations
PersianDataAnnotations is ASP.NET Core MVC & ASP.NET MVC Custom Localization DataAnnotations (Localized MVC Errors) for Persian(Farsi) language - فارسی سازی خطاهای اعتبارسنجی توکار ام.وی.سی. و کور.ام.وی.سی. برای نمایش اعتبار سنجی سمت کلاینت
Stars: ✭ 38 (+192.31%)
Mutual labels:  localization
TranslationPlugin
Translation plugin for IntelliJ based IDEs/Android Studio/HUAWEI DevEco Studio.
Stars: ✭ 9,375 (+72015.38%)
Mutual labels:  translate
CHR
SIXray : A Large-scale Security Inspection X-ray Benchmark in CVPR 2019
Stars: ✭ 78 (+500%)
Mutual labels:  localization
alternate
Plug and Phoenix helpers to localize your web app via the URL
Stars: ✭ 26 (+100%)
Mutual labels:  localization
zTranslate
zTranslate是pascal/c++圈的国际化之手,可以一键国际化,也可以用最廉价外包投入解决项目国际化问题
Stars: ✭ 29 (+123.08%)
Mutual labels:  translate
node-google-translate-skidz
Simple Node.js library for talking to Google's Translate API for free.
Stars: ✭ 70 (+438.46%)
Mutual labels:  translate

EzLocalization

This package allows you to setup a powerful localization system with ease and in only a few minutes.

Features

Here are some features:

  • Easy, lightweight, open-source.
  • MIT licensed.
  • Easily extensible.

Getting started

It only takes a few steps in order to get EzLocalization to work !
First, add the following code to your MaterialApp definition (usually in main.dart) :

EzLocalizationDelegate ezLocalization = EzLocalizationDelegate(supportedLocales: [Locale('en'), Locale('fr')]); // The first language is your default language.

return MaterialApp(
  // ...
  localizationsDelegates: ezLocalization.localizationDelegates,
  supportedLocales: ezLocalization.supportedLocales,
  localeResolutionCallback: ezLocalization.localeResolutionCallback,
);

Then you create a folder named languages in your assets directory with the defined languages in it. An example structure could be :

assets
└── languages
    ├── en.json
    └── fr.json

Here's an example of en.json :

{
  "hello": "Hello !"
}

And a translated fr.json :

{
  "hello": "Bonjour !"
}

Don't forget to add the assets in your pubspec.yml :

flutter:
  # ...
  assets:
    - "assets/languages/"

That's it ! To get your string you only have to call EzLocalization.of(context)!.get('hello').

Advanced

Extension method

With the extension method, it's even easier to get a localized string ! The only thing you have to do is to replace EzLocalization.of(context)!.get('key') by context.getString('key').

You may have to manually import EzLocalization in your file.

Builder widget

EzLocalization provides a builder widget called EzLocalizationBuilder. You can use it as such :

EzLocalizationBuilder(
  delegate: EzLocalizationDelegate(
    supportedLocales: [
      Locale('en'),
      Locale('fr'),
      Locale('es'),
    ],
  ),
  builder: (context, localizationDelegate) => MaterialApp(
    title: 'Beautifully localized app',
    home: MyMainWidget(),
    localizationsDelegates: localizationDelegate.localizationDelegates,
    supportedLocales: localizationDelegate.supportedLocales,
    localeResolutionCallback: localizationDelegate.localeResolutionCallback,
  ),
);

It has two advantages :

  • It helps reducing boilerplate.
  • You can dynamically change the current locale using EzLocalizationBuilder.of(context)!.changeLocale(yourLocale).

Nested strings

You can nest translation strings as such :

{
  "tabs": {
    "home": "Home"
  }
}

And it can be access using EzLocalization.of(context)!.get('tabs.home').

Format arguments

In your translation string, you may add arguments using {} :

{
  "greeting": "Hello {target}, my name is {me} !"
}

You can then fill them with EzLocalization.of(context)!.get('greeting', {'target': 'John', 'me': 'Bob'}). Also, instead of a map you can pass a list and get your arguments by their indexes.

Change the files path

You can change from the default path of assets/languages/$languageCode.json by passing getPathFunction to EzLocalizationDelegate. You will then have to provide a valid asset path according to the specified locale.

Don't forget to update your assets entry in your pubspec !

Updating the iOS app bundle

See the official flutter.dev documentation about updating the iOS app bundle.

Contributing

You have a lot of options to contribute to this project ! You can :

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].