mquinson / po4a-website

Source code of https://po4a.org/
GNU General Public License v2.0
5 stars 5 forks source link

Build script fails due to mixed quotes in config file #15

Closed gemmaro closed 11 months ago

gemmaro commented 11 months ago

Hello,

Running the build script issues an error Simple quote (') matched with double quote (") in src/header.php.en $lang:html/header.php.$lang opt:"-k 0 -o 'nodefault=<a> <span>'" at ../po4a/po4a line 881, <CONFIG> line 10. with the po4a at the revision https://github.com/mquinson/po4a/commit/c9f5cf97ebc6915d7d9c4a90707a98c8cb6ad7a2.

full outputs ```shell-session $ ./01-build-pages.sh XXX Get the latest translations from git Already up to date. XXX Regenerating the documentation because the code is at the same version than the website (0.70-alpha) Created MYMETA.yml and MYMETA.json Creating new 'Build' script for 'po4a' version '0.70' Created META.yml and META.json Convert blib/man/ca/man1/po4a-display-man.1 (online docbook.xsl file). Note: namesp. add : added namespace before processing po4a-display-man Warn: meta author : no refentry/info/author po4a-display-man Note: meta author : see http://www.docbook.org/tdg5/en/html/autho po4a-display-man Warn: meta author : no author data, so inserted a fixme po4a-display-man Note: Writing po4a-display-man.1 Convert blib/man/ca/man1/po4a-display-pod.1 (online docbook.xsl file). Note: namesp. add : added namespace before processing po4a-display-pod Warn: meta author : no refentry/info/author po4a-display-pod Note: meta author : see http://www.docbook.org/tdg5/en/html/autho po4a-display-pod Warn: meta author : no author data, so inserted a fixme po4a-display-pod Note: Writing po4a-display-pod.1 Convert blib/man/de/man1/po4a-display-man.1 (online docbook.xsl file). Note: namesp. add : added namespace before processing po4a-display-man Note: Writing po4a-display-man.1 Convert blib/man/de/man1/po4a-display-pod.1 (online docbook.xsl file). Note: namesp. add : added namespace before processing po4a-display-pod Note: Writing po4a-display-pod.1 Convert blib/man/eo/man1/po4a-display-man.1 (online docbook.xsl file). Note: namesp. add : added namespace before processing po4a-display-man Note: Writing po4a-display-man.1 Convert blib/man/eo/man1/po4a-display-pod.1 (online docbook.xsl file). Note: namesp. add : added namespace before processing po4a-display-pod Note: Writing po4a-display-pod.1 Convert blib/man/es/man1/po4a-display-man.1 (online docbook.xsl file). Note: namesp. add : added namespace before processing po4a-display-man Note: Writing po4a-display-man.1 Convert blib/man/es/man1/po4a-display-pod.1 (online docbook.xsl file). Note: namesp. add : added namespace before processing po4a-display-pod Note: Writing po4a-display-pod.1 Convert blib/man/fr/man1/po4a-display-man.1 (online docbook.xsl file). Note: namesp. add : added namespace before processing po4a-display-man Note: Writing po4a-display-man.1 Convert blib/man/fr/man1/po4a-display-pod.1 (online docbook.xsl file). Note: namesp. add : added namespace before processing po4a-display-pod Note: Writing po4a-display-pod.1 Convert blib/man/hr/man1/po4a-display-man.1 (online docbook.xsl file). Note: namesp. add : added namespace before processing po4a-display-man Note: Writing po4a-display-man.1 Convert blib/man/hr/man1/po4a-display-pod.1 (online docbook.xsl file). Note: namesp. add : added namespace before processing po4a-display-pod Note: Writing po4a-display-pod.1 Convert blib/man/hu/man1/po4a-display-man.1 (online docbook.xsl file). Note: namesp. add : added namespace before processing po4a-display-man Warn: meta author : no refentry/info/author po4a-display-man Note: meta author : see http://www.docbook.org/tdg5/en/html/autho po4a-display-man Warn: meta author : no author data, so inserted a fixme po4a-display-man Note: Writing po4a-display-man.1 Convert blib/man/hu/man1/po4a-display-pod.1 (online docbook.xsl file). Note: namesp. add : added namespace before processing po4a-display-pod Warn: meta author : no refentry/info/author po4a-display-pod Note: meta author : see http://www.docbook.org/tdg5/en/html/autho po4a-display-pod Warn: meta author : no author data, so inserted a fixme po4a-display-pod Note: Writing po4a-display-pod.1 Convert blib/man/it/man1/po4a-display-man.1 (online docbook.xsl file). Note: namesp. add : added namespace before processing po4a-display-man Note: Writing po4a-display-man.1 Convert blib/man/it/man1/po4a-display-pod.1 (online docbook.xsl file). Note: namesp. add : added namespace before processing po4a-display-pod Note: Writing po4a-display-pod.1 Convert blib/man/ja/man1/po4a-display-man.1 (online docbook.xsl file). Note: namesp. add : added namespace before processing po4a-display-man Note: Writing po4a-display-man.1 Convert blib/man/ja/man1/po4a-display-pod.1 (online docbook.xsl file). Note: namesp. add : added namespace before processing po4a-display-pod Note: Writing po4a-display-pod.1 Convert blib/man/man1/po4a-display-man.1 (online docbook.xsl file). Note: namesp. add : added namespace before processing po4a-display-man Note: Writing po4a-display-man.1 Convert blib/man/man1/po4a-display-pod.1 (online docbook.xsl file). Note: namesp. add : added namespace before processing po4a-display-pod Note: Writing po4a-display-pod.1 Convert blib/man/nb/man1/po4a-display-man.1 (online docbook.xsl file). Note: namesp. add : added namespace before processing po4a-display-man Warn: meta author : no refentry/info/author po4a-display-man Note: meta author : see http://www.docbook.org/tdg5/en/html/autho po4a-display-man Warn: meta author : no author data, so inserted a fixme po4a-display-man Note: Writing po4a-display-man.1 Convert blib/man/nb/man1/po4a-display-pod.1 (online docbook.xsl file). Note: namesp. add : added namespace before processing po4a-display-pod Warn: meta author : no refentry/info/author po4a-display-pod Note: meta author : see http://www.docbook.org/tdg5/en/html/autho po4a-display-pod Warn: meta author : no author data, so inserted a fixme po4a-display-pod Note: Writing po4a-display-pod.1 Convert blib/man/nl/man1/po4a-display-man.1 (online docbook.xsl file). Note: namesp. add : added namespace before processing po4a-display-man Note: Writing po4a-display-man.1 Convert blib/man/nl/man1/po4a-display-pod.1 (online docbook.xsl file). Note: namesp. add : added namespace before processing po4a-display-pod Note: Writing po4a-display-pod.1 Convert blib/man/pl/man1/po4a-display-man.1 (online docbook.xsl file). Note: namesp. add : added namespace before processing po4a-display-man Note: Writing po4a-display-man.1 Convert blib/man/pl/man1/po4a-display-pod.1 (online docbook.xsl file). Note: namesp. add : added namespace before processing po4a-display-pod Note: Writing po4a-display-pod.1 Convert blib/man/pt/man1/po4a-display-man.1 (online docbook.xsl file). Note: namesp. add : added namespace before processing po4a-display-man Note: Writing po4a-display-man.1 Convert blib/man/pt/man1/po4a-display-pod.1 (online docbook.xsl file). Note: namesp. add : added namespace before processing po4a-display-pod Note: Writing po4a-display-pod.1 Convert blib/man/pt_BR/man1/po4a-display-man.1 (online docbook.xsl file). Note: namesp. add : added namespace before processing po4a-display-man Note: Writing po4a-display-man.1 Convert blib/man/pt_BR/man1/po4a-display-pod.1 (online docbook.xsl file). Note: namesp. add : added namespace before processing po4a-display-pod Note: Writing po4a-display-pod.1 Convert blib/man/ru/man1/po4a-display-man.1 (online docbook.xsl file). Note: namesp. add : added namespace before processing po4a-display-man Note: Writing po4a-display-man.1 Convert blib/man/ru/man1/po4a-display-pod.1 (online docbook.xsl file). Note: namesp. add : added namespace before processing po4a-display-pod Note: Writing po4a-display-pod.1 Convert blib/man/sr_Cyrl/man1/po4a-display-man.1 (online docbook.xsl file). Note: namesp. add : added namespace before processing po4a-display-man Note: Writing po4a-display-man.1 Convert blib/man/sr_Cyrl/man1/po4a-display-pod.1 (online docbook.xsl file). Note: namesp. add : added namespace before processing po4a-display-pod Note: Writing po4a-display-pod.1 Convert blib/man/uk/man1/po4a-display-man.1 (online docbook.xsl file). Note: namesp. add : added namespace before processing po4a-display-man Note: Writing po4a-display-man.1 Convert blib/man/uk/man1/po4a-display-pod.1 (online docbook.xsl file). Note: namesp. add : added namespace before processing po4a-display-pod Note: Writing po4a-display-pod.1 Convert blib/man/zh_CHS/man1/po4a-display-man.1 (online docbook.xsl file). Note: namesp. add : added namespace before processing po4a-display-man Note: Writing po4a-display-man.1 Convert blib/man/zh_CHS/man1/po4a-display-pod.1 (online docbook.xsl file). Note: namesp. add : added namespace before processing po4a-display-pod Note: Writing po4a-display-pod.1 Convert blib/man/zh_Hant/man1/po4a-display-man.1 (online docbook.xsl file). Note: namesp. add : added namespace before processing po4a-display-man Note: Writing po4a-display-man.1 Convert blib/man/zh_Hant/man1/po4a-display-pod.1 (online docbook.xsl file). Note: namesp. add : added namespace before processing po4a-display-pod Note: Writing po4a-display-pod.1 XX po/bin/po4a.pot uptodate. ------------- po/bin (pot: 36210) ace (2.35%): po/bin/ace.po:6: warning: header field 'PO-Revision-Date' still has the initial default value 0 translated messages, 249 untranslated messages. af (7.63%): 19 translated messages, 41 fuzzy translations, 189 untranslated messages. ar (14.05%): 35 translated messages, 18 fuzzy translations, 196 untranslated messages. ca (45.38%): 113 translated messages, 48 fuzzy translations, 88 untranslated messages. cs (57.83%): 144 translated messages, 50 fuzzy translations, 55 untranslated messages. da (62.23%): 145 translated messages, 51 fuzzy translations, 37 untranslated messages. de (100%): 249 translated messages. eo (96.78%): 241 translated messages, 2 fuzzy translations, 6 untranslated messages. es (94.77%): 236 translated messages, 13 untranslated messages. et (67.87%): 169 translated messages, 33 fuzzy translations, 47 untranslated messages. eu (56.62%): 141 translated messages, 52 fuzzy translations, 56 untranslated messages. fr (100%): 249 translated messages. hr (94.77%): 236 translated messages, 13 untranslated messages. hu (92.77%): 231 translated messages, 3 fuzzy translations, 15 untranslated messages. id (77.91%): 194 translated messages, 21 fuzzy translations, 34 untranslated messages. it (100%): 249 translated messages. ja (100%): 249 translated messages. ka (16.46%): 41 translated messages, 208 untranslated messages. kn (7.63%): 19 translated messages, 51 fuzzy translations, 179 untranslated messages. ko (18.87%): 47 translated messages, 35 fuzzy translations, 167 untranslated messages. nb (97.18%): 242 translated messages, 1 fuzzy translation, 6 untranslated messages. nl (100%): 249 translated messages. pl (62.24%): 155 translated messages, 47 fuzzy translations, 47 untranslated messages. pt (100%): 249 translated messages. pt_BR (100%): 249 translated messages. ru (93.57%): 233 translated messages, 2 fuzzy translations, 14 untranslated messages. sl (56.22%): 140 translated messages, 53 fuzzy translations, 56 untranslated messages. sr_Cyrl (100%): 249 translated messages. sv (72.28%): 180 translated messages, 19 fuzzy translations, 50 untranslated messages. uk (100%): 249 translated messages. vi (67.46%): 168 translated messages, 34 fuzzy translations, 47 untranslated messages. zh_CN (94.77%): 236 translated messages, 13 untranslated messages. zh_HK (3.21%): 8 translated messages, 38 fuzzy translations, 203 untranslated messages. zh_Hant (94.77%): 236 translated messages, 13 untranslated messages. po/bin (pot: 36210) 9 languages = 100%: de, fr, it, ja, nl, pt, pt_BR, sr_Cyrl, uk. 2 languages >= 95%: eo (96%), nb (97%). 6 languages >= 90%: es (94%), hr (94%), hu (92%), ru (93%), zh_CN (94%), zh_Hant (94%). 2 languages >= 70%: id (77%), sv (72%). 7 languages >= 50%: cs (57%), da (62%), et (67%), eu (56%), pl (62%), sl (56%), vi (67%). 1 language >= 33%: ca (45%). 7 starting languages: ace (2%), af (7%), ar (14%), ka (16%), kn (7%), ko (18%), zh_HK (3%). ------------- po/pod (pot: 284167) ca (43.62%): 619 translated messages, 233 fuzzy translations, 567 untranslated messages. de (99.92%): 1418 translated messages, 1 untranslated message. eo (2.81%): 40 translated messages, 1379 untranslated messages. es (83.08%): 1179 translated messages, 111 fuzzy translations, 129 untranslated messages. fr (100%): 1419 translated messages. hr (0.28%): 4 translated messages, 1415 untranslated messages. hu (0.7%): 10 translated messages, 7 fuzzy translations, 1402 untranslated messages. it (100%): 1419 translated messages. ja (99.92%): 1418 translated messages, 1 fuzzy translation. nb (4.08%): 58 translated messages, 2 fuzzy translations, 1359 untranslated messages. nl (99.64%): 1414 translated messages, 5 untranslated messages. pl (66.17%): 939 translated messages, 179 fuzzy translations, 301 untranslated messages. pt (94.5%): 1341 translated messages, 43 fuzzy translations, 35 untranslated messages. pt_BR (94.5%): 1341 translated messages, 43 fuzzy translations, 35 untranslated messages. ru (64.55%): 916 translated messages, 59 fuzzy translations, 444 untranslated messages. sr_Cyrl (99.57%): 1413 translated messages, 6 untranslated messages. uk (100%): 1419 translated messages. zh_CHS (94.08%): 1335 translated messages, 41 fuzzy translations, 43 untranslated messages. zh_Hant (94%): 1334 translated messages, 41 fuzzy translations, 44 untranslated messages. po/pod (pot: 284167) 3 languages = 100%: fr, it, uk. 4 languages >= 95%: de (99%), ja (99%), nl (99%), sr_Cyrl (99%). 4 languages >= 90%: pt (94%), pt_BR (94%), zh_CHS (94%), zh_Hant (94%). 1 language >= 80%: es (83%). 2 languages >= 50%: pl (66%), ru (64%). 1 language >= 33%: ca (43%). 4 starting languages: eo (2%), hr (0%), hu (0%), nb (4%). ------------- ../po4a-website/po (pot: 18367) de (100%): 102 translated messages. eo (91.17%): 93 translated messages, 8 fuzzy translations, 1 untranslated message. es (100%): 102 translated messages. fr (95.09%): 97 translated messages, 5 fuzzy translations. hr (97.05%): 99 translated messages, 3 fuzzy translations. hu (87.25%): 89 translated messages, 12 fuzzy translations, 1 untranslated message. it (100%): 102 translated messages. ja (100%): 102 translated messages. nb_NO (91.17%): 93 translated messages, 8 fuzzy translations, 1 untranslated message. nl (100%): 102 translated messages. pl (45.09%): 46 translated messages, 35 fuzzy translations, 21 untranslated messages. pt (95.09%): 97 translated messages, 5 fuzzy translations. pt_BR (95.09%): 97 translated messages, 5 fuzzy translations. ru (99.01%): 101 translated messages, 1 fuzzy translation. sr_Cyrl (100%): 102 translated messages. uk (100%): 102 translated messages. zh_CN (91.17%): 93 translated messages, 8 fuzzy translations, 1 untranslated message. zh_Hant (91.17%): 93 translated messages, 8 fuzzy translations, 1 untranslated message. ../po4a-website/po (pot: 18367) 7 languages = 100%: de, es, it, ja, nl, sr_Cyrl, uk. 5 languages >= 95%: fr (95%), hr (97%), pt (95%), pt_BR (95%), ru (99%). 4 languages >= 90%: eo (91%), nb_NO (91%), zh_CN (91%), zh_Hant (91%). 1 language >= 80%: hu (87%). 1 language >= 33%: pl (45%). XXX Generate the web pages translations with po4a Using '/home/gemmaro/src/po4a-website/po/www' as a po_directory. Found language 'de' in the provided po_directory: po/www/de.po Found language 'eo' in the provided po_directory: po/www/eo.po Found language 'es' in the provided po_directory: po/www/es.po Found language 'fr' in the provided po_directory: po/www/fr.po Found language 'hr' in the provided po_directory: po/www/hr.po Found language 'hu' in the provided po_directory: po/www/hu.po Found language 'it' in the provided po_directory: po/www/it.po Found language 'ja' in the provided po_directory: po/www/ja.po Found language 'nb_NO' in the provided po_directory: po/www/nb_NO.po Found language 'nl' in the provided po_directory: po/www/nl.po Found language 'pl' in the provided po_directory: po/www/pl.po Found POT file 'po/www/po4a-www.pot' in the provided po_directory. Found language 'pt' in the provided po_directory: po/www/pt.po Found language 'pt_BR' in the provided po_directory: po/www/pt_BR.po Found language 'ru' in the provided po_directory: po/www/ru.po Found language 'sr_Cyrl' in the provided po_directory: po/www/sr_Cyrl.po Found language 'uk' in the provided po_directory: po/www/uk.po Found language 'zh_CN' in the provided po_directory: po/www/zh_CN.po Found language 'zh_Hant' in the provided po_directory: po/www/zh_Hant.po Simple quote (') matched with double quote (") in src/header.php.en $lang:html/header.php.$lang opt:"-k 0 -o 'nodefault= '" at ../po4a/po4a line 881, line 10. ```

I noticed that po4a doesn't handle mixed quotes in a config file yet as in the split_line subroutine, so the following might fix this problem:

diff --git a/po/html.cfg b/po/html.cfg
index 102bbed..6a36807 100644
--- a/po/html.cfg
+++ b/po/html.cfg
@@ -7,5 +7,5 @@
 [type: xhtml] src/download.php.en      $lang:html/download.php.$lang
 [type: xhtml] src/getinvolved.php.en   $lang:html/getinvolved.php.$lang
 [type: xhtml] src/header.php.en        $lang:html/header.php.$lang  \
-              opt:"-k 0 -o 'nodefault=<a> <span>'"
+              opt:"-k 0 -o nodefault=<a>\ <span>"

The other solution is to update the split_line subroutine so that it can handle this mixed quotes case.

Regards, gemmaro.