@@ -16,15 +16,19 @@ Because of the above, it's possible to silence each alert indempendly. These
1616scripts will output ` --add-ignore ` commands that, if executed, will omit the
1717specific alerts in future executions.
1818
19- ## First execution
19+ ## broken.php
2020
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.
21+ ` doc-base/scripts/broken.php ` will test if individual XML files are
22+ ill-formed. That is, if a file contains Unicode BOM, carriage returns (CR),
23+ or if XML contents are not
24+ [ well-balanced] ( https://www.w3.org/TR/xml-fragment/#defn-well-balanced ) .
25+
26+ Unbalanced XML contents are invalid XML and will result in a broken build.
27+ BOM and CR marks may not result in broken builds, but * will* cause several
28+ tools below to misbehave, as ` libxml ` behaviour changes if XML text contains
29+ these bytes.
2630
27- ## qaxml-attributes.php (structural)
31+ ## qaxml-attributes.php
2832
2933` doc-base/scripts/translation/qaxml-attributes.php ` checks if all translated
3034files have the same tag-attribute-value triplets. Tag's attributes are
@@ -35,7 +39,7 @@ This script accepts an `--urgent` option, to filter alerts related to `xml:id`
3539attributes. This will help translators on languages that are failing to build,
3640to focus on mismatches that are probably most related with build fails.
3741
38- ## qaxml-entities.php (structural)
42+ ## qaxml-entities.php
3943
4044` doc-base/scripts/translation/qaxml-entities.php ` checks if all translated
4145files contain the same XML Entities References as the original files.
@@ -55,15 +59,99 @@ entities when generating alerts. This is handy in languages that use some
5559` &zb; ` and ` &dh; ` entities, and could run with ` -zb -dh ` to avoid generating
5660alerts for these entities' differences.
5761
58- ## Old tools (below)
62+ ## qaxml-pi.php
63+
64+ ` doc-base/scripts/translation/qaxml-pi.php ` checks if all translated files have
65+ the same processing instructions (PI) as the original files. Unbalanced PIs may
66+ cause compilation errors, as they are utilized in the manual build process.
67+
68+ ## qaxml-tags.php
69+
70+ ` doc-base/scripts/translation/qaxml-tags.php ` checks if all translated files
71+ have the same tags as the original files. Different number of tags between
72+ source texts and translations indicated mismatched translated texts, and may
73+ cause compilation errors
74+
75+ This script accepts an ` --detail ` option, that will print lines of each
76+ mismatched tag, to facilitate the work on big files.
77+
78+ This script also accepts an ` --content= ` option, that will check the
79+ * contents* of tags, to inspect tags where the contents are expected * not* to
80+ be translated. Example below.
81+
82+ ## qaxml-ws.php
83+
84+ ` doc-base/scripts/translation/qaxml-ws.php ` inspect whitespace usage inside
85+ some known tags. Spurious whitespace may break manual linking or generate
86+ visible artifacts.
87+
88+ ## qaxml-revtag.php
89+
90+ ` doc-base/scripts/translation/qaxml-revtag.php ` checks if all translated
91+ files have valid [ revision tags] ( https://doc.php.net/guide/translating.md ) .
92+ Files without revision tags in expected format will fail to generate pretty
93+ diffs on [ Translation status] ( https://doc.php.net/revcheck.php ) website or
94+ locally generated ` revcheck.php ` status pages.
95+
96+ ## Suggested execution
97+
98+ The first execution of these scripts may generate an inordinate amount of
99+ alerts. It's advised to initially run each command separately, and work the
100+ alerts on a case by case basis. After all interesting cases are fixed,
101+ it's possible to rerun the command and ` grep ` the output for ` --add-ignore `
102+ lines, run these commands, and by so, mass ignore the residual alerts.
103+
104+ Structural checks:
105+
106+ ```
107+ php doc-base/scripts/broken.php
108+ php doc-base/scripts/translation/qaxml-revtag.php
109+
110+ php doc-base/scripts/translation/qaxml-attributes.php
111+ php doc-base/scripts/translation/qaxml-entities.php
112+ php doc-base/scripts/translation/qaxml-pi.php
113+ php doc-base/scripts/translation/qaxml-tags.php --detail
114+ php doc-base/scripts/translation/qaxml-ws.php
115+ ```
59116
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.
117+ Tags where is expected no translations:
118+
119+ ```
120+ php doc-base/scripts/translation/qaxml-tags.php --content=acronym
121+ php doc-base/scripts/translation/qaxml-tags.php --content=classname
122+ php doc-base/scripts/translation/qaxml-tags.php --content=constant
123+ php doc-base/scripts/translation/qaxml-tags.php --content=envar
124+ php doc-base/scripts/translation/qaxml-tags.php --content=function
125+ php doc-base/scripts/translation/qaxml-tags.php --content=interfacename
126+ php doc-base/scripts/translation/qaxml-tags.php --content=parameter
127+ php doc-base/scripts/translation/qaxml-tags.php --content=type
128+ php doc-base/scripts/translation/qaxml-tags.php --content=classsynopsis
129+ php doc-base/scripts/translation/qaxml-tags.php --content=constructorsynopsis
130+ php doc-base/scripts/translation/qaxml-tags.php --content=destructorsynopsis
131+ php doc-base/scripts/translation/qaxml-tags.php --content=fieldsynopsis
132+ php doc-base/scripts/translation/qaxml-tags.php --content=funcsynopsis
133+ php doc-base/scripts/translation/qaxml-tags.php --content=methodsynopsis
134+ ```
135+
136+ Tags where is expected few translations:
137+
138+ ```
139+ php doc-base/scripts/translation/qaxml-tags.php --content=code
140+ php doc-base/scripts/translation/qaxml-tags.php --content=computeroutput
141+ php doc-base/scripts/translation/qaxml-tags.php --content=filename
142+ php doc-base/scripts/translation/qaxml-tags.php --content=literal
143+ php doc-base/scripts/translation/qaxml-tags.php --content=varname
144+ ```
63145
64146---
65147
66- Before using the old scripts, they need be configured:
148+ ## Old tools (below)
149+
150+ Document below is the previous version of these tools. These tools are
151+ deprecated, and scheduled for remotion very soon.
152+
153+
154+ These old tools needed to be separated configured, before use:
67155```
68156php doc-base/scripts/translation/configure.php $LANG_DIR
69157```
@@ -107,44 +195,3 @@ contents, as some tag contents are expected *not* be translated.
107195
108196` --detail ` will also print line definitions of each mismatched tag,
109197to facilitate bitsecting.
110-
111- ## Suggested execution
112-
113- Structural checks:
114-
115- ```
116- php doc-base/scripts/translation/configure.php $LANG_DIR
117-
118- php doc-base/scripts/translation/qarvt.php
119-
120- php doc-base/scripts/translation/qaxml.a.php
121- php doc-base/scripts/translation/qaxml.e.php
122- php doc-base/scripts/translation/qaxml.p.php
123- php doc-base/scripts/translation/qaxml.t.php
124- php doc-base/scripts/translation/qaxml.w.php
125- ```
126- Tags where is expected no translations:
127- ```
128- php doc-base/scripts/translation/qaxml.t.php acronym
129- php doc-base/scripts/translation/qaxml.t.php classname
130- php doc-base/scripts/translation/qaxml.t.php constant
131- php doc-base/scripts/translation/qaxml.t.php envar
132- php doc-base/scripts/translation/qaxml.t.php function
133- php doc-base/scripts/translation/qaxml.t.php interfacename
134- php doc-base/scripts/translation/qaxml.t.php parameter
135- php doc-base/scripts/translation/qaxml.t.php type
136- php doc-base/scripts/translation/qaxml.t.php classsynopsis
137- php doc-base/scripts/translation/qaxml.t.php constructorsynopsis
138- php doc-base/scripts/translation/qaxml.t.php destructorsynopsis
139- php doc-base/scripts/translation/qaxml.t.php fieldsynopsis
140- php doc-base/scripts/translation/qaxml.t.php funcsynopsis
141- php doc-base/scripts/translation/qaxml.t.php methodsynopsis
142- ```
143- Tags where is expected few translations:
144- ```
145- php doc-base/scripts/translation/qaxml.t.php code
146- php doc-base/scripts/translation/qaxml.t.php computeroutput
147- php doc-base/scripts/translation/qaxml.t.php filename
148- php doc-base/scripts/translation/qaxml.t.php literal
149- php doc-base/scripts/translation/qaxml.t.php varname
150- ```
0 commit comments