Skip to the content

Hata旗

Load a native country or region flag, choose supported framing and keep each drawing’s source, author and licence.

Hata (旗) is Japanese for a flag. About the name

Contents

Reference · Flags a page registers itself

customNamefunction

A custom flag's name, in English or Japanese (any tag that starts ja); the English where no Japanese was given.

Import it

import { customName } from "@johnmorrisdotca/hata/custom";

Definition

function customName(id: string, lang?: string): string | null

Parameters

NameTypeDescription
idstring

The flag's id, in any case.

lang (optional)string

"en" (the default), "ja" or a tag such as "ja-JP".

Returns

string | null

The name, or null when no such flag is registered.

Examples

import { customName } from "@johnmorrisdotca/hata/custom";

console.log(customName("custom:nothing-here", "ja")); // null
null

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/hata 1.31.0.