Skip to content

Commit

Permalink
Add support for Italian localisation (closes #650)
Browse files Browse the repository at this point in the history
  • Loading branch information
josephwright committed Mar 28, 2023
1 parent ce0c36b commit 0bbccaa
Show file tree
Hide file tree
Showing 7 changed files with 208 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/tl_packages
Expand Up @@ -21,6 +21,7 @@ atveryend
babel-catalan
babel-english
babel-french
babel-italian
babel-german
babel-portuges
babel-polish
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions siunitx-locale.dtx
Expand Up @@ -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 ,
Expand Down Expand Up @@ -150,13 +156,15 @@
{
\RequirePackage { translations }
\DeclareTranslation { Catalan } { and } { i }
\DeclareTranslation { Italian } { and } { e }
\DeclareTranslation { Portuguese } { and } { e }
\DeclareTranslation { Slovene } { and } { in }
\DeclareTranslation { Brazilian } { to~(numerical~range) } { a }
\DeclareTranslation { Catalan } { to~(numerical~range) } { a }
\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 }
Expand Down
64 changes: 64 additions & 0 deletions testfiles/siunitx-locale.luatex.tlg
Expand Up @@ -222,6 +222,41 @@ l. ... }
<argument> \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.
<argument> \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.
<argument> \l_tmpa_box
l. ... }
> \box...=
\hbox(6.57+1.93)x30.55005, direction TLT
.\mathon
.\OT1/cmr/m/n/10 1
Expand Down Expand Up @@ -388,6 +423,35 @@ l. ... }
<argument> \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.
<argument> \l_tmpa_box
l. ... }
> \box...=
\hbox(8.14003+1.94444)x71.3889, direction TLT
.\mathon
.\OT1/cmr/m/n/10 1
Expand Down
4 changes: 3 additions & 1 deletion testfiles/siunitx-locale.lvt
Expand Up @@ -17,6 +17,7 @@
english,
french,
german,
italian,
portuguese,
polish,
spanish
Expand Down Expand Up @@ -67,6 +68,7 @@
english ,
french ,
german ,
italian ,
portuguese,
polish ,
spanish
Expand All @@ -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 }
Expand Down
64 changes: 64 additions & 0 deletions testfiles/siunitx-locale.tlg
Expand Up @@ -225,6 +225,41 @@ l. ... }
<argument> \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.
<argument> \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.
<argument> \l_tmpa_box
l. ... }
> \box...=
\hbox(6.67859+1.94444)x30.5556
.\mathon
.\OT1/cmr/m/n/10 1
Expand Down Expand Up @@ -391,6 +426,35 @@ l. ... }
<argument> \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.
<argument> \l_tmpa_box
l. ... }
> \box...=
\hbox(8.14003+1.94444)x71.3889
.\mathon
.\OT1/cmr/m/n/10 1
Expand Down
64 changes: 64 additions & 0 deletions testfiles/siunitx-locale.xetex.tlg
Expand Up @@ -214,6 +214,41 @@ l. ... }
<argument> \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.
<argument> \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.
<argument> \l_tmpa_box
l. ... }
> \box...=
\hbox(6.57+1.92998)x30.55005
.\mathon
.\OT1/cmr/m/n/10 1
Expand Down Expand Up @@ -379,6 +414,35 @@ l. ... }
<argument> \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.
<argument> \l_tmpa_box
l. ... }
> \box...=
\hbox(8.14003+1.94444)x71.3889
.\mathon
.\OT1/cmr/m/n/10 1
Expand Down

0 comments on commit 0bbccaa

Please sign in to comment.