flutter_translate 1.5.7

  • Readme
  • Changelog
  • Example
  • Installing
  • 93

Build Status pub package Awesome Flutter License: MIT Flutter.io

Flutter Translate is a fully featured localization / internationalization (i18n) library for Flutter.

It lets you define translations for your content in different languages and switch between them easily.

Example #

Features #

  • Very easy to use
  • Pluralization support
  • Static keys support with flutter_translate_gen
  • Supports both languageCode (en) and languageCode_countryCode (en_US) locale formats
  • Automatically save & restore the selected locale with a simple implementation
  • Full support for right-to-left locales
  • Fallback locale support in case the system locale is unsupported
  • Supports both inline or nested JSON

Documentation #

Complete documentation is available on the wiki page.

To get started please see Installation, Configuration & Usage.

Examples #

Issues #

Please file any issues, bugs or feature request here.

License #

This project is licensed under the MIT License

Author #

This Flutter package is developed by Florin Bratan. You can contact me at florin@leadcode.dev


  • Initial release.


  • Removed the flutter_localizations dependency.


  • Simplified the localization initialization.


  • Implemented a global translate method.
  • Removed the static Translate class.
  • Localization is now a singleton.


  • Implemented pluralization.
  • Fixed multiple issues.
  • translate, translatePlural and changeLanguage methods are now global.


  • Missing localizations now return the full key path.


  • Fixed possible exception when adding an extra slash to the basePath


  • Implemented the onLocaleChanged callback


  • Implemented the localeToString method


  • Fixed some callback issues for onLocaleChanged


  • Implemented support for automatically saving & restoring the selected locale using shared preferences


  • Added the Awesome Flutter badge



  • Fixed the blackscreen issue on startup
  • Fixed the iOS issue regarding the device locale
  • The current device locale is now used on startup


  • Updated the flutter_device_locale dependency to avoid a possible exception
  • Updated the example to AndroidX


  • Updated the flutter_device_locale version


  • Renamed packages, updated license and links


  • Updated the examples
  • Fixed some issues with flutter_device_locale and swift


example #

Example project for the flutter_translate library

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  flutter_translate: ^1.5.7

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:flutter_translate/flutter_translate.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Dec 9, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.1
  • pana: 0.13.1+4
  • Flutter: 1.12.13+hotfix.2

Health suggestions

Fix lib/localization_provider.dart. (-0.50 points)

Analysis of lib/localization_provider.dart reported 1 hint:

line 12 col 70: 'inheritFromWidgetOfExactType' is deprecated and shouldn't be used. Use dependOnInheritedWidgetOfExactType instead. This feature was deprecated after v1.12.1..

Fix lib/localized_app.dart. (-0.50 points)

Analysis of lib/localized_app.dart reported 1 hint:

line 15 col 61: 'ancestorWidgetOfExactType' is deprecated and shouldn't be used. Use findAncestorWidgetOfExactType instead. This feature was deprecated after v1.12.1..

Format lib/configuration_validator.dart.

Run flutter format to format lib/configuration_validator.dart.

Fix additional 9 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/constants.dart (Run flutter format to format lib/constants.dart.)
  • lib/global.dart (Run flutter format to format lib/global.dart.)
  • lib/locale_file_service.dart (Run flutter format to format lib/locale_file_service.dart.)
  • lib/locale_service.dart (Run flutter format to format lib/locale_service.dart.)
  • lib/localization.dart (Run flutter format to format lib/localization.dart.)
  • lib/localization_configuration.dart (Run flutter format to format lib/localization_configuration.dart.)
  • lib/localization_delegate.dart (Run flutter format to format lib/localization_delegate.dart.)
  • lib/localized_app_state.dart (Run flutter format to format lib/localized_app_state.dart.)
  • lib/translate_preferences.dart (Run flutter format to format lib/translate_preferences.dart.)


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
flutter_device_locale ^0.3.4+1 0.3.4+1
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8