Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
TranslationPluginMatchConfig.c
Go to the documentation of this file.
3{
4 protected string m_sFormat;
5 protected ref array<string> m_aPropertyNames;
6
7 protected static const int MAX_PROPERTIES_COUNT = 5;
8
9 //------------------------------------------------------------------------------------------------
10 override bool _WB_GetCustomTitle(BaseContainer source, out string title)
11 {
12 if (!m_sFormat.Contains("%") || m_aPropertyNames.IsEmpty())
13 {
14 title = m_sFormat;
15 return true;
16 }
17
18 foreach (int i, string propertyName : m_aPropertyNames)
19 {
20 if (i >= MAX_PROPERTIES_COUNT)
21 break;
22
23 if (!source.Get(propertyName, propertyName)) // variable reuse
24 return false;
25
26 m_aPropertyNames[i] = propertyName;
27 }
28
31
33 return true;
34 }
35
36 //------------------------------------------------------------------------------------------------
37 // constructor
40 void TranslationPluginFields(string format, notnull array<string> propertyNames)
41 {
42 m_sFormat = format;
43 m_aPropertyNames = propertyNames;
44 }
45}
46
47
48[BaseContainerProps(configRoot: true)]
49class TranslationPluginMatchConfig
51 //
52 // Fields
53 //
54
55 [Attribute(defvalue: "Id", desc: "[Mandatory] Id string field name", category: "Fields")]
56 string m_sIdField;
57
58 [Attribute(desc: "Comment string field name", category: "Fields")]
59 string m_sCommentField;
60
61 [Attribute(desc: "Gender int field name (0 = none, 1 = male, 2 = female, 3 = other) see EBaseStringTableItemGender", category: "Fields")]
62 string m_sGenderField;
63
64 [Attribute(desc: "Max length int field name", category: "Fields")]
65 string m_sMaxLengthField;
66
67 [Attribute(desc: "Skip bool field name", category: "Fields")]
68 string m_sSkipField;
69
70 //
71 // Locales
72 //
73
74 [Attribute(defvalue: "Source", desc: "[Mandatory] Source field from which to translate (string table item full field name, prefix and suffix included if needed)", category: "Locales")]
75 string m_sDefaultSource;
76
77 [Attribute(desc: "Edited source, waiting for translation (string table item full field name, prefix and suffix included if needed)", category: "Locales")]
78 string m_sDefaultSourceEdited;
79
80 [Attribute(desc: "Field prefix, to remove from locale fields's name to obtain the locale (e.g Target_ for Target_en_us = en_us)", category: "Locales")]
81 string m_sLocaleFieldsPrefix;
82
83 [Attribute(desc: "Field suffix, to remove from locale fields's name to obtain the locale (e.g _final for en_us_final = en_us)", category: "Locales")]
84 string m_sLocaleFieldsSuffix;
86 [Attribute(desc: "File-Server locales matching - e.g \"english\" → \"en_gb\"", category: "Locales")]
87 ref array<ref TranslationPluginConfigLocaleMatch> m_aLocalesDictionary;
88}
89
90[BaseContainerProps(), TranslationPluginFields("%1 → %2", { "m_sFileLocale", "m_sServerLocale" })]
92{
93 [Attribute(defvalue: "english", desc: "Locale of the table - attribute name minus prefix/suffix (e.g Target_en_US_final - Target_ - _final = en_US)")]
94 string m_sFileLocale;
95
96 [Attribute(defvalue: "en_us", desc: "Locale expected by the server (format: en_gb, fr_ca, etc)")]
97 string m_sServerLocale;
98}
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
void TranslationPluginFields(string format, notnull array< string > propertyNames)
void TranslationPluginFields(string format, notnull array< string > propertyNames)
override bool _WB_GetCustomTitle(BaseContainer source, out string title)
SCR_FieldOfViewSettings Attribute