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:
Paul H
2026-06-19 15:35:32 +02:00
committed by Linus Rath
parent 3516d3c727
commit dda9fd1433
7 changed files with 3208 additions and 2 deletions
+1 -1
View File
@@ -103,7 +103,7 @@
## 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`.
+2
View File
@@ -17,6 +17,7 @@ import lvMessages from '@/locales/lv/common.json';
import nlMessages from '@/locales/nl/common.json';
import plMessages from '@/locales/pl/common.json';
import ptMessages from '@/locales/pt/common.json';
import roMessages from '@/locales/ro/common.json';
import ruMessages from '@/locales/ru/common.json';
import trMessages from '@/locales/tr/common.json';
import ukMessages from '@/locales/uk/common.json';
@@ -38,6 +39,7 @@ const ALL_MESSAGES = {
nl: nlMessages,
pl: plMessages,
pt: ptMessages,
ro: roMessages,
ru: ruMessages,
tr: trMessages,
uk: ukMessages,
+12
View File
@@ -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 */
export const flagComponents: Record<string, (props: FlagProps) => ReactElement> = {
cs: FlagCS,
@@ -238,6 +249,7 @@ export const flagComponents: Record<string, (props: FlagProps) => ReactElement>
nl: FlagNL,
pl: FlagPL,
pt: FlagBR,
ro: FlagRO,
ru: FlagRU,
tr: FlagTR,
uk: FlagUA,
+1
View File
@@ -20,6 +20,7 @@ const languages = [
{ value: 'nl', label: 'Nederlands' },
{ value: 'pl', label: 'Polski' },
{ value: 'pt', label: 'Português' },
{ value: 'ro', label: 'Română' },
{ value: 'tr', label: 'Türkçe' },
{ value: 'ru', label: 'Русский' },
{ value: 'uk', label: 'Українська' },
+3
View File
@@ -50,6 +50,9 @@ export default getRequestConfig(async ({ requestLocale }) => {
case 'pt':
messages = (await import('../locales/pt/common.json')).default;
break;
case 'ro':
messages = (await import('../locales/ro/common.json')).default;
break;
case 'ru':
messages = (await import('../locales/ru/common.json')).default;
break;
+1 -1
View File
@@ -12,7 +12,7 @@ const localePrefix = (process.env.NEXT_PUBLIC_LOCALE_PREFIX ?? 'never') as
| 'always'
| '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
// match any supported locale (and no NEXT_LOCALE cookie is set yet). Admins
File diff suppressed because it is too large Load Diff