Generates a localizations delegate from a CSV file.
Install globally the tool :
$ pub global activate flutter_csv_localization
Then run the generator :
$ pub global run flutter_csv_localization:generate -o example.g.dart example.csv
The csv file should have :
Key,fr,en dates.weekday.monday,lundi,monday dates.weekday.tuesday,mardi,tuesday dates.weekday.wednesday,mercredi,wednesday dates.weekday.thursday,jeudi,thursday dates.weekday.friday,vendredi,friday dates.weekday.saturday,samedi,saturday dates.weekday.sunday,dimanche,sunday
I find the Flutter internationalization tools not really easy to use, and I wanted a simple tool for sharing translations.
Add this to your package's pubspec.yaml file:
dependencies: flutter_csv_localization: ^0.1.2
You can install packages from the command line:
$ pub get
$ flutter packages get
Alternatively, your editor might support
pub get or
flutter packages get.
Check the docs for your editor to learn more.
Now in your Dart code, you can use:
|0.1.2||Apr 15, 2019|
|0.1.1||Apr 9, 2019|
|0.1.0||Apr 9, 2019|
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]
We analyzed this package on Apr 15, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
Detected platforms: Flutter, other
Document public APIs. (-1 points)
29 out of 29 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.
bin/generate.dart. (-1.49 points)
bin/generate.dart reported 3 hints:
line 1 col 8: Unused import: 'dart:convert'.
line 13 col 7: Use isNotEmpty instead of length
line 19 col 1: The class 'Future' was not exported from 'dart:core' until version 2.1, but this code is required to be able to run on earlier versions.
lib/src/parser.dart. (-1.49 points)
lib/src/parser.dart reported 3 hints:
line 8 col 3: The class 'Future' was not exported from 'dart:core' until version 2.1, but this code is required to be able to run on earlier versions.
line 8 col 31: The class 'Stream' was not exported from 'dart:core' until version 2.1, but this code is required to be able to run on earlier versions.
line 23 col 14: Use isNotEmpty instead of length
lib/src/localizations.dart. (-0.50 points)
lib/src/localizations.dart reported 1 hint:
line 39 col 9: Use isNotEmpty instead of length
dartfmt to format
The package description is too short. (-13 points)
Add more detail to the
description field of
pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.
Maintain an example.
None of the files in the package's
example/ directory matches known example patterns.
Common filename patterns include
flutter_csv_localization.dart. Packages with multiple examples should provide
For more information see the pub package layout conventions.
|Dart SDK||>=2.0.0 <3.0.0|