/
Translation.hx
69 lines (57 loc) · 1.62 KB
/
Translation.hx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
// Automatically generated Godot externs: DO NOT EDIT
// MIT licensed, see LICENSE.md
package godot;
import cs.system.*;
/**
Translations are resources that can be loaded and unloaded on demand. They map a string to another string.
**/
@:libType
@:csNative
@:native("Godot.Translation")
@:autoBuild(godot.Godot.buildUserClass())
extern class Translation extends godot.Resource {
/**
The locale of the translation.
**/
@:native("Locale")
public var locale:std.String;
@:native("Messages")
public var messages:cs.NativeArray<std.String>;
@:native("new")
public function new():Void;
/**
Virtual method to override `godot.Translation.getMessage`.
**/
@:native("_GetMessage")
public function _GetMessage(srcMessage:std.String):std.String;
@:native("SetLocale")
public function setLocale(locale:std.String):Void;
@:native("GetLocale")
public function getLocale():std.String;
/**
Adds a message if nonexistent, followed by its translation.
**/
@:native("AddMessage")
public function addMessage(srcMessage:std.String, xlatedMessage:std.String):Void;
/**
Returns a message's translation.
**/
@:native("GetMessage")
public function getMessage(srcMessage:std.String):std.String;
/**
Erases a message.
**/
@:native("EraseMessage")
public function eraseMessage(srcMessage:std.String):Void;
/**
Returns all the messages (keys).
**/
public extern inline function getMessageList():std.Array<std.String> {
return cs.Lib.array(cs.Syntax.code("{0}.GetMessageList()", this));
}
/**
Returns the number of existing messages.
**/
@:native("GetMessageCount")
public function getMessageCount():Int;
}