LangFile - DauntlessStudio/Bedrock-Developments GitHub Wiki

Class: LangFile

Remarks

A class for working with lang files.

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new LangFile(filepattern): LangFile

Parameters

Name Type Description
filepattern string The glob pattern to find lang files with. If no files match the pattern, a default en_US.lang file will be created automatically.

Returns

LangFile

Remarks

Gets a list of files from a glob pattern. Note that any valid pattern will work and the file will be treated as a lang file, even without the .lang extension.

Defined in

ts/app/types/minecraft.ts:143

Properties

files

files: File[]

Remarks

The lang files handled by this class instance, as an array of Files.

Defined in

ts/app/types/minecraft.ts:137

Methods

addToCategory

addToCategory(categoryName, ...entries): void

Parameters

Name Type Description
categoryName string The category to add an entry to, i.e. Item Names.
...entries string[] Entries to add to that category, i.e. item.minecraft:test.name=Test.

Returns

void

Remarks

Adds an entry to all the .lang file in this object's files list.

Defined in

ts/app/types/minecraft.ts:169


addToAllLangs

addToAllLangs(categoryName, ...entries): LangFile

Parameters

Name Type Description
categoryName string The category to add an entry to, i.e. Item Names.
...entries string[] Entries to add to that category, i.e. item.minecraft:test.name=Test.

Returns

LangFile

A new LangFile object with every .lang file in the RP/texts directory, having added the entries.

Remarks

Adds a lang file entry to every .lang file in RP/texts.

Defined in

ts/app/types/minecraft.ts:158

⚠️ **GitHub.com Fallback** ⚠️