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

cityNameTextfunction

The name to write for a city: Japanese on a page in Japanese where kuni has it (the short form, 東京 for 東京都, when kuni gives one), else English.

Import it

import { cityNameText } from "@johnmorrisdotca/chikyu-earth/realistic";

Definition

function cityNameText(city: { name: { en: string; ja?: string; jaShort?: string; }; }, lang: "en" | "ja"): string

Parameters

NameTypeDescription
city{ name: { en: string; ja?: string; jaShort?: string; }; }

The city.

lang"en" | "ja"

The page's language, en or ja.

Returns

string

The name.

Examples

import { cityNameText } from "@johnmorrisdotca/chikyu-earth/realistic";

const osaka = { name: { en: "Osaka", ja: "大阪市" } };
console.log(cityNameText(osaka, "en"), cityNameText(osaka, "ja"), cityNameText({ name: { en: "Paris" } }, "ja"));
Osaka 大阪市 Paris

What it prints (run when this page was built)

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