GithubHelp home page GithubHelp logo

mswagner / flutter-icapps-translations Goto Github PK

View Code? Open in Web Editor NEW

This project forked from icapps/flutter-icapps-translations

0.0 1.0 1.0 518 KB

License: MIT License

Dart 84.13% Java 1.02% Shell 1.60% Ruby 11.14% Objective-C 2.11%

flutter-icapps-translations's Introduction

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']
  locale_assets_path: 'assets/locale/' //This is the location where your json files should be saved.
  assets_path: 'assets/locale/' //This is the location where your json files are located in your flutter app.

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

flutter-icapps-translations's People

Contributors

hannesvdb avatar nicolaverbeeck avatar vanlooverenkoen avatar

Watchers

 avatar

Forkers

vuln3r

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.