Skip to content

Commit f239adc

Browse files
authored
Merge pull request #133 from LiliaFramework/codex/localize-module-strings-using-l-function
Localize utilities time difference output
2 parents 75068a9 + 4564ce6 commit f239adc

File tree

8 files changed

+9
-2
lines changed

8 files changed

+9
-2
lines changed

utilities/languages/english.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@ LANGUAGE = {
33
invalidDates = "Invalid dates",
44
invalidTimeFormat = "Invalid time format. Expected 'HH:MM:SS - DD/MM/YYYY'.",
55
invalidTimeValues = "Invalid time values.",
6-
timeIsPast = "The specified time is in the past."
6+
timeIsPast = "The specified time is in the past.",
7+
timeDifferenceFormat = "%d years, %d months, %d days, %d hours, %d minutes, %d seconds"
78
}

utilities/languages/french.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ LANGUAGE = {
55
invalidTimeFormat = "Invalid time format. Expected 'HH:MM:SS - DD/MM/YYYY'.",
66
invalidTimeValues = "Invalid time values.",
77
timeIsPast = "The specified time is in the past.",
8+
timeDifferenceFormat = "%d années, %d mois, %d jours, %d heures, %d minutes, %d secondes",
89
invalidEntityPosition = "Invalid position for entity"
910
}

utilities/languages/german.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ LANGUAGE = {
55
invalidTimeFormat = "Invalid time format. Expected 'HH:MM:SS - DD/MM/YYYY'.",
66
invalidTimeValues = "Invalid time values.",
77
timeIsPast = "The specified time is in the past.",
8+
timeDifferenceFormat = "%d Jahre, %d Monate, %d Tage, %d Stunden, %d Minuten, %d Sekunden",
89
invalidEntityPosition = "Invalid position for entity"
910
}

utilities/languages/italian.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ LANGUAGE = {
55
invalidTimeFormat = "Invalid time format. Expected 'HH:MM:SS - DD/MM/YYYY'.",
66
invalidTimeValues = "Invalid time values.",
77
timeIsPast = "The specified time is in the past.",
8+
timeDifferenceFormat = "%d anni, %d mesi, %d giorni, %d ore, %d minuti, %d secondi",
89
invalidEntityPosition = "Invalid position for entity"
910
}

utilities/languages/portuguese.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ LANGUAGE = {
55
invalidTimeFormat = "Invalid time format. Expected 'HH:MM:SS - DD/MM/YYYY'.",
66
invalidTimeValues = "Invalid time values.",
77
timeIsPast = "The specified time is in the past.",
8+
timeDifferenceFormat = "%d anos, %d meses, %d dias, %d horas, %d minutos, %d segundos",
89
invalidEntityPosition = "Invalid position for entity"
910
}

utilities/languages/russian.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ LANGUAGE = {
55
invalidTimeFormat = "Invalid time format. Expected 'HH:MM:SS - DD/MM/YYYY'.",
66
invalidTimeValues = "Invalid time values.",
77
timeIsPast = "The specified time is in the past.",
8+
timeDifferenceFormat = "%d лет, %d месяцев, %d дней, %d часов, %d минут, %d секунд",
89
invalidEntityPosition = "Invalid position for entity"
910
}

utilities/languages/spanish.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ LANGUAGE = {
55
invalidTimeFormat = "Invalid time format. Expected 'HH:MM:SS - DD/MM/YYYY'.",
66
invalidTimeValues = "Invalid time values.",
77
timeIsPast = "The specified time is in the past.",
8+
timeDifferenceFormat = "%d años, %d meses, %d días, %d horas, %d minutos, %d segundos",
89
invalidEntityPosition = "Invalid position for entity"
910
}

utilities/libs/sh_utils.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ function lia.utilities.TimeUntil(str)
142142
local hdiff = math.floor(diff / 3600)
143143
diff = diff % 3600
144144
local mindiff = math.floor(diff / 60)
145-
return string.format("%d years, %d months, %d days, %d hours, %d minutes, %d seconds", ydiff, mdiff, ddiff, hdiff, mindiff, diff % 60)
145+
return L("timeDifferenceFormat", ydiff, mdiff, ddiff, hdiff, mindiff, diff % 60)
146146
end
147147

148148
function lia.utilities.CurrentLocalTime()

0 commit comments

Comments
 (0)