Skip to the content

Chikyu Earth地球

A line-drawn globe of the world's countries that turns at the Earth's own rate, with an optional realistic Earth from space and markers for any place.

Chikyu is the Japanese word 地球 for the Earth. About the name

Contents

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

NameTypeDescription
country{ name: { en: string; ja?: string; }; }

The country's names.

lang"en" | "ja"

The page's language, en or ja.

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)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/chikyu-earth 0.51.1.