Merge pull request #1629 from thecodingmachine/translator
Translator: i18n
This commit is contained in:
commit
2312d2e129
83 changed files with 1438 additions and 307 deletions
|
@ -13,6 +13,12 @@ export const setPlayerName = (name: string) => {
|
|||
playerName = name;
|
||||
};
|
||||
|
||||
let playerLanguage: string | undefined;
|
||||
|
||||
export const setPlayerLanguage = (language: string | undefined) => {
|
||||
playerLanguage = language;
|
||||
};
|
||||
|
||||
let tags: string[] | undefined;
|
||||
|
||||
export const setTags = (_tags: string[]) => {
|
||||
|
@ -61,6 +67,15 @@ export class WorkadventurePlayerCommands extends IframeApiContribution<Workadven
|
|||
return playerName;
|
||||
}
|
||||
|
||||
get language(): string {
|
||||
if (playerLanguage === undefined) {
|
||||
throw new Error(
|
||||
"Player language not initialized yet. You should call WA.player.language within a WA.onInit callback."
|
||||
);
|
||||
}
|
||||
return playerLanguage;
|
||||
}
|
||||
|
||||
get tags(): string[] {
|
||||
if (tags === undefined) {
|
||||
throw new Error("Tags not initialized yet. You should call WA.player.tags within a WA.onInit callback.");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue