Reference · Military flags (naval ensigns, jacks and war flags)
militaryNamefunction
A flag's name, in English or Japanese: the country and what the flag is. Any language tag that starts with ja is Japanese.
Import it
import { militaryName } from "@johnmorrisdotca/hata/military";
Definition
function militaryName(id: string, lang?: string): string | null
Parameters
| Name | Type | Description |
|---|---|---|
id | string | A flag's id, in any case, with or without |
lang (optional) | string |
|
Returns
string | null
The name, or null when the set has no such flag.
Examples
import { militaryName } from "@johnmorrisdotca/hata/military";
console.log(militaryName("mil:gb-white-ensign")); // "United Kingdom: White Ensign"
console.log(militaryName("mil:gb-white-ensign", "ja")); // "イギリス:ホワイト・エンサイン(軍艦旗)"United Kingdom: White Ensign
イギリス:ホワイト・エンサイン(軍艦旗)What it prints (run when this page was built)