|
| 1 | +# Scripts to check consistency of manual translations |
1 | 2 |
|
2 |
| -# Useful scripts for maintaining translation consistency of manual |
| 3 | +After a normal `doc-base/configure.php --with-lang=$LANG`, it is possible to |
| 4 | +run the command line tools below to check translated source files |
| 5 | +for inconsistencies. These tools check for structural differences |
| 6 | +that may cause translation build failures or non-validating DocBook XML |
| 7 | +results, and fixing these issues will help avoid build failures. |
3 | 8 |
|
4 |
| -Some of these scripts only test some file contents or XML structure |
5 |
| -of translated files against their equivalents on `en/` directory. |
6 |
| -Others will try to modify the translations in place, changing the |
7 |
| -translated files. Use with care. |
| 9 | +Some checks are less structural, and as not all translations are identical, |
| 10 | +or use the same conventions, they may not be entirely applicable in all |
| 11 | +languages. Even two translators working on one language may have different |
| 12 | +opinions on how much synchronization is wanted, so not all scripts will be of |
| 13 | +use for all translations. |
8 | 14 |
|
9 |
| -Not all translations are identical, or use the same conventions. |
10 |
| -Even two translators working on one language may havedifferent |
11 |
| -opinions on how much synchronization is wanted. So not all scripts |
12 |
| -will be of use for all translations. |
| 15 | +Because of the above, it's possible to silence each alert indempendly. These |
| 16 | +scripts will output `--add-ignore` commands that, if executed, will omit the |
| 17 | +specific alerts in future executions. |
13 | 18 |
|
14 |
| -Because of aboce, it's possible to silence each alert indempendly. |
15 |
| -These scripts will output `--add-ignore` commands that, if executed, |
16 |
| -will omit the specific warming in future executions. |
| 19 | +## First execution |
17 | 20 |
|
18 |
| -The `lib/` directory contains common code and functionality |
19 |
| -across these scripts. |
| 21 | +The first execution of these scripts may generate an inordinate amount of |
| 22 | +alerts. It's advised to initially run each command separately, and work the |
| 23 | +alerts on a case by case basis. After all interesting cases are fixed, |
| 24 | +it's possible to rerun the command and `grep` the output for `--add-ignore` |
| 25 | +lines, run these commands, and by so, mass ignore the residual alerts. |
| 26 | + |
| 27 | +## qaxml-attributes.php (structural) |
| 28 | + |
| 29 | +`doc-base/scripts/translation/qaxml-attributes.php` checks if all translated |
| 30 | +files have the same tag-attribute-value triplets. Tag's attributes are |
| 31 | +extensively utilized in manual for linking and XIncludes. Translated files |
| 32 | +with missing or mistyped attributes may cause build failures or missing parts. |
| 33 | + |
| 34 | +This script accepts an `--urgent` option, to filter alerts related to `xml:id` |
| 35 | +attributes. This will help translators on languages that are failing to build, |
| 36 | +to focus on mismatches that are probably most related with build fails. |
| 37 | + |
| 38 | +## qaxml-entities.php (structural) |
| 39 | + |
| 40 | +`doc-base/scripts/translation/qaxml-entities.php` checks if all translated |
| 41 | +files contain the same XML Entities References as the original files. |
| 42 | +Unbalanced entities may indicate mistyped or wrongly translated parts. This |
| 43 | +is problematic because some of these entities are "file |
| 44 | +entities", that is, entities that include entire files and even directories, |
| 45 | +so missing or misplaced file entity references almost always cause build |
| 46 | +failures. |
| 47 | + |
| 48 | +This script accepts an `--urgent` option, to filter alerts related to file |
| 49 | +entities. This will help translators on languages that are failing to build, |
| 50 | +to focus on mismatches that are probably most related with build fails. |
| 51 | + |
| 52 | +This script also accepts `-entity` options that will ignore the informed |
| 53 | +entities when generating alerts. This is handy in languages that use some |
| 54 | +"leaf" entities differently than `doc-en`. For example, `doc-de` uses a lot of |
| 55 | +`&zb;` and `&dh;` entities, and could run with `-zb -dh` to avoid generating |
| 56 | +alerts for these entities' differences. |
20 | 57 |
|
21 |
| -Before using the scripts, it need be configured: |
| 58 | +## Old tools (below) |
| 59 | + |
| 60 | +The tools on `doc-base/scripts/translation/` are slowly being rewritten. While |
| 61 | +this effort is not complete, the previous tools, document below, could be used |
| 62 | +to supply for features yet not completed. |
| 63 | + |
| 64 | +--- |
| 65 | + |
| 66 | +Before using the old scripts, they need be configured: |
22 | 67 | ```
|
23 | 68 | php doc-base/scripts/translation/configure.php $LANG_DIR
|
24 | 69 | ```
|
@@ -103,12 +148,3 @@ php doc-base/scripts/translation/qaxml.t.php filename
|
103 | 148 | php doc-base/scripts/translation/qaxml.t.php literal
|
104 | 149 | php doc-base/scripts/translation/qaxml.t.php varname
|
105 | 150 | ```
|
106 |
| - |
107 |
| -## Initial alerts execution |
108 |
| - |
109 |
| -The first execution of these scripts may generate an inordinate amount of |
110 |
| -alerts. It's advised to initially run each command separately, and work the |
111 |
| -alerts on a case by case basis. After all interesting cases are observed, |
112 |
| -it's possible to rerun the command, and `grep` the output for `--add-ignore` |
113 |
| -lines, and to mass ignore the residual alerts. |
114 |
| - |
|
0 commit comments