DEKI/ENGINE docs
manual api reference
Deki 0.40.1
Modular C++ engine with a visual editor, for 2D and 3D
Loading...
Searching...
No Matches
DekiEditor::Localization Namespace Reference

The languages the editor offers and which one is in use. More...

Classes

struct  Language
 A language the editor offers: its code and its name in that language. More...
class  ScopedPackage
 While it lives, Tr and TrLabel look in package's own table first, so text a package's class shows (its component, property and enum names) reads as that package translates it even when the editor or another package translates the same English word differently: deki-fsm's "Add" (an arithmetic operation) is not the editor's "Add" button. More...

Functions

void AddTableDirectory (const std::string &dir, const std::string &package="")
 Adds the translations in dir/.json and in every file of dir//.
const std::string & Current ()
 The language text is shown in, such as "en" or "ja".
uint32_t Generation ()
 Changes whenever the language or a table changes, for caches of translated text.
const std::vector< Language > & Languages ()
 Every language the editor offers, English first.
void Load ()
 Reads the language saved in the editor settings and the editor's own tables.
void SetLanguage (const std::string &code)
 Shows text in another language from now on and remembers it for the next session.
void UseLanguage (const std::string &code)
 Shows text in another language for this session only, without saving it.

Detailed Description

The languages the editor offers and which one is in use.

Function Documentation

◆ AddTableDirectory()

void DekiEditor::Localization::AddTableDirectory ( const std::string & dir,
const std::string & package = "" )

Adds the translations in dir/.json and in every file of dir//.

They go into one shared table, where a key the editor (or an earlier package) already translates keeps that translation. With a package ("deki-fsm"), they are also that package's own table, which wins inside its ScopedPackage.

◆ Current()

const std::string & DekiEditor::Localization::Current ( )

The language text is shown in, such as "en" or "ja".

◆ Generation()

uint32_t DekiEditor::Localization::Generation ( )

Changes whenever the language or a table changes, for caches of translated text.

◆ Languages()

const std::vector< Language > & DekiEditor::Localization::Languages ( )

Every language the editor offers, English first.

◆ Load()

void DekiEditor::Localization::Load ( )

Reads the language saved in the editor settings and the editor's own tables.

Called once at startup, after the settings load.

◆ SetLanguage()

void DekiEditor::Localization::SetLanguage ( const std::string & code)

Shows text in another language from now on and remembers it for the next session.

An unknown code means English.

◆ UseLanguage()

void DekiEditor::Localization::UseLanguage ( const std::string & code)

Shows text in another language for this session only, without saving it.

An unknown code means English.