diff --git a/apps/openmw/mwgui/tooltips.cpp b/apps/openmw/mwgui/tooltips.cpp index 91c980b823..36940709f8 100644 --- a/apps/openmw/mwgui/tooltips.cpp +++ b/apps/openmw/mwgui/tooltips.cpp @@ -8,6 +8,7 @@ #include #include +#include #include #include #include @@ -731,12 +732,14 @@ namespace MWGui std::string ToolTips::getDurationString(float duration, const std::string& prefix) { + auto l10n = MWBase::Environment::get().getL10nManager()->getContext("Interface"); + std::string ret; ret = prefix + ": "; if (duration < 1.f) { - ret += "0 s"; + ret += l10n->formatMessage("DurationSecond", { "seconds" }, { 0 }); return ret; } @@ -757,29 +760,29 @@ namespace MWGui if (years) { units++; - ret += toString(years) + " #{Interface:DurationYear} "; + ret += l10n->formatMessage("DurationYear", { "years" }, { years }); } if (months) { units++; - ret += toString(months) + " #{Interface:DurationMonth} "; + ret += l10n->formatMessage("DurationMonth", { "months" }, { months }); } if (units < 2 && days) { units++; - ret += toString(days) + " #{Interface:DurationDay} "; + ret += l10n->formatMessage("DurationDay", { "days" }, { days }); } if (units < 2 && hours) { units++; - ret += toString(hours) + " #{Interface:DurationHour} "; + ret += l10n->formatMessage("DurationHour", { "hours" }, { hours }); } if (units >= 2) return ret; if (minutes) - ret += toString(minutes) + " #{Interface:DurationMinute} "; + ret += l10n->formatMessage("DurationMinute", { "minutes" }, { minutes }); if (seconds) - ret += toString(seconds) + " #{Interface:DurationSecond} "; + ret += l10n->formatMessage("DurationSecond", { "seconds" }, { seconds }); return ret; } diff --git a/files/data/l10n/Interface/en.yaml b/files/data/l10n/Interface/en.yaml index b15f988d00..3b6c5bafc0 100644 --- a/files/data/l10n/Interface/en.yaml +++ b/files/data/l10n/Interface/en.yaml @@ -1,9 +1,17 @@ -DurationDay: "d" -DurationHour: "h" -DurationMinute: "min" -DurationMonth: "mo" -DurationSecond: "s" -DurationYear: "y" +DurationDay: "{days} d " +DurationHour: "{hours} h " +DurationMinute: "{minutes} min " +DurationMonth: |- + {months, plural, + one{{months} mo } + other{{months} mos } + } +DurationSecond: "{seconds} s " +DurationYear: |- + {years, plural, + one{{years} yr } + other{{years} yrs } + } No: "No" NotAvailableShort: "N/A" Reset: "Reset" diff --git a/files/data/l10n/Interface/fr.yaml b/files/data/l10n/Interface/fr.yaml index 1003d09bb1..eb4a4879f8 100644 --- a/files/data/l10n/Interface/fr.yaml +++ b/files/data/l10n/Interface/fr.yaml @@ -1,5 +1,18 @@ +DurationDay: |- + {days, plural, + one{{days} jour } + other{{days} jours } + } +DurationHour: "{hours} h " +DurationMinute: "{minutes} min " +DurationMonth: "{months} mois " +DurationSecond: "{seconds} sec " +DurationYear: |- + {years, plural, + one{{years} an } + other{{years} ans } + } No: "Non" NotAvailableShort: "N/A" Reset: "Réinitialiser" Yes: "Oui" - diff --git a/files/data/l10n/Interface/ru.yaml b/files/data/l10n/Interface/ru.yaml index c743f7c3c2..ec5c5b393f 100644 --- a/files/data/l10n/Interface/ru.yaml +++ b/files/data/l10n/Interface/ru.yaml @@ -1,9 +1,14 @@ -DurationDay: "д" -DurationHour: "ч" -DurationMinute: "мин" -DurationMonth: "мес" -DurationSecond: "с" -DurationYear: "л" +DurationDay: "{days} д " +DurationHour: "{hours} ч " +DurationMinute: "{minutes} мин " +DurationMonth: "{months} мес " +DurationSecond: "{seconds} с " +DurationYear: |- + {years, plural, + one{{years} г } + few{{years} г } + other{{years} л } + } No: "Нет" NotAvailableShort: "Н/Д" Reset: "Обнулить" diff --git a/files/data/l10n/Interface/sv.yaml b/files/data/l10n/Interface/sv.yaml index 9ea4b5a8e5..aad4d74015 100644 --- a/files/data/l10n/Interface/sv.yaml +++ b/files/data/l10n/Interface/sv.yaml @@ -1,9 +1,9 @@ -DurationDay: "d" -DurationHour: "tim" -DurationMinute: "min" -DurationMonth: "må" -DurationSecond: "sek" -DurationYear: "år" +DurationDay: "{days} d " +DurationHour: "{hours} tim " +DurationMinute: "{minutes} min " +DurationMonth: "{months} må " +DurationSecond: "{seconds} sek " +DurationYear: "{years} år " No: "Nej" NotAvailableShort: "N/A" Reset: "Återställ"