locale_gen 0.0.1

  • README.md
  • Example
  • Installing
  • Versions
  • new49

flutter locale gen #

Dart tool that will convert your default locale json to dart code.

pub package

This repo contains an example how to use this package.

based on a package I made at icapps for the icapps translations -> https://github.com/icapps/flutter-icapps-translations

Packages used:

  • flutter_localizations
  • shared_preferences
  • provider
  • kiwi
  • locale_gen

Example #


Setup #

Add dependency to pubspec #

pub package

  locale_gen: <latest-version>

Add config to pubspec #

Add your locale folder to the assets to make use all your translations are loaded.

    - assets/locale/

Add the local_gen config to generate your dart code from json files

  default_language: 'nl'
  languages: ['en', 'nl']

if nothing is configured the following config will be used:

  default_language: 'en'
  languages: ['en']

Run package with Flutter #

flutter packages pub run locale_gen

Run package with Dart #

pub run locale_gen

Changelog #

[0.0.2] - 2019-02-12

Added #

-Updated README.md

[0.0.1] - 2019-02-12

Added #

-Initial release


Example for the locale_gen #

Use this package as a library

1. Depend on it

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

  locale_gen: ^0.0.1

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

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

Version Uploaded Documentation Archive
0.0.1 Jun 12, 2019 Go to the documentation of locale_gen 0.0.1 Download locale_gen 0.0.1 archive
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 Jun 17, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.3.2
  • pana: 0.12.18


Detected platforms: Flutter, web, other

No platform restriction found in libraries.

Health suggestions

Format bin/locale_gen.dart.

Run dartfmt to format bin/locale_gen.dart.

Format bin/src/case_util.dart.

Run dartfmt to format bin/src/case_util.dart.

Format bin/src/params.dart.

Run dartfmt to format bin/src/params.dart.

Maintenance suggestions

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
path ^1.6.2 1.6.2
yaml ^2.1.15 2.1.16
Transitive dependencies
charcode 1.1.2
collection 1.14.11
meta 1.1.7
source_span 1.5.5
string_scanner 1.0.4
term_glyph 1.1.0
Dev dependencies
test ^1.0.0