Skip to content

Commit

Permalink
[#58] Add instructions for generating svg.pot
Browse files Browse the repository at this point in the history
  • Loading branch information
Bjwebb committed Aug 7, 2019
1 parent eb31237 commit 1fe7e63
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .tx/config
Expand Up @@ -13,6 +13,13 @@ source_file = docs/_build/gettext/codelist.pot
source_lang = en
type = PO

[bods-v02.svg]
file_filter = docs/locale/<lang>/LC_MESSAGES/svg.po
source_file = docs/_build/gettext/svg.pot
source_lang = en
type = PO


[bods-v02.index]
file_filter = docs/locale/<lang>/LC_MESSAGES/index.po
source_file = docs/_build/gettext/index.pot
Expand Down
5 changes: 5 additions & 0 deletions README.md
Expand Up @@ -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)
Expand All @@ -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 ../`):

```
Expand Down
2 changes: 1 addition & 1 deletion 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
Expand Down
9 changes: 9 additions & 0 deletions svg-its-rules.xml
@@ -0,0 +1,9 @@
<!-- Based on example its-rules.xml at https://www.w3.org/TR/SVGTiny12/i18n.html#SVGi18nl10nmarkup -->
<its:rules xmlns:its="http://www.w3.org/2005/11/its" version="1.0"
xmlns:svg="http://www.w3.org/2000/svg">
<its:translateRule selector="//svg:*" translate="no"/>
<its:translateRule selector="//svg:text | //svg:tspan | //svg:textArea |
//svg:title | //svg:desc | //svg:metadata |
//svg:flowPara"
translate="yes"/>
</its:rules>

0 comments on commit 1fe7e63

Please sign in to comment.