Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
212 changes: 163 additions & 49 deletions src/accessibility.typ
Original file line number Diff line number Diff line change
Expand Up @@ -349,51 +349,51 @@
"‰": "per mille",
),
fi: (
A: "ampeeria",
au: "astronomista yksikköä",
B: "beliä",
Bq: "becquereliä",
C: "coulombia",
cd: "kandelaa",
d: "päivää",
Da: "daltonia",
dB: "desibeliä",
sym.degree: "astetta",
sym.degree + "C": "Celsiusastetta",
eV: "elektronivolttia",
F: "faradia",
g: "grammaa",
Gy: "graytä",
H: "henryä",
h: "tuntia",
ha: "hehtaaria",
Hz: "hertsiä",
J: "joulea",
K: "kelviniä",
kat: "katalia",
kg: "kilogrammaa",
L: "litraa",
lm: "luumenia",
lx: "luksia",
m: "metriä",
sym.prime: "kaariminuuttia",
min: "minuuttia",
mol: "moolia",
sym.prime.double: "kaarisekuntia",
N: "newtonia",
Np: "neperiä",
sym.Omega: "ohmia",
Pa: "pascalia",
rad: "radiaania",
s: "sekuntia",
S: "siemensiä",
sr: "steradiaania",
Sv: "sieverttiä",
t: "tonnia",
T: "teslaa",
V: "volttia",
W: "wattia",
Wb: "weberiä",
A: "ampeeri",
au: "astronominen yksikkö",
B: "bel",
Bq: "becquerel",
C: "coulombi",
cd: "kandela",
d: "päivä",
Da: "dalton",
dB: "desibeli",
sym.degree: "aste",
sym.degree + "C": "Celsiusaste",
eV: "elektronivoltti",
F: "faradi",
g: "gramma",
Gy: "gray",
H: "henry",
h: "tunti",
ha: "hehtaari",
Hz: "hertsi",
J: "joule",
K: "kelvin",
kat: "katal",
kg: "kilogramma",
L: "litra",
lm: "luumen",
lx: "luksi",
m: "metri",
sym.prime: "kaariminuutti",
min: "minuuti",
mol: "mooli",
sym.prime.double: "kaarisekunti",
N: "newton",
Np: "neper",
sym.Omega: "ohmi",
Pa: "pascal",
rad: "radiaani",
s: "sekunti",
S: "siemens",
sr: "steradiaani",
Sv: "sievertti",
t: "tonni",
T: "tesla",
V: "voltti",
W: "watti",
Wb: "weber",
"%": "prosentti",
"‰": "promille",
),
Expand Down Expand Up @@ -472,6 +472,108 @@
),
)

#let finnish-plural-units = (
A: "ampeeria",
au: "astronomista yksikköä",
B: "beliä",
Bq: "becquereliä",
C: "coulombia",
cd: "kandelaa",
d: "päivää",
Da: "daltonia",
dB: "desibeliä",
sym.degree: "astetta",
sym.degree + "C": "Celsiusastetta",
eV: "elektronivolttia",
F: "faradia",
g: "grammaa",
Gy: "graytä",
H: "henryä",
h: "tuntia",
ha: "hehtaaria",
Hz: "hertsiä",
J: "joulea",
K: "kelviniä",
kat: "katalia",
kg: "kilogrammaa",
L: "litraa",
lm: "luumenia",
lx: "luksia",
m: "metriä",
sym.prime: "kaariminuuttia",
min: "minuuttia",
mol: "moolia",
sym.prime.double: "kaarisekuntia",
N: "newtonia",
Np: "neperiä",
sym.Omega: "ohmia",
Pa: "pascalia",
rad: "radiaania",
s: "sekuntia",
S: "siemensiä",
sr: "steradiaania",
Sv: "sieverttiä",
t: "tonnia",
T: "teslaa",
V: "volttia",
W: "wattia",
Wb: "weberiä",
"%": "prosentti",
"‰": "promille",
)

