Reference · Views, replay and player
roleNamefunction
Returns a localized piece label, with a readable fallback for unknown roles.
Import it
import { roleName } from "@johnmorrisdotca/gunjin";
Definition
function roleName(language: Language, role: string): string
Parameters
| Name | Type | Description |
|---|---|---|
language | Language | The native English or Japanese display language. |
role | string | The native role identifier to label. |
Returns
string
Returns a localized piece label, with a readable fallback for unknown roles.
Examples
import { roleName } from "@johnmorrisdotca/gunjin";
console.log(roleName("ja","leader"));指揮官What it prints (run when this page was built)