DayZ 1.24
Loading...
Searching...
No Matches
CheckLocalisationPlugin Class Reference
Inheritance diagram for CheckLocalisationPlugin:
[legend]
Collaboration diagram for CheckLocalisationPlugin:
[legend]

Private Member Functions

void FindTexts (WidgetSource src)
 
void CheckTextIDs (string file)
 
override void Run ()
 

Private Attributes

ref array< stringm_results = new array<string>
 
WBModuleDef m_module
 

Detailed Description

Definition at line 2 of file CheckLocTool.c.

Member Function Documentation

◆ CheckTextIDs()

void CheckLocalisationPlugin::CheckTextIDs ( string file)
inlineprivate

Definition at line 25 of file CheckLocTool.c.

26 {
29 int lastIndex = m_results.Count();
31 if (lastIndex != m_results.Count())
32 {
33 m_results.InsertAt(file + ":", lastIndex);
34 m_results.Insert("");
35 }
36 }
void FindTexts(WidgetSource src)
Definition CheckLocTool.c:7
ref array< string > m_results
Definition CheckLocTool.c:4
proto native external bool SetOpenedResource(string filename)
proto native external BaseContainer GetContainer(int index=0)

References WBModuleDef::GetContainer(), and WBModuleDef::SetOpenedResource().

◆ FindTexts()

void CheckLocalisationPlugin::FindTexts ( WidgetSource src)
inlineprivate

Definition at line 7 of file CheckLocTool.c.

8 {
9 if (src)
10 {
11 int idx = src.VarIndex("text");
12
13 if (idx != -1)
14 {
15 string text;
16 if (src.Get(idx, text) && !text.Contains("#"))
17 m_results.Insert("Text = \"" + text + "\" in Widget: " + src.GetName());
18 }
19
20 FindTexts(src.GetChildren());
21 FindTexts(src.GetSibling());
22 }
23 }

◆ Run()

override void CheckLocalisationPlugin::Run ( )
inlineprivate

Definition at line 38 of file CheckLocTool.c.

39 {
40 m_module = Workbench.GetModule("ResourceManager");
42
43 if (m_results.Count())
44 {
45 string res;
46 foreach (string file: m_results)
47 {
48 res += file;
49 res += "\n";
50 }
51 }
52 else
53 res = "All texts are localised.";
54
55 Workbench.Dialog("Results", res);
56 }
void CheckTextIDs(string file)
static proto native void Dialog(string caption, string text)
static proto native WBModuleDef GetModule(string type)
static proto bool SearchResources(string filter, func callback)

References Workbench::Dialog(), Workbench::GetModule(), and Workbench::SearchResources().

Member Data Documentation

◆ m_module

WBModuleDef CheckLocalisationPlugin::m_module
private

Definition at line 5 of file CheckLocTool.c.

◆ m_results

ref array<string> CheckLocalisationPlugin::m_results = new array<string>
private

Definition at line 4 of file CheckLocTool.c.


The documentation for this class was generated from the following file: