0.0
No commit activity in last 3 years
No release in over 3 years
Utils to convert translations from source formats to PO/POT Gettex and vise versa. It allows to separate translations from development of apps. Supported input/output formats: iOS and OS X String Resources, Android String XML, Gettext PO/POT, Rails YAML, Basic flat YAML, Java properties, CVS for easy exchange with other apps. Direct converation between any formats supported. Rails YAML and PO supports plural forms of messages.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

 Project Readme

i18n-po-tools

Utils to convert translations from source formats to PO/POT Gettex and vise versa. It allows to separate translations from development of apps.

Supported input/output formats:

Direct converation between any formats supported.

About design decision you can read in the Design.txt.

Rails YAML and PO supports plural forms of messages. Example: 1 message, 2 messages.

Sorry, more info only in Russian in the Readme.ru.md file.

Installation

Add this line to your application's Gemfile:

gem 'i18n_po_tools'

And then execute:

$ bundle

Or install it yourself as:

$ gem install i18n_po_tools

Usage

Command: i18n-po [OPTIONS]

Options:
-i, --input FILENAME             input filename (default STDIN)
-b, --base FILENAME              base language input filename (only for po output mode)
-o, --output FILENAME            output filename (default STDOUT)
-f, --from FORMAT                input file format (default is autodetect by ext)
                                 (rails_yaml, flat_yaml, po, pot, ios, android, properties, csv)
-t, --to FORMAT                  output file format (default is autodetect by ext)
                                 (rails_yaml, flat_yaml, po, pot, ios, android, properties, csv)
-l, --language LANGUAGE          input file language (only for po or rails_yaml output mode)
-h, --help                       help

Examples:
1) First import (generation of PO file) from Rails YAML file:
i18n-po --input   ~/projects/rails_app/config/locales/devise.en.yml --language en \
         --base ~/projects/rails_app/config/locales/devise.ru.yml \
         --output  ~/projects/translations/rails_app/devise.en.po

2) Generation of translation template (POT file) from Rails YAML file:
i18n-po --input ~/projects/rails_app/config/locales/devise.ru.yml \
         --output  ~/projects/translations/rails_app/devise.en.pot

3) Generation of Rails YAML file from PO file:
i18n-po --input   ~/projects/translations/rails_app/devise.en.po --language en \
         --output ~/projects/rails_app/config/locales/devise.en.yml

4) Translation convertation from iOS to Android format:
i18n-po --input   ~/projects/ios_app/Localizable.strings \
         --output ~/projects/android_app/en/strings.xml

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request