From 0bbccaa9308cb89aa10570c7ac25b9ba91a09adf Mon Sep 17 00:00:00 2001 From: Joseph Wright Date: Mon, 27 Mar 2023 13:03:30 +0100 Subject: [PATCH] Add support for Italian localisation (closes #650) --- .github/tl_packages | 1 + CHANGELOG.md | 4 ++ siunitx-locale.dtx | 8 ++++ testfiles/siunitx-locale.luatex.tlg | 64 +++++++++++++++++++++++++++++ testfiles/siunitx-locale.lvt | 4 +- testfiles/siunitx-locale.tlg | 64 +++++++++++++++++++++++++++++ testfiles/siunitx-locale.xetex.tlg | 64 +++++++++++++++++++++++++++++ 7 files changed, 208 insertions(+), 1 deletion(-) diff --git a/.github/tl_packages b/.github/tl_packages index 4099edc5..e6b05392 100644 --- a/.github/tl_packages +++ b/.github/tl_packages @@ -21,6 +21,7 @@ atveryend babel-catalan babel-english babel-french +babel-italian babel-german babel-portuges babel-polish diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d37819a..3405db35 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to ## [Unreleased] +### Added +- Support for Italian localisation (see issue + [\#650](https://github.com/josephwright/siunitx/issues/650)) + ## [v3.2.3] - 2023-03-14 ### Fixed diff --git a/siunitx-locale.dtx b/siunitx-locale.dtx index 43f43273..da12029b 100644 --- a/siunitx-locale.dtx +++ b/siunitx-locale.dtx @@ -108,6 +108,12 @@ inter-unit-product = \, , output-decimal-marker = { , } } , + locale / IT .meta:n = + { + exponent-product = \times , + inter-unit-product = \, , + output-decimal-marker = { , } + } , locale / PL .meta:n = { exponent-product = \cdot , @@ -150,6 +156,7 @@ { \RequirePackage { translations } \DeclareTranslation { Catalan } { and } { i } + \DeclareTranslation { Italian } { and } { e } \DeclareTranslation { Portuguese } { and } { e } \DeclareTranslation { Slovene } { and } { in } \DeclareTranslation { Brazilian } { to~(numerical~range) } { a } @@ -157,6 +164,7 @@ \DeclareTranslation { English } { to~(numerical~range) } { to } \DeclareTranslation { French } { to~(numerical~range) } { à } \DeclareTranslation { German } { to~(numerical~range) } { bis } + \DeclareTranslation { Italian } { to~(numerical~range) } { a } \DeclareTranslation { Polish } { to~(numerical~range) } { do } \DeclareTranslation { Portuguese } { to~(numerical~range) } { a } \DeclareTranslation { Slovene } { to~(numerical~range) } { do } diff --git a/testfiles/siunitx-locale.luatex.tlg b/testfiles/siunitx-locale.luatex.tlg index 3af9e84d..2b394d54 100644 --- a/testfiles/siunitx-locale.luatex.tlg +++ b/testfiles/siunitx-locale.luatex.tlg @@ -222,6 +222,41 @@ l. ... } \l_tmpa_box l. ... } > \box...= +\hbox(6.44444+1.93)x32.21005, direction TLT +.\mathon +.\OT1/cmr/m/n/10 1 +.\mathoff +.\TU/lmr/m/n/10 , +.\glue(\spaceskip) 3.33 plus 2.08124 minus 0.888 +.\mathon +.\OT1/cmr/m/n/10 2 +.\mathoff +.\glue(\spaceskip) 3.33 plus 1.665 minus 1.11 +.\hbox(4.48+0.11)x4.44, direction TLT +..\TU/lmr/m/n/10 e +.\glue(\spaceskip) 3.33 plus 1.665 minus 1.11 +.\mathon +.\OT1/cmr/m/n/10 3 +.\mathoff +! OK. + \l_tmpa_box +l. ... } +> \box...= +\hbox(6.44444+0.11)x21.66003, direction TLT +.\mathon +.\OT1/cmr/m/n/10 1 +.\mathoff +.\glue(\spaceskip) 3.33 plus 1.665 minus 1.11 +.\hbox(4.48+0.11)x5.0, direction TLT +..\TU/lmr/m/n/10 a +.\glue(\spaceskip) 3.33 plus 1.665 minus 1.11 +.\mathon +.\OT1/cmr/m/n/10 2 +.\mathoff +! OK. + \l_tmpa_box +l. ... } +> \box...= \hbox(6.57+1.93)x30.55005, direction TLT .\mathon .\OT1/cmr/m/n/10 1 @@ -388,6 +423,35 @@ l. ... } \l_tmpa_box l. ... } > \box...= +\hbox(8.14003+1.94444)x70.83342, direction TLT +.\mathon +.\OT1/cmr/m/n/10 1 +.\hbox(1.05554+1.94444)x2.77779, direction TLT +..\OML/cmm/m/it/10 ; +.\OT1/cmr/m/n/10 2 +.\OT1/cmr/m/n/10 3 +.\glue(\medmuskip) 2.22217 plus 1.11108 minus 2.22217 +.\OMS/cmsy/m/n/10 ^^B +.\glue(\medmuskip) 2.22217 plus 1.11108 minus 2.22217 +.\OT1/cmr/m/n/10 1 +.\OT1/cmr/m/n/10 0 +.\hbox(4.51111+0.0)x4.48613, shifted -3.62892, direction TLT +..\OT1/cmr/m/n/7 4 +.\mathoff +.\kern1.66672 +.\penalty 10000 +.\mathon +.\OT1/cmr/m/n/10 m +.\glue 1.66663 +.\OT1/cmr/m/n/10 s +.\hbox(4.51111+0.83334)x10.73615, shifted -3.62892, direction TLT +..\OMS/cmsy/m/n/7 ^^@ +..\OT1/cmr/m/n/7 1 +.\mathoff +! OK. + \l_tmpa_box +l. ... } +> \box...= \hbox(8.14003+1.94444)x71.3889, direction TLT .\mathon .\OT1/cmr/m/n/10 1 diff --git a/testfiles/siunitx-locale.lvt b/testfiles/siunitx-locale.lvt index 6f8bd3b9..63601459 100644 --- a/testfiles/siunitx-locale.lvt +++ b/testfiles/siunitx-locale.lvt @@ -17,6 +17,7 @@ english, french, german, + italian, portuguese, polish, spanish @@ -67,6 +68,7 @@ english , french , german , + italian , portuguese, polish , spanish @@ -77,7 +79,7 @@ \TEST { Option~setting~"locale" } { \test:nn { 1.23e4 } { \metre\per\second } - \clist_map_inline:nn { DE , FR , PL , UK , US , ZA } + \clist_map_inline:nn { DE , FR , IT , PL , UK , US , ZA } { \keys_set:nn { siunitx } { locale = #1 } \test:nn { 1.23e4 } { \metre\per\second } diff --git a/testfiles/siunitx-locale.tlg b/testfiles/siunitx-locale.tlg index 41637139..0b445fe1 100644 --- a/testfiles/siunitx-locale.tlg +++ b/testfiles/siunitx-locale.tlg @@ -225,6 +225,41 @@ l. ... } \l_tmpa_box l. ... } > \box...= +\hbox(6.44444+1.94444)x32.22226 +.\mathon +.\OT1/cmr/m/n/10 1 +.\mathoff +.\OT1/cmr/m/n/10 , +.\glue 3.33333 plus 2.08331 minus 0.88889 +.\mathon +.\OT1/cmr/m/n/10 2 +.\mathoff +.\glue 3.33333 plus 1.66666 minus 1.11111 +.\hbox(4.30554+0.0)x4.44444 +..\OT1/cmr/m/n/10 e +.\glue 3.33333 plus 1.66666 minus 1.11111 +.\mathon +.\OT1/cmr/m/n/10 3 +.\mathoff +! OK. + \l_tmpa_box +l. ... } +> \box...= +\hbox(6.44444+0.0)x21.6667 +.\mathon +.\OT1/cmr/m/n/10 1 +.\mathoff +.\glue 3.33333 plus 1.66666 minus 1.11111 +.\hbox(4.30554+0.0)x5.00002 +..\OT1/cmr/m/n/10 a +.\glue 3.33333 plus 1.66666 minus 1.11111 +.\mathon +.\OT1/cmr/m/n/10 2 +.\mathoff +! OK. + \l_tmpa_box +l. ... } +> \box...= \hbox(6.67859+1.94444)x30.5556 .\mathon .\OT1/cmr/m/n/10 1 @@ -391,6 +426,35 @@ l. ... } \l_tmpa_box l. ... } > \box...= +\hbox(8.14003+1.94444)x70.83342 +.\mathon +.\OT1/cmr/m/n/10 1 +.\hbox(1.05554+1.94444)x2.77779 +..\OML/cmm/m/it/10 ; +.\OT1/cmr/m/n/10 2 +.\OT1/cmr/m/n/10 3 +.\glue(\medmuskip) 2.22217 plus 1.11108 minus 2.22217 +.\OMS/cmsy/m/n/10 ^^B +.\glue(\medmuskip) 2.22217 plus 1.11108 minus 2.22217 +.\OT1/cmr/m/n/10 1 +.\OT1/cmr/m/n/10 0 +.\hbox(4.51111+0.0)x4.48613, shifted -3.62892 +..\OT1/cmr/m/n/7 4 +.\mathoff +.\kern 1.66672 +.\penalty 10000 +.\mathon +.\OT1/cmr/m/n/10 m +.\glue 1.66663 +.\OT1/cmr/m/n/10 s +.\hbox(4.51111+0.83334)x10.73615, shifted -3.62892 +..\OMS/cmsy/m/n/7 ^^@ +..\OT1/cmr/m/n/7 1 +.\mathoff +! OK. + \l_tmpa_box +l. ... } +> \box...= \hbox(8.14003+1.94444)x71.3889 .\mathon .\OT1/cmr/m/n/10 1 diff --git a/testfiles/siunitx-locale.xetex.tlg b/testfiles/siunitx-locale.xetex.tlg index 4498e44c..0a97be09 100644 --- a/testfiles/siunitx-locale.xetex.tlg +++ b/testfiles/siunitx-locale.xetex.tlg @@ -214,6 +214,41 @@ l. ... } \l_tmpa_box l. ... } > \box...= +\hbox(6.44444+1.92998)x32.21005 +.\mathon +.\OT1/cmr/m/n/10 1 +.\mathoff +.\TU/lmr/m/n/10 , +.\glue 3.33 plus 2.08124 minus 0.888 +.\mathon +.\OT1/cmr/m/n/10 2 +.\mathoff +.\glue 3.33 plus 1.665 minus 1.11 +.\hbox(4.48+0.10999)x4.44 +..\TU/lmr/m/n/10 e +.\glue 3.33 plus 1.665 minus 1.11 +.\mathon +.\OT1/cmr/m/n/10 3 +.\mathoff +! OK. + \l_tmpa_box +l. ... } +> \box...= +\hbox(6.44444+0.10999)x21.66003 +.\mathon +.\OT1/cmr/m/n/10 1 +.\mathoff +.\glue 3.33 plus 1.665 minus 1.11 +.\hbox(4.48+0.10999)x5.0 +..\TU/lmr/m/n/10 a +.\glue 3.33 plus 1.665 minus 1.11 +.\mathon +.\OT1/cmr/m/n/10 2 +.\mathoff +! OK. + \l_tmpa_box +l. ... } +> \box...= \hbox(6.57+1.92998)x30.55005 .\mathon .\OT1/cmr/m/n/10 1 @@ -379,6 +414,35 @@ l. ... } \l_tmpa_box l. ... } > \box...= +\hbox(8.14003+1.94444)x70.83342 +.\mathon +.\OT1/cmr/m/n/10 1 +.\hbox(1.05554+1.94444)x2.77779 +..\OML/cmm/m/it/10 ; +.\OT1/cmr/m/n/10 2 +.\OT1/cmr/m/n/10 3 +.\glue(\medmuskip) 2.22217 plus 1.11108 minus 2.22217 +.\OMS/cmsy/m/n/10 ^^B +.\glue(\medmuskip) 2.22217 plus 1.11108 minus 2.22217 +.\OT1/cmr/m/n/10 1 +.\OT1/cmr/m/n/10 0 +.\hbox(4.51111+0.0)x4.48613, shifted -3.62892 +..\OT1/cmr/m/n/7 4 +.\mathoff +.\kern 1.66672 +.\penalty 10000 +.\mathon +.\OT1/cmr/m/n/10 m +.\glue 1.66663 +.\OT1/cmr/m/n/10 s +.\hbox(4.51111+0.83334)x10.73615, shifted -3.62892 +..\OMS/cmsy/m/n/7 ^^@ +..\OT1/cmr/m/n/7 1 +.\mathoff +! OK. + \l_tmpa_box +l. ... } +> \box...= \hbox(8.14003+1.94444)x71.3889 .\mathon .\OT1/cmr/m/n/10 1