Giter VIP home page Giter VIP logo

ogty / tools-for-i18n Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 0.0 997 KB

๐ŸŒ Useful tools for internationalization support. Can convert from yaml files and create tables. Additional languages can also be automatically translated.

License: MIT License

Python 86.41% Shell 0.75% Makefile 0.76% Smarty 12.08%
i18n internationalization command-line-tool automatic-translation translation

tools-for-i18n's Introduction

Tools for i18n

๐ŸŽˆ Feature

  • โœ… Segment translation files into their respective languages
  • โœ… Restoring a segmented translation file back to its original file
  • โœ… Automatic translation of additional language

โš™๏ธ Setup

$ git clone https://github.com/ogty/tools-for-internationalization
$ source ./tools-for-internationalization/setup.sh # or make

๐Ÿ“– Usage

$ i18n <commands> [options]

Note
To change the output format of the table, you need to replace the commented out variables in settings.py.

๐Ÿค– Commands

Command Description
segment Commands to segment translation files into their respective languages
revgene Command to convert a segmented translation file into a yaml file
table Command to create a table from segmented translation data
help Commands to display usage, etc.

๐Ÿ” Options

Name Argument Commands
-f, --file <file> segment, revgene, table
-o, --output <directory/file> segment, revgene, table
-l, --languages <language [...]> segment, table
-al, --additonal_language <language> revgene
-d, --directory <directory> revgene
-at, --automatic_translation - revgene
-s, --show - table

โœ๏ธ Example

Segment the translation file into each language

$ i18n segment -f ./sample/public/locales/i18n.yaml -l ja en -o ./sample/public/locales

Generate the original translation file (yaml) from the segmented translation file (json)

$ i18n revgene -d ./sample/public/locales -f translations.json -o i18n.yaml

Output translation files to a file as a table

$ i18n table -f ./sample/public/locales/i18n.yaml -l ja en -o i18n.md

Add new languages to the translation file and output as a table

$ i18n revgene -d ./sample/public/locales -f translations.json -al fr -o i18n.yaml && \
  i18n table -f ./sample/public/locales/i18n.yaml -l ja en fr -o i18n.md

๐Ÿ–จ๏ธ Output

./sample/index.html

Note
If you want to change the design of the output table, please modify the templates/html.tpl file

tools-for-i18n's People

Contributors

ogty avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

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.