From: Amos Jeffries Date: Thu, 2 Jun 2011 10:39:53 +0000 (-0600) Subject: Translation: auto-generate the lists of available translation files X-Git-Tag: take08~55^2~155 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=46002cc15684f393ceefd9d69d33ec7baf8a0283;p=thirdparty%2Fsquid.git Translation: auto-generate the lists of available translation files Use automake includes built during source maintenance and stored in VCS. Avoiding earlier problems encountered with the approaches attempting to bootstrap the translation from within Makefile. This also generates relevant lists for the manual pages. Preparing to translate those automatically as well. --- diff --git a/doc/manuals/Makefile.am b/doc/manuals/Makefile.am index 173243e1b4..95609ddb06 100644 --- a/doc/manuals/Makefile.am +++ b/doc/manuals/Makefile.am @@ -2,4 +2,7 @@ ## None of the .po or .pot are distributed for builds at this stage. ## -EXTRA_DIST = +include $(srcdir)/language.list + +EXTRA_DIST = \ + language.list diff --git a/doc/manuals/language.list b/doc/manuals/language.list new file mode 100644 index 0000000000..9588f60bd8 --- /dev/null +++ b/doc/manuals/language.list @@ -0,0 +1,13 @@ +TRANSLATE_LANGUAGES= \ + ar.lang \ + cs.lang \ + de.lang \ + en.lang \ + en_AU.lang \ + es.lang \ + fr.lang \ + it.lang \ + oc.lang \ + pt.lang \ + ro.lang \ + ru.lang diff --git a/errors/Makefile.am b/errors/Makefile.am index 1c4b35fd43..776ae2dd02 100644 --- a/errors/Makefile.am +++ b/errors/Makefile.am @@ -11,95 +11,14 @@ DEFAULT_ERROR_DIR = $(errordir) DEFAULT_STYLESHEET = $(sysconfdir)/errorpage.css ## List of automated translations possible: -ERROR_TEMPLATES = \ - templates/ERR_ACCESS_DENIED \ - templates/ERR_ACL_TIME_QUOTA_EXCEEDED \ - templates/ERR_CACHE_ACCESS_DENIED \ - templates/ERR_CACHE_MGR_ACCESS_DENIED \ - templates/ERR_CANNOT_FORWARD \ - templates/ERR_CONNECT_FAIL \ - templates/ERR_DIR_LISTING \ - templates/ERR_DNS_FAIL \ - templates/ERR_ESI \ - templates/ERR_FORWARDING_DENIED \ - templates/ERR_FTP_DISABLED \ - templates/ERR_FTP_FAILURE \ - templates/ERR_FTP_FORBIDDEN \ - templates/ERR_FTP_NOT_FOUND \ - templates/ERR_FTP_PUT_CREATED \ - templates/ERR_FTP_PUT_ERROR \ - templates/ERR_FTP_PUT_MODIFIED \ - templates/ERR_FTP_UNAVAILABLE \ - templates/ERR_GATEWAY_FAILURE \ - templates/ERR_ICAP_FAILURE \ - templates/ERR_INVALID_REQ \ - templates/ERR_INVALID_RESP \ - templates/ERR_INVALID_URL \ - templates/ERR_LIFETIME_EXP \ - templates/ERR_NO_RELAY \ - templates/ERR_ONLY_IF_CACHED_MISS \ - templates/ERR_PRECONDITION_FAILED \ - templates/ERR_READ_ERROR \ - templates/ERR_READ_TIMEOUT \ - templates/ERR_SECURE_CONNECT_FAIL \ - templates/ERR_SHUTTING_DOWN \ - templates/ERR_SOCKET_FAILURE \ - templates/ERR_TOO_BIG \ - templates/ERR_UNSUP_HTTPVERSION \ - templates/ERR_UNSUP_REQ \ - templates/ERR_URN_RESOLVE \ - templates/ERR_WRITE_ERROR \ - templates/ERR_ZERO_SIZE_OBJECT - -TRANSLATE_LANGUAGES = \ - af.lang \ - ar.lang \ - az.lang \ - bg.lang \ - ca.lang \ - cs.lang \ - da.lang \ - de.lang \ - el.lang \ - en.lang \ - es.lang \ - et.lang \ - fa.lang \ - fi.lang \ - fr.lang \ - he.lang \ - hu.lang \ - hy.lang \ - id.lang \ - it.lang \ - ja.lang \ - ko.lang \ - lt.lang \ - lv.lang \ - ms.lang \ - nl.lang \ - oc.lang \ - pl.lang \ - pt-br.lang \ - pt.lang \ - ro.lang \ - ru.lang \ - sk.lang \ - sl.lang \ - sr-cyrl.lang \ - sr-latn.lang \ - sv.lang \ - th.lang \ - tr.lang \ - uk.lang \ - uz.lang \ - vi.lang \ - zh-cn.lang \ - zh-tw.lang +include $(srcdir)/template.list +include $(srcdir)/language.list CLEANFILES = $(TRANSLATE_LANGUAGES) translate-warn EXTRA_DIST = \ $(ERROR_TEMPLATES) \ + language.list \ + template.list \ aliases alias-link.sh alias-upgrade errorpage.css TRANSLATORS COPYRIGHT all: all-am diff --git a/errors/language.list b/errors/language.list new file mode 100644 index 0000000000..3366387ac9 --- /dev/null +++ b/errors/language.list @@ -0,0 +1,45 @@ +TRANSLATE_LANGUAGES= \ + af.lang \ + ar.lang \ + az.lang \ + bg.lang \ + ca.lang \ + cs.lang \ + da.lang \ + de.lang \ + el.lang \ + en.lang \ + es.lang \ + et.lang \ + fa.lang \ + fi.lang \ + fr.lang \ + he.lang \ + hu.lang \ + hy.lang \ + id.lang \ + it.lang \ + ja.lang \ + ko.lang \ + lt.lang \ + lv.lang \ + ms.lang \ + nl.lang \ + oc.lang \ + pl.lang \ + pt-br.lang \ + pt.lang \ + ro.lang \ + ru.lang \ + sk.lang \ + sl.lang \ + sr-cyrl.lang \ + sr-latn.lang \ + sv.lang \ + th.lang \ + tr.lang \ + uk.lang \ + uz.lang \ + vi.lang \ + zh-cn.lang \ + zh-tw.lang diff --git a/errors/list b/errors/list deleted file mode 100644 index 67388b4590..0000000000 --- a/errors/list +++ /dev/null @@ -1,36 +0,0 @@ -ERR_ACCESS_DENIED -ERR_CACHE_ACCESS_DENIED -ERR_CACHE_MGR_ACCESS_DENIED -ERR_CANNOT_FORWARD -ERR_CONNECT_FAIL -ERR_DIR_LISTING -ERR_DNS_FAIL -ERR_ESI -ERR_FORWARDING_DENIED -ERR_FTP_DISABLED -ERR_FTP_FAILURE -ERR_FTP_FORBIDDEN -ERR_FTP_NOT_FOUND -ERR_FTP_PUT_CREATED -ERR_FTP_PUT_ERROR -ERR_FTP_PUT_MODIFIED -ERR_FTP_UNAVAILABLE -ERR_ICAP_FAILURE -ERR_INVALID_REQ -ERR_INVALID_RESP -ERR_INVALID_URL -ERR_LIFETIME_EXP -ERR_NO_RELAY -ERR_ONLY_IF_CACHED_MISS -ERR_PRECONDITION_FAILED -ERR_READ_ERROR -ERR_READ_TIMEOUT -ERR_SECURE_CONNECT_FAIL -ERR_SHUTTING_DOWN -ERR_SOCKET_FAILURE -ERR_TOO_BIG -ERR_UNSUP_HTTPVERSION -ERR_UNSUP_REQ -ERR_URN_RESOLVE -ERR_WRITE_ERROR -ERR_ZERO_SIZE_OBJECT diff --git a/errors/template.list b/errors/template.list new file mode 100644 index 0000000000..811d568706 --- /dev/null +++ b/errors/template.list @@ -0,0 +1,42 @@ +ERROR_TEMPLATES= \ + templates/ERR_ACCESS_DENIED \ + templates/ERR_ACL_TIME_QUOTA_EXCEEDED \ + templates/ERR_AGENT_CONFIGURE \ + templates/ERR_AGENT_WPAD \ + templates/ERR_CACHE_ACCESS_DENIED \ + templates/ERR_CACHE_MGR_ACCESS_DENIED \ + templates/ERR_CANNOT_FORWARD \ + templates/ERR_CONNECT_FAIL \ + templates/ERR_DIR_LISTING \ + templates/ERR_DNS_FAIL \ + templates/ERR_ESI \ + templates/ERR_FORWARDING_DENIED \ + templates/ERR_FTP_DISABLED \ + templates/ERR_FTP_FAILURE \ + templates/ERR_FTP_FORBIDDEN \ + templates/ERR_FTP_NOT_FOUND \ + templates/ERR_FTP_PUT_CREATED \ + templates/ERR_FTP_PUT_ERROR \ + templates/ERR_FTP_PUT_MODIFIED \ + templates/ERR_FTP_UNAVAILABLE \ + templates/ERR_GATEWAY_FAILURE \ + templates/ERR_ICAP_FAILURE \ + templates/ERR_INVALID_REQ \ + templates/ERR_INVALID_RESP \ + templates/ERR_INVALID_URL \ + templates/ERR_LIFETIME_EXP \ + templates/ERR_NO_RELAY \ + templates/ERR_ONLY_IF_CACHED_MISS \ + templates/ERR_PRECONDITION_FAILED \ + templates/ERR_READ_ERROR \ + templates/ERR_READ_TIMEOUT \ + templates/ERR_SECURE_CONNECT_FAIL \ + templates/ERR_SHUTTING_DOWN \ + templates/ERR_SOCKET_FAILURE \ + templates/ERR_TOO_BIG \ + templates/ERR_UNSUP_HTTPVERSION \ + templates/ERR_UNSUP_REQ \ + templates/ERR_URN_RESOLVE \ + templates/ERR_WRITE_ERROR \ + templates/ERR_ZERO_SIZE_OBJECT \ + templates/generic diff --git a/scripts/source-maintenance.sh b/scripts/source-maintenance.sh index b60a1f7fe4..22998d17ec 100755 --- a/scripts/source-maintenance.sh +++ b/scripts/source-maintenance.sh @@ -127,7 +127,7 @@ echo "#endif" >>${ROOT}/lib/profiler/list echo "#endif" >>${ROOT}/lib/profiler/list mv ${ROOT}/lib/profiler/list ${ROOT}/lib/profiler/xprof_type.h -# Build icons install include form current icons available +# Build icons install include from current icons available ( echo -n "ICONS=" for f in `ls -1 ${ROOT}/icons/silk/*` @@ -138,6 +138,39 @@ done echo " " )| sed s%${ROOT}/icons/%%g >${ROOT}/icons/list +# Build templates install include from current templates available +( +echo -n "ERROR_TEMPLATES=" +for f in `ls -1 ${ROOT}/errors/templates/*` +do + echo " \\" + echo -n " ${f}" +done +echo " " +)| sed s%${ROOT}/errors/%%g >${ROOT}/errors/template.list + +# Build errors translation install include from current .PO available +( +echo -n "TRANSLATE_LANGUAGES=" +for f in `ls -1 ${ROOT}/errors/*.po` +do + echo " \\" + echo -n " ${f}" +done +echo " " +)| sed s%${ROOT}/errors/%%g | sed s%\.po%\.lang%g >${ROOT}/errors/language.list + +# Build manuals translation install include from current .PO available +( +echo -n "TRANSLATE_LANGUAGES=" +for f in `ls -1 ${ROOT}/doc/manuals/*.po` +do + echo " \\" + echo -n " ${f}" +done +echo " " +)| sed s%${ROOT}/doc/manuals/%%g | sed s%\.po%\.lang%g >${ROOT}/doc/manuals/language.list + # Run formating echo "" >${ROOT}/doc/debug-sections.tmp srcformat || exit 1