UPDATE: new language
All checks were successful
Gitea Auto Deploy / Deploy-Container (push) Successful in 56s

This commit is contained in:
2026-04-14 12:31:35 +07:00
parent 4c1d0b9a59
commit 90f1cf4f40
12 changed files with 16 additions and 11 deletions

View File

@@ -1,4 +1,4 @@
import { listCurrentLanguage } from "@/constant/constant";
import { listCurrentLanguageApi } from "@/constant/constant";
import { AvatarDetail } from "@/types";
import { useTranslations } from "next-intl"
@@ -15,11 +15,11 @@ export function getNameChar(
): string {
if (!data) return "";
if (!Object.prototype.hasOwnProperty.call(listCurrentLanguage, locale)) {
if (!Object.prototype.hasOwnProperty.call(listCurrentLanguageApi, locale)) {
return "";
}
const langKey = listCurrentLanguage[locale as keyof typeof listCurrentLanguage].toLowerCase();
const langKey = listCurrentLanguageApi[locale as keyof typeof listCurrentLanguageApi].toLowerCase();
let text = data.Name[langKey] ?? "";
@@ -38,13 +38,16 @@ export function getLocaleName(locale: string, data: Record<string, string> | und
if (!data) {
return ""
}
if (!Object.prototype.hasOwnProperty.call(listCurrentLanguage, locale)) {
if (!Object.prototype.hasOwnProperty.call(listCurrentLanguageApi, locale)) {
return ""
}
const langKey = listCurrentLanguage[locale as keyof typeof listCurrentLanguage].toLowerCase();
const langKey = listCurrentLanguageApi[locale as keyof typeof listCurrentLanguageApi].toLowerCase();
console.log(langKey)
let text = data[langKey] ?? "";
if (!text) {