[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 33/33: [me]: (Re-)localize strings.
From: |
G. Branden Robinson |
Subject: |
[groff] 33/33: [me]: (Re-)localize strings. |
Date: |
Thu, 30 Dec 2021 00:46:50 -0500 (EST) |
gbranden pushed a commit to branch temp-mail-fail
in repository groff.
commit 698d524a5950da94935295650ebecdef62e25b92
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Mon Dec 27 19:35:49 2021 +1100
[me]: (Re-)localize strings.
* tmac/{cs,de,fr,it,sv}.tmac: Update package localizations to use new
resources. As a happy side effect (and with the new appendix string),
the `+c` macro is now localized for Czech, German, and Swedish.
* doc/meintro_fr.me.in (Les Parties du Document): Update example to
reflect mixed-case default string used in chapter headings.
* tmac/tests/e_ld-works.sh: Add tests for localization.
---
ChangeLog | 14 ++++++++++
doc/meintro_fr.me.in | 2 +-
tmac/cs.tmac | 5 ++--
tmac/de.tmac | 5 ++--
tmac/fr.tmac | 26 ++---------------
tmac/it.tmac | 26 ++---------------
tmac/sv.tmac | 5 ++--
tmac/tests/e_ld-works.sh | 73 +++++++++++++++++++++++++++++++++++++++++++++++-
8 files changed, 102 insertions(+), 54 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 7d3f0856..da2a7f66 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2021-12-27 G. Branden Robinson <g.branden.robinson@gmail.com>
+
+ [me]: (Re-)localize strings.
+
+ * tmac/{cs,de,fr,it,sv}.tmac: Update package localizations to
+ use new resources. As a happy side effect (and with the new
+ appendix string), the `+c` macro is now localized for Czech,
+ German, and Swedish.
+
+ * doc/meintro_fr.me.in (Les Parties du Document): Update example
+ to reflect mixed-case default string used in chapter headings.
+
+ * tmac/tests/e_ld-works.sh: Add tests for localization.
+
2021-12-27 G. Branden Robinson <g.branden.robinson@gmail.com>
[me]: Internationalize strings.
diff --git a/doc/meintro_fr.me.in b/doc/meintro_fr.me.in
index fd72f586..3974dda3 100644
--- a/doc/meintro_fr.me.in
+++ b/doc/meintro_fr.me.in
@@ -1601,7 +1601,7 @@ utilisez la requête:
qui produira sur une nouvelle page,
les lignes
.(b C
-CHAPITRE 5
+Chapitre 5
CONCLUSIONS
.)b
avec des espacements appropriés pour une thèse.
diff --git a/tmac/cs.tmac b/tmac/cs.tmac
index 2176c453..eb02aeef 100644
--- a/tmac/cs.tmac
+++ b/tmac/cs.tmac
@@ -32,6 +32,7 @@
.
.ds \*[locale]-abstract ABSTRAKT\"
.ds \*[locale]-app DODATEK\"
+.ds \*[locale]-appendix_string Dodatek\"
.ds \*[locale]-april Duben\"
.ds \*[locale]-attribute_string z\"
.ds \*[locale]-august ��jen\"
@@ -136,8 +137,8 @@
.
.\" me package
.if d @R \{\
-. \" date update
-. ds td \n(dy \*(mo \n(y4
+. ds _td_format \En(dy \E*(mo \En(y4
+. ld
.\}
.
.
diff --git a/tmac/de.tmac b/tmac/de.tmac
index 41b7c53a..a6ad9086 100644
--- a/tmac/de.tmac
+++ b/tmac/de.tmac
@@ -32,6 +32,7 @@
.
.ds \*[locale]-abstract Zusammenfassung\"
.ds \*[locale]-app Anhang\"
+.ds \*[locale]-appendix_string Anhang\"
.ds \*[locale]-april April\"
.ds \*[locale]-attribute_string von\"
.ds \*[locale]-august August\"
@@ -136,8 +137,8 @@
.
.\" me package
.if d @R \{\
-. \" date update
-. ds td \n(dy.\~\*(mo.\& \n(y4
+. ds _td_format \En(dy.\~\E*(mo.\& \En(y4
+. ld
.\}
.
.
diff --git a/tmac/fr.tmac b/tmac/fr.tmac
index d8168bfc..21e242bf 100644
--- a/tmac/fr.tmac
+++ b/tmac/fr.tmac
@@ -32,6 +32,7 @@
.
.ds \*[locale]-abstract R\[E ']SUM\[E ']\"
.ds \*[locale]-app ANNEXE\"
+.ds \*[locale]-appendix_string Annexe\"
.ds \*[locale]-april Avril\"
.ds \*[locale]-attribute_string par\"
.ds \*[locale]-august Ao\[u ^]t\"
@@ -136,29 +137,8 @@
.
.\" me package
.if d @R \{\
-. \" date update
-. ds td \n(dy \*(mo \n(y4
-. \" Redefinition for the chapter system
-. de $c
-. sz 12
-. ft 3
-. ce 1000
-. if \\n(_M<3 \
-. nr ch +1
-. ie \\n(_M=1 CHAPITRE\ \ \\n(ch
-. el .if \\n(_M=2 ANNEXE\ \ \\n(ch
-. if \w"\\$1" .sp 3-\\n(.L
-. if \w"\\$1" \\$1
-. if (\\n(_M<3):(\w"\\$1") \
-. sp 4-\\n(.L
-. ce 0
-. ft
-. sz
-. ie \\n(_M=1 \
-. $C Chapitre \\n(ch "\\$1"
-. el .if \\n(_M=2 \
-. $C Annexe \\n(ch "\\$1"
-..
+. ds _td_format \En(dy \E*(mo \En(y4
+. ld
.\}
.
.
diff --git a/tmac/it.tmac b/tmac/it.tmac
index 157a7606..47edf737 100644
--- a/tmac/it.tmac
+++ b/tmac/it.tmac
@@ -32,6 +32,7 @@
.
.ds \*[locale]-abstract RIASSUNTO\"
.ds \*[locale]-app ALLEGATO\"
+.ds \*[locale]-appendix_string Appendice\"
.ds \*[locale]-april Aprile\"
.ds \*[locale]-attribute_string da\"
.ds \*[locale]-august Agosto\"
@@ -136,29 +137,8 @@
.
.\" me package
.if d @R \{\
-. \" date update
-. ds td \n(dy \*(mo \n(y4
-. \" Redefinition for the chapter system
-. de $c
-. sz 12
-. ft 3
-. ce 1000
-. if \\n(_M<3 \
-. nr ch +1
-. ie \\n(_M=1 CAPITOLO\ \ \\n(ch
-. el .if \\n(_M=2 APPENDICE\ \ \\n(ch
-. if \w"\\$1" .sp 3-\\n(.L
-. if \w"\\$1" \\$1
-. if (\\n(_M<3):(\w"\\$1") \
-. sp 4-\\n(.L
-. ce 0
-. ft
-. sz
-. ie \\n(_M=1 \
-. $C Capitolo \\n(ch "\\$1"
-. el .if \\n(_M=2 \
-. $C Appendice \\n(ch "\\$1"
-..
+. ds _td_format \En(dy \E*(mo \En(y4
+. ld
.\}
.
.
diff --git a/tmac/sv.tmac b/tmac/sv.tmac
index 1ca224b5..0b8b7cdd 100644
--- a/tmac/sv.tmac
+++ b/tmac/sv.tmac
@@ -32,6 +32,7 @@
.
.ds \*[locale]-abstract ABSTRAKT\"
.ds \*[locale]-app Bilaga\"
+.ds \*[locale]-appendix_string Bilaga\"
.ds \*[locale]-april april\"
.ds \*[locale]-attribute_string av\"
.ds \*[locale]-august augusti\"
@@ -118,8 +119,8 @@
.
.\" me package
.if d @R \{\
-. \" date update
-. ds td \n(dy \*(mo \n(y4
+. ds _td_format \En(dy \E*(mo \En(y4
+. ld
.\}
.
.
diff --git a/tmac/tests/e_ld-works.sh b/tmac/tests/e_ld-works.sh
index 0c348bc2..70ff97a3 100755
--- a/tmac/tests/e_ld-works.sh
+++ b/tmac/tests/e_ld-works.sh
@@ -44,8 +44,13 @@ wail () {
}
output=$(echo "$input" | "$groff" -Tascii -P-cbou -me)
+output_cs=$(echo "$input" | "$groff" -Tutf8 -P-cbou -me -mcs)
+output_de=$(echo "$input" | "$groff" -Tutf8 -P-cbou -me -mde)
+output_fr=$(echo "$input" | "$groff" -Tutf8 -P-cbou -me -mfr)
+output_it=$(echo "$input" | "$groff" -Tutf8 -P-cbou -me -mit)
+output_sv=$(echo "$input" | "$groff" -Tutf8 -P-cbou -me -msv)
-echo 'checking that `td` string updated correctly' >&2
+echo 'checking that `td` string updated correctly for English' >&2
echo "$output" | grep -q 'The day was Monday, December 15, 2008\.$' \
|| wail
@@ -55,6 +60,72 @@ echo "$output" | grep -Eqx ' +Chapter 1' || wail
echo 'checking for correct English "Appendix" string' >&2
echo "$output" | grep -Eqx ' +Appendix A' || wail
+# POSIX grep (as of Issue 7) does not provide any locale-independent
+# mechanism for matching 8-bit characters--they do not even match "any"
+# character ('.'). When checking the date strings, we therefore skip
+# them. (Fortunately, at present, none of the translations of "Chapter"
+# or "Appendix" require non-Basic Latin letters.)
+
+# Czech localization
+echo 'checking that `td` string updated correctly for Czech (1)' >&2
+echo "$output_cs" | grep -q 'The day was Pond' || wail
+
+echo 'checking that `td` string updated correctly for Czech (2)' >&2
+echo "$output_cs" | grep -q ', 15 Prosinec 2008\.$' || wail
+
+echo 'checking for correct Czech "Chapter" string' >&2
+echo "$output_cs" | grep -Eqx ' +Kapitola 1' || wail
+
+echo 'checking for correct Czech "Appendix" string' >&2
+echo "$output_cs" | grep -Eqx ' +Dodatek A' || wail
+
+# German localization
+echo 'checking that `td` string updated correctly for German' >&2
+echo "$output_de" \
+ | grep -q 'The day was Montag, 15\. Dezember\. 2008\.$' || wail
+
+echo 'checking for correct German "Chapter" string' >&2
+echo "$output_de" | grep -Eqx ' +Kapitel 1' || wail
+
+echo 'checking for correct German "Appendix" string' >&2
+echo "$output_de" | grep -Eqx ' +Anhang A' || wail
+
+# French localization
+echo 'checking that `td` string updated correctly for French (1)' >&2
+echo "$output_fr" | grep -q 'The day was Lundi, 15 D'
+
+echo 'checking that `td` string updated correctly for French (2)' >&2
+echo "$output_fr" | grep -q 'cembre 2008\.$' || wail
+
+echo 'checking for correct French "Chapter" string' >&2
+echo "$output_fr" | grep -Eqx ' +Chapitre 1' || wail
+
+echo 'checking for correct French "Appendix" string' >&2
+echo "$output_fr" | grep -Eqx ' +Annexe A' || wail
+
+# Italian localization
+echo 'checking that `td` string updated correctly for Italian' >&2
+echo "$output_it" | grep -q 'The day was Lunedì, 15 Dicembre 2008\.$'
+
+echo 'checking for correct Italian "Chapter" string' >&2
+echo "$output_it" | grep -Eqx ' +Capitolo 1' || wail
+
+echo 'checking for correct Italian "Appendix" string' >&2
+echo "$output_it" | grep -Eqx ' +Appendice A' || wail
+
+# Swedish localization
+echo 'checking that `td` string updated correctly for Swedish (1)' >&2
+echo "$output_sv" | grep -q 'The day was m'
+
+echo 'checking that `td` string updated correctly for Swedish (2)' >&2
+echo "$output_sv" | grep -q 'ndag, 15 december 2008\.$' || wail
+
+echo 'checking for correct Swedish "Chapter" string' >&2
+echo "$output_sv" | grep -Eqx ' +Kapitel 1' || wail
+
+echo 'checking for correct Swedish "Appendix" string' >&2
+echo "$output_sv" | grep -Eqx ' +Bilaga A' || wail
+
test -z "$fail"
# vim:set ai et sw=4 ts=4 tw=72:
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 33/33: [me]: (Re-)localize strings.,
G. Branden Robinson <=