Coder Social home page Coder Social logo

intl_manager's Introduction

intl_manager

A library tool that help you manager i18n strings in flutter,include convert from android "strings-xx.xml". Before to use,you need to kown what is LocalizationsDelegate and what is intl_translation.

Flutter use arb file to manager i18n strings. some times you need to refactor an old android project use flutter.

intl_manager can help you converte android strings-xx.xml to flutter's arb file,and auto generate Dart class include all the strings define.You just need to extend the Dart class and registe with LocalizationsDelegate.

Flutter's internationalization reference: https://github.com/flutter/website/tree/master/examples/internationalization/intl_example/lib

Install

dev_dependencies:
  intl_manager: version

Use build args

--scan-dir the path where to scan android style strings-xx.xml files

--out-dir ARB and dart file output path

--gen-class the dart class name of auto generated

--file-name the dart file name of auto generated.default is:"strings_define.dart" (defaults to "strings_define.dart")

--dev-locale use which locale content to generate default dart class

build: flutter packages pub run intl_manager:build --scan-dir=xx --out-dir=yy --gen-class=zz

Use json config 'intl_manager.json'

{
  "scan-dir": "assets/i18n",
  "out-dir": "lib/i18n/gen",
  "gen-class": "AppStringsDefine",
  "dev-locale": "zh"
}

build: flutter packages pub run intl_manager:build

intl_manager's People

Contributors

daohoangson avatar shenkaige avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

intl_manager's Issues

Version solving

Flutter sdk has been updated to version 1.12. Please apply a version compatibility for your library. Thanks!

Support country code

Hello
Is there a way to generate locale for a country? For example, strings-en-rGB.xml to intl_en_rGB.arb and messages_en_rGB.dart

Thank you

New line character \n is not properly converted.

Android locatization files strings-xx.xml may contain \n characters. If I try to convert ones using intl_manager additional \ will be added for every \n character but it break down new line element.
For example: <string name="hello">Hello\nworld!</string>
Result: "hello" : MessageLookupByLibrary.simpleMessage("Hello\\nworld!"),
UI result: Hello\nworld!

Upgrade required

Please upgrade dependencies for your plugin
Because intl_manager 0.0.4 depends on intl ^0.15.7 and no versions of intl_manager match >0.0.4 <0.1.0, intl_manager ^0.0.4 requires intl ^0.15.7. So, because app depends on both intl ^0.16.0 and intl_manager ^0.0.4, version solving failed.

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.