From 1fe7e63a2427ab306a12019694b4044717330403 Mon Sep 17 00:00:00 2001 From: Ben Webb Date: Wed, 7 Aug 2019 17:11:55 +0100 Subject: [PATCH] [#58] Add instructions for generating svg.pot --- .tx/config | 7 +++++++ README.md | 5 +++++ requirements.txt | 2 +- svg-its-rules.xml | 9 +++++++++ 4 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 svg-its-rules.xml diff --git a/.tx/config b/.tx/config index 7d580085..400d92b3 100644 --- a/.tx/config +++ b/.tx/config @@ -13,6 +13,13 @@ source_file = docs/_build/gettext/codelist.pot source_lang = en type = PO +[bods-v02.svg] +file_filter = docs/locale//LC_MESSAGES/svg.po +source_file = docs/_build/gettext/svg.pot +source_lang = en +type = PO + + [bods-v02.index] file_filter = docs/locale//LC_MESSAGES/index.po source_file = docs/_build/gettext/index.pot diff --git a/README.md b/README.md index e30e3e3b..69d2a33e 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,7 @@ You also need to make sure you have `gettext` and `pybabel` installed in whateve ``` $ apt-get install gettext $ apt-get install python-babel +$ apt-get install itstool ``` And you need to get a [Transifex API key](https://www.transifex.com/user/settings/api/), make sure you have access to the [BODS project on Transifex](https://www.transifex.com/OpenDataServices/bods-v01) @@ -72,6 +73,10 @@ Run the following commands from the root directory unless otherwise specified (e 1. Run `pybabel extract -F babel_bods_codelist.cfg . -o docs/_build/gettext/codelist.pot` to extract translatable English strings from the codelists. +**If you modified an SVG diagram** also: + +1. Run `itstool -i svg-its-rules.xml -o docs/_build/gettext/svg.pot docs/_assets/*.svg` to extract translatable English strings from the SVGs. + **If you added, deleted or renamed** files or you want to use a **different Transifex project**, run (from root, ie. `cd ../`): ``` diff --git a/requirements.txt b/requirements.txt index ac188e76..7b5c7547 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ sphinx-intl==0.9.11 -transifex-client==0.13.5 +transifex-client==0.13.6 sphinx-rtd-theme==0.4.2 CommonMark==0.7.5 -e git+https://github.com/rtfd/recommonmark.git@450909bdcf4c5eafde7c89696006530ba7cc78de#egg=recommonmark diff --git a/svg-its-rules.xml b/svg-its-rules.xml new file mode 100644 index 00000000..22e3fb18 --- /dev/null +++ b/svg-its-rules.xml @@ -0,0 +1,9 @@ + + + + +