icapps_translations 0.2.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 57

flutter icapps translations #

A dart package to automaticly download translations from the icapps translation tool.

pub package

This repo contains an example how to use this package.

Packages used:

  • flutter_localizations
  • shared_preferences
  • provider
  • kiwi
  • icapps_translations

Example #

Example

Setup #

Add dependency to pubspec #

pub package

dev-dependencies:
  icapps_translations: <latest-version>

Add config to pubspec #

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

flutter:
  assets:
    - assets/locale/

Add the icapps_translations config to fetch the latest translations

icapps_translations:
  api_key: 'enter-your-api-key'
  default_language: 'nl'
  languages: ['en', 'nl']

set an env variable for your api_key

API_KEY_ICAPPS_TRANSLATIONS

Run package with Flutter #

flutter packages pub run icapps_translations

Run package with Dart #

pub run icapps_translations

Arguments #

Arguments are supported as of 0.1.3

You can pass a String or a num to as an argument.

Formatting for String: %1$s Formatting for num: %1$d

The number in between % and $ indicate the index of the argument. It is possible to place an argument in 1 language first but in another second:

ex (Grammatically incorrect but it makes my point):

nl '%1$s, ik woon in %2$s. Wist je dat niet?' => KOEN, ik woon in ANTWERPEN. Wist je dat niet?

fr 'I live in %2$s. You didn't knew that %1$s?" => I live in ANTWERP. You didn't knew that KOEN?

Working on mac? #

add this to you .bash_profile

fluttertranslations(){
 flutter packages get && flutter packages pub run icapps_translations
}

now you can use the icapps translations with a single command.

fluttertranslations

Changelog #

[0.2.1] - 2019-10-21

Fixed #

-Formatting

[0.2.0] - 2019-10-21

Added #

-Support for test

Removed #

-Unneeded logs

[0.1.9] - 2019-08-19

Added #

-Errorhandling with an easy to understand message

[0.1.8] - 2019-06-20

Fixed #

-Fixed documentation for arguments %1$s or %1$d -Fixed dartfmt

[0.1.7] - 2019-06-20

Fixed #

-Fixed dartfmt

[0.1.6] - 2019-06-20

Fixed #

-Fixed formatting for the localization_delegate.dart file

[0.1.5] - 2019-06-20

Added #

-Added a new template project for the translations

Fixed #

-Fixed a crash when no translations were added.

[0.1.4] - 2019-06-13

Fixed #

-dart formatting

[0.1.3] - 2019-06-13

Added #

-Added support for arguments (%1$s = string and %1$d =number are supported). Formatting is not supported.

Fixed #

-README.md

-example README.md

[0.1.2] - 2019-06-13

Added #

-dart format

[0.1.1] - 2019-06-13

Added #

-Fixed a pub.dev linting warning for better health

[0.1.0] - 2019-06-13

Added #

-Updated README.md & dart format

[0.0.3] - 2019-06-12

Added #

-Updated the description

[0.0.2] - 2019-06-12

Added #

-Updated README.md

[0.0.1] - 2019-06-12

Added #

-Initial release

example/README.md

Example for the icapps translations #

Place your default language in (in this case 'en' is my default language)':

root-project/assets/locale/en.json

Run package with Flutter #

flutter packages pub run icapps_translations

Run package with Dart #

pub run icapps_translations

Result #

Code will be generated in

root-project/lib/util/locale

Use this package as a library

1. Depend on it

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


dependencies:
  icapps_translations: ^0.2.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.

Popularity:
Describes how popular the package is relative to other packages. [more]
15
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
57
Learn more about scoring.

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

  • Dart: 2.6.1
  • pana: 0.12.21

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in libraries.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
http ^0.12.0+2 0.12.0+2
path ^1.6.2 1.6.4
yaml ^2.1.15 2.2.0
Transitive dependencies
async 2.4.0
charcode 1.1.2
collection 1.14.12
http_parser 3.1.3
meta 1.1.8
pedantic 1.8.0+1
source_span 1.5.5
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
Dev dependencies
test ^1.0.0