feat(i18n): add Romanian (ro) locale
Adds locales/ro/common.json and wires ro through routing, request, intl-provider, the language switcher and the flag list. Plurals use Romanian one/few/other forms.
This commit is contained in:
+1
-1
@@ -103,7 +103,7 @@
|
|||||||
|
|
||||||
## Internationalization
|
## Internationalization
|
||||||
|
|
||||||
18 languages: Česky · Dansk · Deutsch · English · Español · Français · Italiano · Latviešu · Magyar · Nederlands · Polski · Português · Türkçe · Русский · Українська · 한국어 · 日本語 · 简体中文
|
19 languages: Česky · Dansk · Deutsch · English · Español · Français · Italiano · Latviešu · Magyar · Nederlands · Polski · Português · Română · Türkçe · Русский · Українська · 한국어 · 日本語 · 简体中文
|
||||||
|
|
||||||
Automatic browser detection with persistent preference. Configurable locale URL prefix via `NEXT_PUBLIC_LOCALE_PREFIX`.
|
Automatic browser detection with persistent preference. Configurable locale URL prefix via `NEXT_PUBLIC_LOCALE_PREFIX`.
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import lvMessages from '@/locales/lv/common.json';
|
|||||||
import nlMessages from '@/locales/nl/common.json';
|
import nlMessages from '@/locales/nl/common.json';
|
||||||
import plMessages from '@/locales/pl/common.json';
|
import plMessages from '@/locales/pl/common.json';
|
||||||
import ptMessages from '@/locales/pt/common.json';
|
import ptMessages from '@/locales/pt/common.json';
|
||||||
|
import roMessages from '@/locales/ro/common.json';
|
||||||
import ruMessages from '@/locales/ru/common.json';
|
import ruMessages from '@/locales/ru/common.json';
|
||||||
import trMessages from '@/locales/tr/common.json';
|
import trMessages from '@/locales/tr/common.json';
|
||||||
import ukMessages from '@/locales/uk/common.json';
|
import ukMessages from '@/locales/uk/common.json';
|
||||||
@@ -38,6 +39,7 @@ const ALL_MESSAGES = {
|
|||||||
nl: nlMessages,
|
nl: nlMessages,
|
||||||
pl: plMessages,
|
pl: plMessages,
|
||||||
pt: ptMessages,
|
pt: ptMessages,
|
||||||
|
ro: roMessages,
|
||||||
ru: ruMessages,
|
ru: ruMessages,
|
||||||
tr: trMessages,
|
tr: trMessages,
|
||||||
uk: ukMessages,
|
uk: ukMessages,
|
||||||
|
|||||||
@@ -222,6 +222,17 @@ export function FlagDK(props: FlagProps) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Romania – Vertical blue, yellow, red tricolour */
|
||||||
|
export function FlagRO(props: FlagProps) {
|
||||||
|
return (
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 3 2" width={W} height={H} className={flagClass} {...props}>
|
||||||
|
<rect width="1" height="2" fill="#002B7F" />
|
||||||
|
<rect x="1" width="1" height="2" fill="#FCD116" />
|
||||||
|
<rect x="2" width="1" height="2" fill="#CE1126" />
|
||||||
|
</svg>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/** Map locale codes to flag components */
|
/** Map locale codes to flag components */
|
||||||
export const flagComponents: Record<string, (props: FlagProps) => ReactElement> = {
|
export const flagComponents: Record<string, (props: FlagProps) => ReactElement> = {
|
||||||
cs: FlagCS,
|
cs: FlagCS,
|
||||||
@@ -238,6 +249,7 @@ export const flagComponents: Record<string, (props: FlagProps) => ReactElement>
|
|||||||
nl: FlagNL,
|
nl: FlagNL,
|
||||||
pl: FlagPL,
|
pl: FlagPL,
|
||||||
pt: FlagBR,
|
pt: FlagBR,
|
||||||
|
ro: FlagRO,
|
||||||
ru: FlagRU,
|
ru: FlagRU,
|
||||||
tr: FlagTR,
|
tr: FlagTR,
|
||||||
uk: FlagUA,
|
uk: FlagUA,
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ const languages = [
|
|||||||
{ value: 'nl', label: 'Nederlands' },
|
{ value: 'nl', label: 'Nederlands' },
|
||||||
{ value: 'pl', label: 'Polski' },
|
{ value: 'pl', label: 'Polski' },
|
||||||
{ value: 'pt', label: 'Português' },
|
{ value: 'pt', label: 'Português' },
|
||||||
|
{ value: 'ro', label: 'Română' },
|
||||||
{ value: 'tr', label: 'Türkçe' },
|
{ value: 'tr', label: 'Türkçe' },
|
||||||
{ value: 'ru', label: 'Русский' },
|
{ value: 'ru', label: 'Русский' },
|
||||||
{ value: 'uk', label: 'Українська' },
|
{ value: 'uk', label: 'Українська' },
|
||||||
|
|||||||
@@ -50,6 +50,9 @@ export default getRequestConfig(async ({ requestLocale }) => {
|
|||||||
case 'pt':
|
case 'pt':
|
||||||
messages = (await import('../locales/pt/common.json')).default;
|
messages = (await import('../locales/pt/common.json')).default;
|
||||||
break;
|
break;
|
||||||
|
case 'ro':
|
||||||
|
messages = (await import('../locales/ro/common.json')).default;
|
||||||
|
break;
|
||||||
case 'ru':
|
case 'ru':
|
||||||
messages = (await import('../locales/ru/common.json')).default;
|
messages = (await import('../locales/ru/common.json')).default;
|
||||||
break;
|
break;
|
||||||
|
|||||||
+1
-1
@@ -12,7 +12,7 @@ const localePrefix = (process.env.NEXT_PUBLIC_LOCALE_PREFIX ?? 'never') as
|
|||||||
| 'always'
|
| 'always'
|
||||||
| 'as-needed';
|
| 'as-needed';
|
||||||
|
|
||||||
const SUPPORTED_LOCALES = ['cs', 'da', 'de', 'en', 'es', 'fr', 'hu', 'it', 'ja', 'ko', 'lv', 'nl', 'pl', 'pt', 'ru', 'tr', 'uk', 'zh'] as const;
|
const SUPPORTED_LOCALES = ['cs', 'da', 'de', 'en', 'es', 'fr', 'hu', 'it', 'ja', 'ko', 'lv', 'nl', 'pl', 'pt', 'ro', 'ru', 'tr', 'uk', 'zh'] as const;
|
||||||
|
|
||||||
// Fallback locale used when the visitor's Accept-Language header does not
|
// Fallback locale used when the visitor's Accept-Language header does not
|
||||||
// match any supported locale (and no NEXT_LOCALE cookie is set yet). Admins
|
// match any supported locale (and no NEXT_LOCALE cookie is set yet). Admins
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user