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
1 change: 1 addition & 0 deletions src/components/LanguageSwitcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const LOCALES_NAMES_MAP = {
pl: "Polski",
ptbr: "Brazilian Portuguese",
ru: "Русский",
sk: "Slovenčina",
sv: "Svenska",
tr: "Türkçe",
zh: "繁體中文",
Expand Down
50 changes: 50 additions & 0 deletions src/i18n/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import timeNl from "timeago.js/lib/lang/nl.js";
import timePl from "timeago.js/lib/lang/pl.js";
import timePtBr from "timeago.js/lib/lang/pt_BR.js";
import timeRu from "timeago.js/lib/lang/ru.js";
// import timeSk from "timeago.js/lib/lang/sk.js";
import timeSv from "timeago.js/lib/lang/sv.js";
import timeTr from "timeago.js/lib/lang/tr.js";
import timeUa from "timeago.js/lib/lang/uk.js";
Expand All @@ -44,12 +45,59 @@ import noTranslations from "./locales/no.json" with { type: "json" };
import plTranslations from "./locales/pl.json" with { type: "json" };
import ptbrTranslations from "./locales/ptbr.json" with { type: "json" };
import ruTranslations from "./locales/ru.json" with { type: "json" };
import skTranslations from "./locales/sk.json" with { type: "json" };
import svTranslations from "./locales/sv.json" with { type: "json" };
import trTranslations from "./locales/tr.json" with { type: "json" };
import uaTranslations from "./locales/ua.json" with { type: "json" };
import zhTranslations from "./locales/zh.json" with { type: "json" };
import zhCnTranslations from "./locales/zh-CN.json" with { type: "json" };

function timeSk(number: number, index: number): [string, string] {
let inflectionIndex = 0;

if ((index === 1 || index === 3 || index === 5 || index === 7 || index === 9 || index === 11 || index === 13) && number >= 5) {
inflectionIndex = 1;
}

return [
[["práve teraz", "práve teraz"]],
[
["pred %s sekundami", "o %s sekundy"],
["pred %s sekundami", "o %s sekúnd"],
],
[["pred minútou", "o minútu"]],
[
["pred %s minútami", "o %s minúty"],
["pred %s minútami", "o %s minút"],
],
[["pred hodinou", "o hodinu"]],
[
["pred %s hodinami", "o %s hodiny"],
["pred %s hodinami", "o %s hodín"],
],
[["včera", "zajtra"]],
[
["pred %s dňami", "o %s dni"],
["pred %s dňami", "o %s dní"],
],
[["minulý týždeň", "budúci týždeň"]],
[
["pred %s týždňami", "o %s týždne"],
["pred %s týždňami", "o %s týždňov"],
],
[["minulý mesiac", "budúci mesiac"]],
[
["pred %s mesiacmi", "o %s mesiace"],
["pred %s mesiacmi", "o %s mesiacov"],
],
[["pred rokom", "budúci rok"]],
[
["pred %s rokmi", "o %s roky"],
["pred %s rokmi", "o %s rokov"],
],
][index][inflectionIndex] as [string, string];
}

register("bg", timeBg);
register("ca", timeCa);
register("cs", timeCs);
Expand All @@ -68,6 +116,7 @@ register("no", timeNo);
register("pl", timePl);
register("ptbr", timePtBr);
register("ru", timeRu);
register("sk", timeSk);
register("sv", timeSv);
register("tr", timeTr);
register("ua", timeUa);
Expand All @@ -94,6 +143,7 @@ const resources = {
pl: plTranslations as ResourceLanguage,
ptbr: ptbrTranslations as ResourceLanguage,
ru: ruTranslations as ResourceLanguage,
sk: skTranslations as ResourceLanguage,
sv: svTranslations as ResourceLanguage,
tr: trTranslations as ResourceLanguage,
ua: uaTranslations as ResourceLanguage,
Expand Down
Loading