Skip to content

API reference / @jsprismarine/java-packs / lang

lang ​

Functions ​

javaLanguageOf() ​

javaLanguageOf(files, locale): Map<string, string>

Defined in: lang.ts:46

The Bedrock keys and their text in one locale of a converted Java pack, as assets/bedrock/lang/<locale>.json holds them. Empty when the pack has no such file or it does not read.

Parameters ​

files ​

ReadonlyMap<string, Uint8Array<ArrayBufferLike>>

The converted pack's files, by path.

locale ​

string

The Java locale, such as en_us.

Returns ​

Map<string, string>


javaLocaleOf() ​

javaLocaleOf(path): string | undefined

Defined in: lang.ts:34

The Java locale a Bedrock language file is for: texts/en_US.lang is en_us. Undefined for a file that is not a language file at the top of texts/.

Parameters ​

path ​

string

Returns ​

string | undefined


parseLang() ​

parseLang(text): Map<string, string>

Defined in: lang.ts:15

Reads a .lang file: one key=value a line. A line starting ## is a comment, and so is whatever follows a tab and ## on a line. Everything else, %s and %d included, stays as written.

Parameters ​

text ​

string

Returns ​

Map<string, string>