// Needed by pluralize when a unit is in a denominator.
// The unit suffixes are in a form where each word would be preceded by the word "jaettuna" or "divided by".
#let finnish-denom-units = (
A: "ampeerilla",
au: "astronomisella yksikköllä",
B: "belillä",
Bq: "becquerelillä",
C: "coulombilla",
cd: "kandelalla",
d: "päivällä",
Da: "daltonilla",
dB: "desibelillä",
sym.degree: "asteella",
sym.degree + "C": "Celsiusasteella",
eV: "elektronivoltilla",
F: "faradilla",
g: "grammalla",
Gy: "grayllä",
H: "henryllä",
h: "tunnilla",
ha: "hehtaarilla",
Hz: "hertsillä",
J: "joulella",
K: "kelvinillä",
kat: "katalilla",
kg: "kilogrammalla",
L: "litralla",
lm: "luumenilla",
lx: "luksilla",
m: "metrillä",
sym.prime: "kaariminuuttilla",
min: "minuutilla",
mol: "moolilla",
sym.prime.double: "kaarisekunnilla",
N: "newtonilla",
Np: "neperillä",
sym.Omega: "ohmilla",
Pa: "pascalilla",
rad: "radiaanilla",
s: "sekunnilla",
S: "siemensillä",
sr: "steradiaanilla",
Sv: "sievertillä",
t: "tonnilla",
T: "teslalla",
V: "voltilla",
W: "watilla",
Wb: "weberillä",
"%": "prosentilla",
"‰": "promillella",
)

// How to form the plural of a constituent unit. For each language, this should
// be a function that takes a unit symbol string, e.g. "Hz",
// and a float `count` which is assumed to be of some plural amount,
Expand Down Expand Up @@ -506,6 +608,18 @@
return singular
},

fi: (unit, count, is-in-denom) => {
if is-in-denom {
// Things get more complex here since when in a denominator we need a form of each word where things happen IN something.
// Like literally IN one second, or IN one meter. And of course Finnish has a specific suffix for each word for this.
// Often this just means adding a "ss" before the last letter of the quantity form of each word but not always.
// For example "metriä sekunnissa" means "meters per second" or "meters in one second".
return finnish-denom-units.at(unit)
} else {
return finnish-plural-units.at(unit)
}
},

fr: (unit, count, is-in-denom) => {
let singular = units.fr.at(unit, default: units.en.at(unit))
if unit in ("lx", "Hz", "S", "%", "‰") {
Expand Down Expand Up @@ -656,9 +770,9 @@
// Masculine
if (
unit in (
"A", "B", "Bq", "C", "d", "Da", "dB", "eV", "F", "g", "Gy", "H", "ha",
"Hz", "J", "K", "kat", "kg", "L", "lm", "lx", "m", "mol", "N", "Np",
str(sym.Omega), "Pa", "rad", "S", "sr", "Sv", "T", "V", "W", "Wb",
"A", "B", "Bq", "C", "d", "Da", "dB", "eV", "F", "g", "Gy", "H", "ha",
"Hz", "J", "K", "kat", "kg", "L", "lm", "lx", "m", "mol", "N", "Np",
str(sym.Omega), "Pa", "rad", "S", "sr", "Sv", "T", "V", "W", "Wb",
"%", "‰",
)
) {
Expand Down Expand Up @@ -798,7 +912,7 @@
let units = units.en + units.at(lang, default: units.en)
let get-unit(unit-code) = {
if plural { (pluralize.at(lang))(unit-code, count, is-in-denom) } // Add your language here to `pluralize` the denominator
else if is-in-denom and lang == "sl" {
else if is-in-denom and lang in ("sl", "fi") {
(pluralize.at(lang))(unit-code, count, is-in-denom)
} else { units.at(unit-code) }
}
Expand Down
Loading
Loading