config ln array changed

This commit is contained in:
Al Murad Uzzaman
2024-05-16 17:11:25 +06:00
parent 97d6f22dcb
commit c137b8afcd
24 changed files with 200 additions and 362 deletions
+17 -42
View File
@@ -1,42 +1,17 @@
[
{
"id": "get_started",
"translation": "البدء"
},
{
"id": "read_more",
"translation": "Read More"
},
{
"id": "full_name",
"translation": "الاسم الكامل"
},
{
"id": "working_mail",
"translation": "بريد العمل"
},
{
"id": "anything_else",
"translation": "أي شيء آخر؟"
},
{
"id": "contact_message_placeholder",
"translation": "الرسالة تذهب هنا..."
},
{
"id": "submit",
"translation": "يُقدِّم"
},
{
"id": "page_not_found",
"translation": "الصفحة غير موجودة"
},
{
"id": "page_not_found_content",
"translation": "ربما تمت إزالة الصفحة التي تبحث عنها، أو تم تغيير اسمها، أو أنها غير متاحة مؤقتًا."
},
{
"id": "back_to_home",
"translation": "العودة إلى المنزل"
}
]
{
"full_name": "الاسم الكامل",
"full_name_placeholder": "أدخل اسمك الكامل",
"mail": "البريد الإلكتروني العملي",
"mail_placeholder": "john.doe@email.com",
"message": "هل هناك شيء آخر؟",
"message_placeholder": "رسالتك هنا...",
"submit": "إرسال",
"read_more": "اقرأ المزيد",
"page_not_found": "الصفحة غير موجودة",
"working_mail": "البريد الإلكتروني العملي",
"anything_else": "هل هناك شيء آخر؟",
"contact_message_placeholder": "رسالتك هنا...",
"page_not_found_content": "قد تمت إزالة الصفحة التي تبحث عنها، أو تغيير اسمها، أو أصبحت غير متوفرة مؤقتًا.",
"back_to_home": "العودة إلى الصفحة الرئيسية",
"get_started": "البدئة"
}
+17 -42
View File
@@ -1,42 +1,17 @@
[
{
"id": "get_started",
"translation": "Get Started"
},
{
"id": "read_more",
"translation": "Read More"
},
{
"id": "full_name",
"translation": "Full Name"
},
{
"id": "working_mail",
"translation": "Working Mail"
},
{
"id": "anything_else",
"translation": "Anything else?"
},
{
"id": "contact_message_placeholder",
"translation": "Message goes here..."
},
{
"id": "submit",
"translation": "Submit"
},
{
"id": "page_not_found",
"translation": "Page Not Found"
},
{
"id": "page_not_found_content",
"translation": "The page you are looking for might have been removed, had its name changed, or is temporarily unavailable."
},
{
"id": "back_to_home",
"translation": "Back to home"
}
]
{
"full_name": "Full Name",
"full_name_placeholder": "Enter your full name",
"mail": "Work Email",
"mail_placeholder": "john.doe@email.com",
"message": "Anything else?",
"message_placeholder": "Your message here...",
"submit": "Submit",
"read_more": "Read More",
"page_not_found": "Page Not Found",
"working_mail": "Work Email",
"anything_else": "Anything else?",
"contact_message_placeholder": "Your message here...",
"page_not_found_content": "The page you are looking for may have been removed, renamed, or is temporarily unavailable.",
"back_to_home": "Back to Home",
"get_started": "Get Started"
}
+17 -42
View File
@@ -1,42 +1,17 @@
[
{
"id": "get_started",
"translation": "Commencer"
},
{
"id": "read_more",
"translation": "Read More"
},
{
"id": "full_name",
"translation": "Nom et prénom"
},
{
"id": "working_mail",
"translation": "Courrier de travail"
},
{
"id": "anything_else",
"translation": "Rien d'autre?"
},
{
"id": "contact_message_placeholder",
"translation": "Le message va ici..."
},
{
"id": "submit",
"translation": "Soumettre"
},
{
"id": "page_not_found",
"translation": "Page non trouvée"
},
{
"id": "page_not_found_content",
"translation": "La page que vous recherchez a peut-être été supprimée, son nom a changé ou est temporairement indisponible."
},
{
"id": "back_to_home",
"translation": "De retour à la maison"
}
]
{
"full_name": "Nom complet",
"full_name_placeholder": "Entrez votre nom complet",
"mail": "E-mail de travail",
"mail_placeholder": "john.doe@email.com",
"message": "Autre chose?",
"message_placeholder": "Votre message ici...",
"submit": "Soumettre",
"read_more": "Lire la suite",
"page_not_found": "Page non trouvée",
"working_mail": "Courrier de travail",
"anything_else": "Autre chose ?",
"contact_message_placeholder": "Votre message ici...",
"page_not_found_content": "La page que vous recherchez a peut-être été supprimée, changée de nom ou temporairement inaccessible.",
"back_to_home": "Retour à l'accueil",
"get_started": "Commencez à utiliser"
}
-63
View File
@@ -1,63 +0,0 @@
import enDataJSON from './en.json';
import frDataJSON from './fr.json';
import arDataJSON from './ar.json';
interface TranslationItem {
id: string;
translation: string;
}
export function convertJsonToUiObject(jsonData: TranslationItem[], language: string): Record<string, Record<string, string>> {
const ui: Record<string, Record<string, string>> = {};
ui[language] = {};
for (const item of jsonData) {
ui[language][item.id] = item.translation;
}
return ui;
}
export const ui = {
...convertJsonToUiObject(enDataJSON, 'en'),
...convertJsonToUiObject(frDataJSON, 'fr'),
...convertJsonToUiObject(arDataJSON, 'ar')
} as const;
// import { readdirSync } from 'fs';
// import path from 'path';
// import { fileURLToPath } from 'url';
// interface TranslationItem {
// id: string;
// translation: string;
// }
// function convertJsonToUiObject(jsonData: TranslationItem[]): Record<string, string> {
// const ui: Record<string, string> = {};
// for (const item of jsonData) {
// ui[item.id] = item.translation;
// }
// return ui;
// }
// const __filename = fileURLToPath(import.meta.url);
// const i18nFolderPath = path.join(path.dirname(__filename));
// const ui: Record<string, Record<string, string>> = {};
// readdirSync(i18nFolderPath).forEach((file) => {
// if (file.endsWith('.json')) {
// const language = file.split('.')[0];
// import(path.join(i18nFolderPath, file)).then((module) => {
// const jsonData: TranslationItem[] = module.default;
// ui[language] = convertJsonToUiObject(jsonData);
// });
// }
// });
// export { ui };