Refactor and clean up i18n (#17198)

* clean up i18n

* fix key

* fix key
This commit is contained in:
Josh Hawkins
2025-03-17 06:26:01 -06:00
committed by GitHub
parent 6e3ae0afc2
commit 03da70cb81
74 changed files with 1243 additions and 799 deletions
+3 -1
View File
@@ -41,7 +41,7 @@ const timeAgo = ({
const elapsed: number = elapsedTime / 1000;
if (elapsed < 10) {
return t("time.justNow");
return t("time.justNow", { ns: "common" });
}
for (let i = 0; i < timeUnits.length; i++) {
@@ -66,6 +66,7 @@ const timeAgo = ({
if (monthDiff > 0) {
const unitAmount = monthDiff;
return t("time.ago", {
ns: "common",
timeAgo: t(`time.${dense ? timeUnits[i].unit : timeUnits[i].full}`, {
time: unitAmount,
}),
@@ -74,6 +75,7 @@ const timeAgo = ({
} else if (elapsed >= timeUnits[i].value) {
const unitAmount: number = Math.floor(elapsed / timeUnits[i].value);
return t("time.ago", {
ns: "common",
timeAgo: t(`time.${dense ? timeUnits[i].unit : timeUnits[i].full}`, {
time: unitAmount,
}),