siunitx icon indicating copy to clipboard operation
siunitx copied to clipboard

Italian localisation

Open matteofg opened this issue 1 year ago • 11 comments

Is it possible to have support for the Italian language? Below are keys and translations:

- exponent-product = \times
- inter-unit-product = \,
- output-decimal-marker = { , }
- list-final-separator = { e }
- list-pair-separator = { e }

About range-phrase in Italian, two prepositions are used: da 1 a 3... da 10 kg a 12 kg...

Matteo

matteofg avatar Mar 27 '23 08:03 matteofg

I've added the code in a branch for the next feature release. The da part is not currently implemented as I don't include the 'from' phrase as standard. That's because it's not universally required: certainly in English I can say 'in the range X to Y' or 'in the range from X to Y' and both are correct. So I'm wary of adding anything here: the 'from' feels to me like an optional part of the text not a required part of specifying a range.

josephwright avatar Mar 27 '23 12:03 josephwright

(Certainly adding a 'from' phrase would need to be handled separately as it's not specific to Italian, and I'll need to think about the semantics: if you need it for X-Y, then it's not part of the siunitx scope.)

josephwright avatar Mar 27 '23 12:03 josephwright

Thank you for your answer.

So I'm wary of adding anything here: the 'from' feels to me like an optional part of the text not a required part of specifying a range.

Unfortunately, in Italian, it is a mandatory part: you cannot write/say "10 kg a 12 kg"...

Meanwhile thank you for the support!

Matteo

matteofg avatar Mar 27 '23 12:03 matteofg

Unfortunately, in Italian, it is a mandatory part: you cannot write/say "10 kg a 12 kg"...

I suspected that, what I'm wondering is if you need it if you write the range without a word in it, e.g. do you write da X-Y kg or not? That affects whether siunitx should insert additional information.

josephwright avatar Mar 27 '23 12:03 josephwright

what I'm wondering is if you need it if you write the range without a word in it, e.g. do you write da X-Y kg or not?

Even then, writing da X-Y kg makes no sense :-( Currently the only solution is to change the form of the sentence, writing, for example: "numbers in the range 5-9 are..." instead of "numbers 5 to 9 are...".

Matteo

matteofg avatar Mar 27 '23 15:03 matteofg

I'll think a bit more about this and see if I can find a solution

josephwright avatar Mar 27 '23 16:03 josephwright

Thank you very much.

Meanwhile, I would like to ask an off-topic question that perhaps does not need a separate discussion: why is it necessary to specify the locale option even if you use babel/polyglossia? Writing:

\usepackage{polyglossia}
  \setmainlanguage{german}
\usepackage[locale=DE]{siunitx}

seems to be a redundancy. If I needed to change some parameters that are set by language, it would seem more logical to me to change the parameter explicitly, for example:

\usepackage{polyglossia}
  \setmainlanguage{german}
\usepackage{siunitx}
  \sisetup{output-decimal-marker={,}}

But surely I am missing something :-)

Matteo

matteofg avatar Mar 28 '23 08:03 matteofg

Thank you very much.

Meanwhile, I would like to ask an off-topic question that perhaps does not need a separate discussion: why is it necessary to specify the locale option even if you use babel/polyglossia? Writing:

\usepackage{polyglossia}
  \setmainlanguage{german}
\usepackage[locale=DE]{siunitx}

seems to be a redundancy. If I needed to change some parameters that are set by language, it would seem more logical to me to change the parameter explicitly, for example:

\usepackage{polyglossia}
  \setmainlanguage{german}
\usepackage{siunitx}
  \sisetup{output-decimal-marker={,}}

But surely I am missing something :-)

I point out in the manual that you can link the locale and the language. The split arises as the settings in siunitx are really about the typographic tradition wherever you do the typesetting, which I've called the locale. That's independent of the language the document happens to be written in. For example, in the UK we'd use . for the decimal marker, and that would remain true even if the text is written in some other language (particularly say in a quote). So I leave the question of linking locale and language to the author.

josephwright avatar Mar 28 '23 09:03 josephwright

I'm looking back at this: I think I have a general plan, just implementing the specifics

josephwright avatar Jul 22 '23 09:07 josephwright

I've committed the partial fix I have plus a mechanism at 'my' end to do the 'from' part: I now need some changes in a support package to finalise a fix.

josephwright avatar Jul 23 '23 18:07 josephwright

Pushing any further change to v3.4

josephwright avatar Jul 27 '23 07:07 josephwright