From 9668bc0ef84de7b123c2d0f802ce088d92af4e19 Mon Sep 17 00:00:00 2001 From: Dobromir Popov Date: Mon, 29 Apr 2024 13:15:52 +0300 Subject: [PATCH] fix some traslation message errors during build; disable auto language recognition. --- .env | 4 ++-- content/i18n/bg.json | 7 ++++--- content/i18n/ru.json | 6 +++++- next.config.js | 6 +++++- pages/contactUs.tsx | 4 +++- 5 files changed, 19 insertions(+), 8 deletions(-) diff --git a/.env b/.env index 7d426a5..7129205 100644 --- a/.env +++ b/.env @@ -8,8 +8,8 @@ NEXTAUTH_SECRET=ed8a9681efc414df89dfd03cd188ed58 NODE_ENV=development # mysql. ONLY THIS ENV is respected when generating/applying migrations in prisma -# DATABASE=mysql://cart:cartpw@localhost:3306/cart -DATABASE=mysql://cart:cartpw@192.168.0.10:3306/cart_dev +DATABASE=mysql://cart:cartpw@localhost:3306/cart +# DATABASE=mysql://cart:cartpw@192.168.0.10:3306/cart_dev # // owner: dobromir.popov@gmail.com | Специално Свидетелстване София # // https://console.cloud.google.com/apis/credentials/oauthclient/926212607479-d3m8hm8f8esp3rf1639prskn445sa01v.apps.googleusercontent.com?project=grand-forge-108716 diff --git a/content/i18n/bg.json b/content/i18n/bg.json index 0198cda..22632aa 100644 --- a/content/i18n/bg.json +++ b/content/i18n/bg.json @@ -1,8 +1,10 @@ { "common": { + "appNameLong": "Специално свидетелстване на обществени места в София", + "contacts": "Контакти", "greeting": "Здравей", "farewell": "Довиждане", - "changeTo": "Смени на", + "changeTo": "-", "BG": "Български", "EN": "Английски", "RU": "Руски", @@ -30,6 +32,5 @@ "statistics": "Статистика", "coverMeLogs": "Замествания", "translations": "Преводи" - }, - "specialno-svidetelstvane-na-obshestveni-mesta-v-sofiya-kontakti": "Специално свидетелстване на обществени места в София - Контакти" + } } \ No newline at end of file diff --git a/content/i18n/ru.json b/content/i18n/ru.json index 8163927..a2f80ef 100644 --- a/content/i18n/ru.json +++ b/content/i18n/ru.json @@ -5,6 +5,10 @@ "changeTo": "Смени на", "BG": "[RU] Български", "EN": "[RU] Английски", - "RU": "[RU] Руски" + "RU": "[RU] Руски", + "login": "вход" + }, + "menu": { + "dashboard": "Начало" } } \ No newline at end of file diff --git a/next.config.js b/next.config.js index ac0f205..46f794f 100644 --- a/next.config.js +++ b/next.config.js @@ -50,8 +50,12 @@ module.exports = withPWA({ return config; }, - i18n: { // using https://next-intl-docs.vercel.app/docs/getting-started/pages-router + i18n: { + // next-intl + // https://next-intl-docs.vercel.app/docs/usage/messages + // using https://next-intl-docs.vercel.app/docs/getting-started/pages-router locales: ['bg', 'en', 'ru'], defaultLocale: 'bg', + autoDetect: false, }, }) \ No newline at end of file diff --git a/pages/contactUs.tsx b/pages/contactUs.tsx index b26dabd..b29af89 100644 --- a/pages/contactUs.tsx +++ b/pages/contactUs.tsx @@ -1,12 +1,14 @@ import React from 'react'; import Layout from "../components/layout"; import FeedbackForm from "../components/reports/FeedbackForm"; +import { useTranslations } from 'next-intl'; const ContactsPage = () => { + const t = useTranslations('common'); return (
-

{t('specialno-svidetelstvane-na-obshestveni-mesta-v-sofiya-kontakti')}

+

{t('appNameLong') - t('contacts')}