Improve translation file conversion using "make gettext-to-json"

parent 1ae85882
......@@ -14,6 +14,7 @@ in progress
- Add translation into Japanese from the community. Thanks!
- Add missing Japanese translation for Google poster using Google Translate ;]
- Complete package.json file
- Improve translation file conversion using ``make gettext-to-json``
2018-01-12 0.1.0
================
......
# Which translation files to convert from
# GNU gettext PO format into i18next JSON format
LANGUAGES = fr en de jp
# Convert single translation file
po-to-json:
@echo
@echo ------------------------
@echo Converting language \"$(lang)\"
@echo ------------------------
I18NEXT_LANG=$(lang) yarn run i18next-po-to-json
# Convert all translation files
gettext-to-json:
./node_modules/.bin/i18next-conv -l fr -s po/fr.po -t json/fr.json
./node_modules/.bin/i18next-conv -l en -s po/en.po -t json/en.json
./node_modules/.bin/i18next-conv -l de -s po/de.po -t json/de.json
$(foreach language,$(LANGUAGES),make po-to-json lang=$(language);)
......@@ -73,6 +73,9 @@ Convert GNU gettext PO files to i18next_ JSON format::
This should convert all ``po/*.po`` files to their
corresponding ``json/*.json`` pendants.
When adding a new translation to the ``po/`` directory,
please also update the ``LANGUAGES`` list in the ``Makefile``.
It uses the `i18next-gettext-converter`_ module under the hood.
.. note::
......
......@@ -21,6 +21,9 @@
"bugs": {
"url": "https://github.com/gafam/gafam-poster-translations/issues"
},
"scripts": {
"i18next-po-to-json": "i18next-conv -l $I18NEXT_LANG -s po/$I18NEXT_LANG.po -t json/$I18NEXT_LANG.json"
},
"devDependencies": {
"i18next-conv": "^6.0.0"
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment