项目作者: michiel

项目描述 :
ember-cli task to generate POT file from YAML and YAML files from PO files
高级语言: JavaScript
项目地址: git://github.com/michiel/ember-cli-generate-translations.git
创建时间: 2016-12-02T12:54:11Z
项目社区:https://github.com/michiel/ember-cli-generate-translations

开源协议:MIT License

下载


ember-cli-generate-translations

Ember Observer Score
Travis CI Score

This ember-addon generates a POT file for translation from the master YAML file
and imports the translated PO files into YAML language files.

It currently works with ember-intl and expects there to be a configuration for that at config/ember-intl.js

Tasks

It adds three tasks

generate-i18n-dirs

  1. ember generate-i18n-dirs

This task generates the i18n-data/ directory and its po and pot subdirectories.

generate-i18n-pot

  1. ember generate-i18n-pot

This task takes the master YAML file and converts it to a POT file in i18n-data/pot/app.pot.

generate-i18n-yaml

  1. ember generate-i18n-dirs

This task takes the PO files in i18n-data/po/ and converts each of the into the corresponding YAML file. So i18n-data/po/nl-nl.po is transformed to translations/nl-nl.yaml.

Filesystem layout

In the translations directory, here en-us.yaml is the master file and is specified in config/ember-intl.js as baseLocale : ‘en-us’.

  1. translations/
  2. ├── en-us.yaml
  3. ├── nl-nl.yaml
  4. ├── en-gb.yaml
  5. └── es-es.yaml
  6. i18n-data/
  7. ├── po
  8. ├── nl-nl.po
  9. ├── en-gb.po
  10. └── es-es.po
  11. └── pot
  12. └── app.pot

Installation

  1. ember install ember-cli-generate-translations