|
| 1 | +# Some useful scripts for maintaining translation consistency of manual |
| 2 | + |
| 3 | +Some of these scripts only test some file contents or XML structure |
| 4 | +of translated files against their equivalents on `en/` directory. |
| 5 | +Others will try modify the translations in place, changing the |
| 6 | +translated files. Use with care. |
| 7 | + |
| 8 | +Not all translations are identical, or use the same conventions. |
| 9 | +So not all scripts will be of use for all translations. The |
| 10 | +assumptions of each script are described in each file. |
| 11 | + |
| 12 | +The `lib/` directory contains common code and functionality |
| 13 | +across these scripts. |
| 14 | + |
| 15 | +Before using the scripts, it need be configured: |
| 16 | +``` |
| 17 | +php doc-base/scripts/translation/configure.php $LANG_DIR |
| 18 | +``` |
| 19 | + |
| 20 | +## qarvt.php |
| 21 | + |
| 22 | +`qarvt.a.php` checks if all translated files have revtags in the |
| 23 | +expected format. |
| 24 | + |
| 25 | +## qaxml.a.php |
| 26 | + |
| 27 | +`qaxml.a.php` checks if all updated translated files have |
| 28 | +the same tag-attribute-value triples. Tag's attributes are extensively |
| 29 | +utilized in manual for linking and XIncluding. Translated files with |
| 30 | +missing os mistyped attributes may cause build failing or missing |
| 31 | +parts not copied by XIncludes. |
| 32 | + |
| 33 | +## qaxml.e.php |
| 34 | + |
| 35 | +`qaxml.e.php` checks if all updated translated files have |
| 36 | +the same external entities as the original files. Unbalanced entities |
| 37 | +may indicate mistyped or wrongly traduced parts. |
| 38 | + |
| 39 | +## qaxml.p.php |
| 40 | + |
| 41 | +`qaxml.p.php` checks if all updated translated files have |
| 42 | +the same processing instructions as the original files. Unbalanced entities |
| 43 | +may cause compilation errors, as they are utilized on manual in the build |
| 44 | +process. |
| 45 | + |
| 46 | +## qaxml.t.php |
| 47 | + |
| 48 | +`qaxml.t.php` checks if all updated translated files have |
| 49 | +the same tags as the original files. Different number of tags between |
| 50 | +source texts and target translations may cause compilation errors. |
| 51 | + |
| 52 | +Usage: `php qaxml.t.php [--detail] [tag[,tag]]` |
| 53 | + |
| 54 | +`[tag[,tag]]` is a comma separated tag list to check their |
| 55 | +contents, as some tag's contents are expected *not* be translated. |
| 56 | + |
| 57 | +`--detail` will also print line defintions of each mismatched tag, |
| 58 | +to facilitate bitsecting. |
| 59 | + |
| 60 | +## Suggested execution |
| 61 | + |
| 62 | +Structural checks: |
| 63 | + |
| 64 | +``` |
| 65 | +php doc-base/scripts/translation/configure.php $LANG_DIR |
| 66 | +
|
| 67 | +php doc-base/scripts/translation/qarvt.php |
| 68 | +
|
| 69 | +php doc-base/scripts/translation/qaxml.a.php |
| 70 | +php doc-base/scripts/translation/qaxml.e.php |
| 71 | +php doc-base/scripts/translation/qaxml.p.php |
| 72 | +php doc-base/scripts/translation/qaxml.t.php |
| 73 | +``` |
| 74 | +Tags where is expected no translations: |
| 75 | +``` |
| 76 | +php doc-base/scripts/translation/qaxml.t.php acronym |
| 77 | +php doc-base/scripts/translation/qaxml.t.php classname |
| 78 | +php doc-base/scripts/translation/qaxml.t.php constant |
| 79 | +php doc-base/scripts/translation/qaxml.t.php envar |
| 80 | +php doc-base/scripts/translation/qaxml.t.php function |
| 81 | +php doc-base/scripts/translation/qaxml.t.php interfacename |
| 82 | +php doc-base/scripts/translation/qaxml.t.php parameter |
| 83 | +php doc-base/scripts/translation/qaxml.t.php type |
| 84 | +php doc-base/scripts/translation/qaxml.t.php classsynopsis |
| 85 | +php doc-base/scripts/translation/qaxml.t.php constructorsynopsis |
| 86 | +php doc-base/scripts/translation/qaxml.t.php destructorsynopsis |
| 87 | +php doc-base/scripts/translation/qaxml.t.php fieldsynopsis |
| 88 | +php doc-base/scripts/translation/qaxml.t.php funcsynopsis |
| 89 | +php doc-base/scripts/translation/qaxml.t.php methodsynopsis |
| 90 | +``` |
| 91 | +Tags where is expected few translations: |
| 92 | +``` |
| 93 | +php doc-base/scripts/translation/qaxml.t.php code |
| 94 | +php doc-base/scripts/translation/qaxml.t.php computeroutput |
| 95 | +php doc-base/scripts/translation/qaxml.t.php filename |
| 96 | +php doc-base/scripts/translation/qaxml.t.php literal |
| 97 | +php doc-base/scripts/translation/qaxml.t.php varname |
| 98 | +``` |
| 99 | + |
| 100 | +# Migration |
| 101 | + |
| 102 | +## Maintainers with spaces |
| 103 | + |
| 104 | +The regex on `RevtagParser` was narrowed to not accept maintainer's names |
| 105 | +with spaces. This need to be confirmed on all active translations, or |
| 106 | +the regex modified to accept spaces again. |
| 107 | + |
| 108 | +## en/chmonly |
| 109 | + |
| 110 | +`en/chmonly` is ignored on revcheck, but it appears translatable. If it's a |
| 111 | +`en/` only directory, this should be uncommented on RevcheckIgnore. |
0 commit comments