Reference · The realistic Earth's pure parts
countryNameTextfunction
The name to write for a country: its Japanese name on a page in Japanese where there is one, else its English name in capitals.
Import it
import { countryNameText } from "@johnmorrisdotca/chikyu-earth/realistic";
Definition
function countryNameText(country: { name: { en: string; ja?: string; }; }, lang: "en" | "ja"): string
Parameters
| Name | Type | Description |
|---|---|---|
country | { name: { en: string; ja?: string; }; } | The country's names. |
lang | "en" | "ja" | The page's language, |
Returns
string
The text.
Examples
import { countryNameText } from "@johnmorrisdotca/chikyu-earth/realistic";
const japan = { name: { en: "Japan", ja: "日本" } };
console.log(countryNameText(japan, "en"), countryNameText(japan, "ja"));JAPAN 日本What it prints (run when this page was built)