diff --git a/content/i18n/bg.json b/content/i18n/bg.json index 26788cf..8ec5af7 100644 --- a/content/i18n/bg.json +++ b/content/i18n/bg.json @@ -32,5 +32,13 @@ "statistics": "Статистика", "coverMeLogs": "Замествания", "translations": "Преводи" + }, + "content": { + "location": { + "warehouse": { + "description": "- снимки как да се поставят количките\n- снимка с код за катинар\nвсеки може да всима/връща\n- преди да влизаме трябва да почистим краката.\n- зареждаме/почистваме извън\n- влизане/озлизане няма код\n- влизане/излизане има код", + "title": "СНЛАД" + } + } } } \ No newline at end of file diff --git a/content/i18n/en.json b/content/i18n/en.json index 19bce02..87077a2 100644 --- a/content/i18n/en.json +++ b/content/i18n/en.json @@ -32,5 +32,13 @@ "statistics": "View Statistics", "coverMeLogs": "View CoverMe logs", "translations": "Translation" + }, + "content": { + "location": { + "warehouse": { + "description": "- снимки как да се поставят количките\n- снимка с код за катинар\nвсеки може да всима/връща\n- преди да влизаме трябва да почистим краката.\n- зареждаме/почистваме извън\n- влизане/озлизане няма код\n- влизане/излизане има код", + "title": "СНЛАД" + } + } } } \ No newline at end of file diff --git a/content/i18n/ru.json b/content/i18n/ru.json index c68913e..fb8f07b 100644 --- a/content/i18n/ru.json +++ b/content/i18n/ru.json @@ -8,10 +8,17 @@ "BG": "болгарский", "EN": "английский", "RU": "русский", - "login": "вход", - "contacts": "Контакти te" + "login": "вход" }, "menu": { "dashboard": "Начало" + }, + "content": { + "location": { + "warehouse": { + "description": "- снимки как да се поставят количките\n- снимка с код за катинар\nвсеки може да всима/връща\n- преди да влизаме трябва да почистим краката.\n- зареждаме/почистваме извън\n- влизане/озлизане няма код\n- влизане/излизане има код", + "title": "СНЛАД" + } + } } } \ No newline at end of file diff --git a/pages/cart/locations/[id].tsx b/pages/cart/locations/[id].tsx index 4a7de4d..7101159 100644 --- a/pages/cart/locations/[id].tsx +++ b/pages/cart/locations/[id].tsx @@ -112,9 +112,16 @@ export const getServerSideProps: GetServerSideProps = async (context) => { const placeholderPattern = /{([^}]+)}/g; return content.replace(placeholderPattern, (match, key) => { try { - return t(key); + const translation = t('content.' + key); + // Check if translation exists and is not empty + if (translation && translation !== 'content.' + key) { + return translation; + } + // Return formatted placeholder if translation not found + return `[${locale}:${key}]`; } catch (error) { - return match; + // Return formatted placeholder on error + return `[${locale}:${key}]`; } }); };