mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-04-21 06:29:29 -05:00
13 lines
367 B
TypeScript
13 lines
367 B
TypeScript
// .server because these are dangerous to use on client due to hydration mismatches
|
|
// (Node.js and browser can display different language depending on implementation)
|
|
|
|
export function translatedCountry({
|
|
language,
|
|
countryCode,
|
|
}: {
|
|
language: string;
|
|
countryCode: string;
|
|
}) {
|
|
return new Intl.DisplayNames([language], { type: "region" }).of(countryCode);
|
|
}
|