From f76cc50c79077a2943ac7a86bd4f0ada00983537 Mon Sep 17 00:00:00 2001 From: Joko Date: Thu, 26 Mar 2020 13:30:47 +0100 Subject: [PATCH] Stringtables (#84) * Add First Stringtable work * move more strings to stringtable * add Localization support to showDialog * move some more stuff to stringtables * move some more stuff to stringtables * fix a regex issue * add some more L10n * add some more L10n * add some more L10n * add stringtable_validator * add StringtableValidator to github Actions * update step name * add translation issue autoupdate * update * move stringtables to main workflow * STRINGTABLES * STRINGTABLES * STRINGTABLES * STRINGTABLES * STRINGTABLES * STRINGTABLES * STRINGTABLES * STRINGTABLES * STRINGTABLES * STRINGTABLES * linter fix * STRINGTABLES * STRINGTABLES * add CfgSettings for CBA min Version Requirment fix some Case issues * - Fixed missing module descriptions (damned brs!) - Fixed missing taskReset module description * add 2 missed Strings * update Arma Workflow Co-authored-by: nkenny --- .github/workflows/main.yml | 23 +- addons/danger/Cfg3DEN.hpp | 8 +- addons/danger/CfgVehicles.hpp | 6 +- addons/danger/config.cpp | 2 +- .../ZeusModules/fnc_moduleDisableAI.sqf | 10 +- .../ZeusModules/fnc_moduleDisableGroupAI.sqf | 8 +- .../ZeusModules/fnc_moduleSetRadio.sqf | 10 +- addons/danger/settings.sqf | 58 ++-- addons/danger/stringtable.xml | 200 ++++++++++++++ addons/eventhandlers/config.cpp | 2 +- addons/eventhandlers/settings.sqf | 6 +- addons/eventhandlers/stringtable.xml | 20 ++ addons/main/config.cpp | 2 +- addons/main/functions/fnc_showDialog.sqf | 32 ++- addons/main/script_macros.hpp | 2 +- addons/main/stringtable.xml | 29 ++ addons/wp/Cfg3DEN.hpp | 6 +- addons/wp/config.cpp | 2 +- .../functions/Modules/fnc_moduleArtillery.sqf | 50 ++-- .../Modules/fnc_moduleArtilleryRegister.sqf | 8 +- .../functions/Modules/fnc_moduleAssault.sqf | 22 +- addons/wp/functions/Modules/fnc_moduleCQB.sqf | 20 +- .../wp/functions/Modules/fnc_moduleCamp.sqf | 14 +- .../wp/functions/Modules/fnc_moduleCreep.sqf | 12 +- .../functions/Modules/fnc_moduleGarrison.sqf | 14 +- .../wp/functions/Modules/fnc_moduleHunt.sqf | 12 +- .../wp/functions/Modules/fnc_modulePatrol.sqf | 22 +- .../wp/functions/Modules/fnc_moduleReset.sqf | 4 +- .../wp/functions/Modules/fnc_moduleRush.sqf | 12 +- addons/wp/modules.hpp | 119 ++++---- addons/wp/settings.sqf | 4 +- addons/wp/stringtable.xml | 260 ++++++++++++++++++ addons/wp/zeusModules.hpp | 24 +- tools/stringtableDeploy.py | 60 ++++ tools/stringtable_validator.py | 186 +++++++++++++ tools/stringtablediag.py | 123 +++++++++ 36 files changed, 1152 insertions(+), 240 deletions(-) create mode 100644 addons/danger/stringtable.xml create mode 100644 addons/eventhandlers/stringtable.xml create mode 100644 addons/main/stringtable.xml create mode 100644 addons/wp/stringtable.xml create mode 100644 tools/stringtableDeploy.py create mode 100644 tools/stringtable_validator.py create mode 100644 tools/stringtablediag.py diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b101d4f8..6595f752 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,6 +1,6 @@ -name: CI +name: Arma -on: [push] +on: [push, pull_request] jobs: validate: @@ -43,3 +43,22 @@ jobs: with: name: '@LambsDanger' path: 'releases/@LambsDanger.zip' + + stringtables: + runs-on: ubuntu-latest + steps: + - name: Install Python packages + run: | + pip3 install wheel + pip3 install setuptools + pip3 install pygithub + pip3 install pygithub3 + - name: Checkout the source code + uses: actions/checkout@master + - name: Validate Stringtables + run: python3 tools/stringtable_validator.py + - name: Update Translation issue + if: github.repository == 'nk3nny/LambsDanger' && github.branch == 'master' && ! contains(github.event.head_commit.message, '[ci skip]') + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: python3 tools/stringtableDeploy.py diff --git a/addons/danger/Cfg3DEN.hpp b/addons/danger/Cfg3DEN.hpp index 52b85228..3da203c9 100644 --- a/addons/danger/Cfg3DEN.hpp +++ b/addons/danger/Cfg3DEN.hpp @@ -8,8 +8,8 @@ class Cfg3DEN { class GVAR(disableAI) { property = QGVAR(disableAI); control = "Checkbox"; - displayName = "AI Disabled"; - tooltip = "Unit has advanced danger.fsm features disabled\n\nWARNING checking this will add mod dependency"; + displayName = CSTRING(3DEN_Attributes_DisableAI_DisplayName); + tooltip = CSTRING(3DEN_Attributes_DisableAI_ToolTip); expression = "if (_value) then { _this setVariable ['%s', _value, true]; }"; typeName = "BOOL"; condition = "objectBrain"; @@ -18,8 +18,8 @@ class Cfg3DEN { class GVAR(dangerRadio) { property = QGVAR(dangerRadio); control = "Checkbox"; - displayName = "Has Radio"; - tooltip = "Unit counts as carrying backpack radio for information sharing\n\nWARNING checking this will add mod dependency"; + displayName = CSTRING(3DEN_Attributes_HasRadio_DisplayName); + tooltip = CSTRING(3DEN_Attributes_HasRadio_ToolTip); expression = "if (_value) then { _this setVariable ['%s', _value, true]; }"; typeName = "BOOL"; condition = "objectBrain"; diff --git a/addons/danger/CfgVehicles.hpp b/addons/danger/CfgVehicles.hpp index 241dac70..4d5b8842 100644 --- a/addons/danger/CfgVehicles.hpp +++ b/addons/danger/CfgVehicles.hpp @@ -21,8 +21,8 @@ class CfgVehicles { _generalMacro = QGVAR(SetRadio); scope = 1; scopeCurator = 2; + displayName = CSTRING(Module_SetRadio_DisplayName); isGlobal = 0; - displayName = "Configure Long-range Radio"; category = "Lambs_Danger_Cat"; icon = "\A3\ui_f\data\igui\cfg\simpleTasks\types\intel_ca.paa"; function = QFUNC(moduleSetRadio); @@ -39,8 +39,8 @@ class CfgVehicles { _generalMacro = QGVAR(DisableAI); scope = 1; scopeCurator = 2; + displayName = CSTRING(Module_DisableAI_DisplayName); isGlobal = 0; - displayName = "Disable Unit AI"; category = "Lambs_Danger_Cat"; icon = "\A3\ui_f\data\igui\cfg\simpleTasks\types\intel_ca.paa"; function = QFUNC(moduleDisableAI); @@ -56,8 +56,8 @@ class CfgVehicles { _generalMacro = QGVAR(DisableGroupAI); scope = 1; scopeCurator = 2; + displayName = CSTRING(Module_DisableGroupAI_DisplayName); isGlobal = 0; - displayName = "Configure Group AI"; category = "Lambs_Danger_Cat"; icon = "\A3\ui_f\data\igui\cfg\simpleTasks\types\intel_ca.paa"; function = QFUNC(moduleDisableGroupAI); diff --git a/addons/danger/config.cpp b/addons/danger/config.cpp index 6e966c4e..085fc853 100644 --- a/addons/danger/config.cpp +++ b/addons/danger/config.cpp @@ -6,7 +6,7 @@ class CfgPatches { weapons[] = {}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"lambs_main"}; - author = "LAMBS Dev Team"; + author = ECSTRING(main,Team); VERSION_CONFIG; }; }; diff --git a/addons/danger/functions/ZeusModules/fnc_moduleDisableAI.sqf b/addons/danger/functions/ZeusModules/fnc_moduleDisableAI.sqf index 8a503415..a796b45a 100644 --- a/addons/danger/functions/ZeusModules/fnc_moduleDisableAI.sqf +++ b/addons/danger/functions/ZeusModules/fnc_moduleDisableAI.sqf @@ -10,15 +10,15 @@ if (_activated && local _logic) then { //--- Check if the unit is suitable private _error = ""; if (isNull _unit) then { - _error = "No Unit Selected"; + _error = ELSTRING(main,NoUnitSelected); }; if (isPlayer _unit) then { - _error = "Players are not Valid Selections"; + _error = ELSTRING(main,PlayerNotValid); }; if (_error == "") then { - ["Disable Unit AI", + [LSTRING(Module_DisableAI_DisplayName), [ - ["Disable LAMBS unit AI", "BOOLEAN", "Toggle advanced danger.fsm features on this unit", _unit getVariable [QGVAR(disableAI), false]] + [LSTRING(Module_DisableAI_SettingName), "BOOLEAN", LSTRING(Module_DisableAI_SettingToolTip), _unit getVariable [QGVAR(disableAI), false]] ], { params ["_data", "_args"]; _args params ["_unit", "_logic"]; @@ -34,7 +34,7 @@ if (_activated && local _logic) then { }, [_unit, _logic] ] call EFUNC(main,showDialog); } else { - [objNull, _error] call BIS_fnc_showCuratorFeedbackMessage; + [objNull, localize _error] call BIS_fnc_showCuratorFeedbackMessage; deleteVehicle _logic; }; }; diff --git a/addons/danger/functions/ZeusModules/fnc_moduleDisableGroupAI.sqf b/addons/danger/functions/ZeusModules/fnc_moduleDisableGroupAI.sqf index 0d755057..9ac269c0 100644 --- a/addons/danger/functions/ZeusModules/fnc_moduleDisableGroupAI.sqf +++ b/addons/danger/functions/ZeusModules/fnc_moduleDisableGroupAI.sqf @@ -10,13 +10,13 @@ if (_activated && local _logic) then { //--- Check if the unit is suitable private _error = ""; if (isNull _group) then { - _error = "No Group Selected"; + _error = ELSTRING(main,NoGroupSelected); }; if (_error == "") then { - ["Configure Group AI", + [LSTRING(Module_DisableGroupAI_DisplayName), [ - ["Disable LAMBS group AI", "BOOLEAN", "Disables LAMBS group AI\nDisabling this feature prevents autonomous building assaults and clearing, as well as hiding from aircraft and tanks", _group getVariable [QGVAR(disableGroupAI), false], ""] + [LSTRING(Module_DisableGroupAI_SettingName), "BOOLEAN", LSTRING(Module_DisableGroupAI_SettingToolTip), _group getVariable [QGVAR(disableGroupAI), false], ""] ], { params ["_data", "_args"]; _args params ["_group", "_logic"]; @@ -32,7 +32,7 @@ if (_activated && local _logic) then { }, [_group, _logic] ] call EFUNC(main,showDialog); } else { - [objNull, _error] call BIS_fnc_showCuratorFeedbackMessage; + [objNull, localize _error] call BIS_fnc_showCuratorFeedbackMessage; deleteVehicle _logic; }; }; diff --git a/addons/danger/functions/ZeusModules/fnc_moduleSetRadio.sqf b/addons/danger/functions/ZeusModules/fnc_moduleSetRadio.sqf index 47788a1c..41efb9ec 100644 --- a/addons/danger/functions/ZeusModules/fnc_moduleSetRadio.sqf +++ b/addons/danger/functions/ZeusModules/fnc_moduleSetRadio.sqf @@ -10,15 +10,15 @@ if (_activated && local _logic) then { //--- Check if the unit is suitable private _error = ""; if (isNull _unit) then { - _error = "No Unit Seleted"; + _error = ELSTRING(main,NoUnitSelected); }; if (isPlayer _unit) then { - _error = "Players are not Valid Selections"; + _error = ELSTRING(main,PlayerNotValid); }; if (_error == "") then { - ["Configure Long-range Radio", + [LSTRING(Module_SetRadio_DisplayName), [ - ["Toggle boosted communication range on unit", "BOOLEAN", "Unit with radio toggled have boosted communications range when sharing information\nThis effect is also achieved by equipping the unit with a Vanilla Radio Backpack or TFAR-mod enabled radio.", _unit getVariable [QGVAR(dangerRadio), false]] + [LSTRING(Module_SetRadio_SettingName), "BOOLEAN", LSTRING(Module_SetRadio_SettingToolTip), _unit getVariable [QGVAR(dangerRadio), false]] ], { params ["_data", "_args"]; _args params ["_unit", "_logic"]; @@ -34,7 +34,7 @@ if (_activated && local _logic) then { }, [_unit, _logic] ] call EFUNC(main,showDialog); } else { - [objNull, _error] call BIS_fnc_showCuratorFeedbackMessage; + [objNull, localize _error] call BIS_fnc_showCuratorFeedbackMessage; deleteVehicle _logic; }; }; diff --git a/addons/danger/settings.sqf b/addons/danger/settings.sqf index cb9cb243..4a85b9c8 100644 --- a/addons/danger/settings.sqf +++ b/addons/danger/settings.sqf @@ -1,9 +1,9 @@ -private _curCat = "Settings"; +private _curCat = LSTRING(Settings_MainCat); // Toggle advanced danger.fsm features on player group [ QGVAR(disableAIPlayerGroup), "CHECKBOX", - ["Disable danger.fsm for player group", "Toggle advanced danger.fsm features on player group"], + [LSTRING(Settings_DisableDangerFSM), LSTRING(Settings_DisableDangerFSM_ToolTip)], [COMPONENT_NAME, _curCat], false, 0 // players may configure their own preferences @@ -13,7 +13,7 @@ private _curCat = "Settings"; [ QGVAR(disableAIPlayerGroupSuppression), "CHECKBOX", - ["Disable suppression from player group", "Toggle autonomous suppression for units in player group"], + [LSTRING(Settings_DisableSuppressionPlayerGroup), LSTRING(Settings_DisableSuppressionPlayerGroup_ToolTip)], [COMPONENT_NAME, _curCat], false, 0 @@ -23,7 +23,7 @@ private _curCat = "Settings"; [ QGVAR(disableAIPlayerGroupReaction), "CHECKBOX", - ["Disable reaction state on player group", "Toggle Reaction phase on units in player group"], + [LSTRING(Settings_DisableReactPlayerGroup), LSTRING(Settings_DisableReactPlayerGroup_ToolTip)], [COMPONENT_NAME, _curCat], false, 0 @@ -33,7 +33,7 @@ private _curCat = "Settings"; [ QGVAR(disableAIAutonomousManoeuvres), "CHECKBOX", - ["Disable autonomous group manoevures", "Toggles group manoevure phase initiated by AI squad leader. Disabling this will prevent AI group leader from adding manoevure orders to flank and suppress buildings."], + [LSTRING(Settings_DisableGroupManoevures), LSTRING(Settings_DisableGroupManoevures_ToolTip)], [COMPONENT_NAME, _curCat], false, 0 @@ -44,7 +44,7 @@ private _curCat = "Settings"; [ QGVAR(disableAIHideFromTanksAndAircraft), "CHECKBOX", - ["Disable units hiding", "Toggles the concealment move by AI for units not equipped to damage tanks and aircraft. Disabling this setting will make groups more responsive"], + [LSTRING(Settings_DisableUnitsHiding), LSTRING(Settings_DisableUnitsHiding_ToolTip)], [COMPONENT_NAME, _curCat], false, 0 @@ -54,7 +54,7 @@ private _curCat = "Settings"; [ QGVAR(disableAIGestures), "CHECKBOX", - ["Disable unit hand gestures", "Toggles unit gestures and hand signals when reacting to danger or executing planned manoevures"], + [LSTRING(Settings_DisableHandGestures), LSTRING(Settings_DisableHandGestures_Tooltip)], [COMPONENT_NAME, _curCat], false, 0 @@ -64,7 +64,7 @@ private _curCat = "Settings"; [ QGVAR(disableAIImediateAction), "CHECKBOX", - ["Disable unit immediate actions", "Toggles unit quickly dodging or changing stance in response to being hit.\nImmediate reactions force an animation to run. Disabling will make for a more static AI"], + [LSTRING(Settings_DisableImmediateActions), LSTRING(Settings_DisableImmediateActions_ToolTip)], [COMPONENT_NAME, _curCat], false, 0 @@ -74,7 +74,7 @@ private _curCat = "Settings"; [ QGVAR(disableAIFleeing), "CHECKBOX", - ["Disable enhanced unit fleeing", "Toggles enhanced fleeing function for units."], + [LSTRING(Settings_DisableEnhancedFleeing), LSTRING(Settings_DisableEnhancedFleeing_ToolTip)], [COMPONENT_NAME, _curCat], false, 0 @@ -84,18 +84,18 @@ private _curCat = "Settings"; [ QGVAR(disableAICallouts), "CHECKBOX", - ["Disable unit callouts", "Toggles extra unit callouts based on situations"], + [LSTRING(Settings_DisableCallouts), LSTRING(Settings_DisableCallouts_ToolTip)], [COMPONENT_NAME, _curCat], false, 0 ] call CBA_fnc_addSetting; -private _curCat = "General"; +private _curCat = LSTRING(Settings_GeneralCat); // Range at which units consider themselves in CQB [ QGVAR(CQB_range), "SLIDER", - ["CQB Range", "Range at which units consider themselves in assault range"], + [LSTRING(Settings_CQBRange), LSTRING(Settings_CQBRange_ToolTip)], [COMPONENT_NAME, _curCat], [25, 150, 50, 0], 1 @@ -105,7 +105,7 @@ private _curCat = "General"; [ QGVAR(minSuppression_range), "SLIDER", - ["Minimum Distance for Suppression Fire", "Within this distance AI will not perform suppression fire"], + [LSTRING(Settings_MinSuppressDistance), LSTRING(Settings_MinSuppressDistance_ToolTip)], [COMPONENT_NAME, _curCat], [1, 500, 20, 0], 1 @@ -115,19 +115,19 @@ private _curCat = "General"; [ QGVAR(panic_chance), "SLIDER", - ["Panic Chance", "Chance to panic in percentage"], + [LSTRING(Settings_PanicChance), LSTRING(Settings_PanicChance_ToolTip)], [COMPONENT_NAME, _curCat], [1, 100, 10, 0], 1 ] call CBA_fnc_addSetting; -private _curCat = "Settings Share information"; +private _curCat = LSTRING(Settings_ShareInformationCat); // Toggle communication for all units [ QGVAR(radio_disabled), "CHECKBOX", - ["Disable information sharing", "Toggle information sharing betweem units"], + [LSTRING(Settings_DisableInformationSharing), LSTRING(Settings_DisableInformationSharing_Tooltip)], [COMPONENT_NAME, _curCat], false, 0 @@ -137,7 +137,7 @@ private _curCat = "Settings Share information"; [ QGVAR(radio_shout), "SLIDER", - ["Shout", "Range AI units share information without radios"], + [LSTRING(Settings_Shout), LSTRING(Settings_Shout_ToolTip)], [COMPONENT_NAME, _curCat], [20, 200, 100, 0], 1 @@ -147,7 +147,7 @@ private _curCat = "Settings Share information"; [ QGVAR(radio_WEST), "SLIDER", - ["Base West", "Base range side WEST share information"], + [LSTRING(Settings_BaseWest), LSTRING(Settings_BaseWest_ToolTip)], [COMPONENT_NAME, _curCat], [200, 3000, 500, 0], 1 @@ -157,7 +157,7 @@ private _curCat = "Settings Share information"; [ QGVAR(radio_EAST), "SLIDER", - ["Base East", "Base range side EAST share information"], + [LSTRING(Settings_BaseEast), LSTRING(Settings_BaseEast_ToolTip)], [COMPONENT_NAME, _curCat], [200, 3000, 500, 0], 1 @@ -167,7 +167,7 @@ private _curCat = "Settings Share information"; [ QGVAR(radio_GUER), "SLIDER", - ["Base Independent", "Base range independent and civilian sides share information"], + [LSTRING(Settings_BaseIndependent), LSTRING(Settings_BaseIndependent_ToolTip)], [COMPONENT_NAME, _curCat], [200, 3000, 500, 0], 1 @@ -177,14 +177,14 @@ private _curCat = "Settings Share information"; [ QGVAR(radio_backpack), "SLIDER", - ["Backpack radios", "Range added to units wearing backpack radios (Vanilla, TFAR, or configured by variable)"], + [LSTRING(Settings_BackpackRadios), LSTRING(Settings_BackpackRadios_ToolTip)], [COMPONENT_NAME, _curCat], [500, 6000, 2000, 0], 1 ] call CBA_fnc_addSetting; // Configures CQC formations -_curCat = "Settings CQB Formations"; +_curCat = LSTRING(Settings_CQBFormationsCat); GVAR(allPossibleFormations) = ["COLUMN", "STAG COLUMN", "WEDGE", "ECH LEFT", "ECH RIGHT", "VEE", "LINE", "FILE", "DIAMOND"]; GVAR(CQB_formations) = ["FILE", "DIAMOND"]; // Special CQB Formations ) @@ -208,7 +208,7 @@ DFUNC(UpdateCQBFormations) = { [ format [QGVAR(CQB_formations_%1), _x], "CHECKBOX", - [_x, _x + " Units set to CQB formations will methodically clear buildings when an enemy is encountered"], + [_x, format ["%1 %2", _x, localize LSTRING(Settings_CQBFormation)]], [COMPONENT_NAME, _curCat], _x in GVAR(CQB_formations), 1, _code @@ -216,12 +216,12 @@ DFUNC(UpdateCQBFormations) = { } forEach GVAR(allPossibleFormations); // debug -_curCat = "Debug"; +_curCat = LSTRING(Settings_Debug); // FSM level debug messages [ QGVAR(debug_FSM), "CHECKBOX", - ["Debug FSM", "Shows FSM debug messages"], + [LSTRING(Settings_DebugFSM), LSTRING(Settings_DebugFSM_ToolTip)], [COMPONENT_NAME, _curCat], false, 1 @@ -231,7 +231,7 @@ _curCat = "Debug"; [ QGVAR(debug_functions), "CHECKBOX", - ["Debug Functions", "Shows Function debug messages"], + [LSTRING(Settings_DebugFunctions), LSTRING(Settings_DebugFunctions_ToolTip)], [COMPONENT_NAME, _curCat], false, 1 @@ -241,7 +241,7 @@ _curCat = "Debug"; [ QGVAR(debug_FSM_civ), "CHECKBOX", - ["Debug Civ", "Shows FSM debug messages for civilians"], + [LSTRING(Settings_DebugCiv), LSTRING(Settings_DebugCiv_ToolTip)], [COMPONENT_NAME, _curCat], false, 1 @@ -252,7 +252,7 @@ _curCat = "Debug"; [ QGVAR(debug_Drawing), "CHECKBOX", - ["Debug Draw", "Draws 3d Text over Units with AI Informations"], + [LSTRING(Settings_DebugDraw), LSTRING(Settings_DebugDraw_ToolTip)], [COMPONENT_NAME, _curCat], false, 1, @@ -278,7 +278,7 @@ _curCat = "Debug"; [ QGVAR(RenderExpectedDestination), "CHECKBOX", - ["Debug Draw Expected Destination", "Draws Expected Destinations of AI Units"], + [LSTRING(Settings_DebugDrawExpDest), LSTRING(Settings_DebugDrawExpDest_ToolTip)], [COMPONENT_NAME, _curCat], false, 1 diff --git a/addons/danger/stringtable.xml b/addons/danger/stringtable.xml new file mode 100644 index 00000000..ecb220a9 --- /dev/null +++ b/addons/danger/stringtable.xml @@ -0,0 +1,200 @@ + + + + + Disable Unit AI + + + Disable LAMBS unit AI + + + Toggle advanced danger.fsm features on this unit + + + Configure Long-range Radio + + + Toggle boosted communication range on unit + + + Unit with radio toggled have boosted communications range when sharing information\nThis effect is also achieved by equipping the unit with a Vanilla Radio Backpack or TFAR-mod enabled radio. + + + Configure Group AI + + + Disable LAMBS group AI + + + Disables LAMBS group AI\nDisabling this feature prevents autonomous building assaults and clearing, as well as hiding from aircraft and tanks + + + Settings + + + General + + + Settings Share information + + + Settings CQB Formations + + + Debug + + + Disable danger.fsm for player group + + + Toggle advanced danger.fsm features on player group + + + Disable suppression from player group + + + Toggle autonomous suppression for units in player group + + + Disable reaction state on player group + + + Toggle Reaction phase on units in player group + + + Disable autonomous group manoevures + + + Toggles group manoevure phase initiated by AI squad leader. Disabling this will prevent AI group leader from adding manoevure orders to flank and suppress buildings. + + + Disable units hiding + + + Toggles the concealment move by AI for units not equipped to damage tanks and aircraft. Disabling this setting will make groups more responsive + + + Disable unit hand gestures + + + Toggles unit gestures and hand signals when reacting to danger or executing planned manoevures + + + Disable unit immediate actions + + + Toggles unit quickly dodging or changing stance in response to being hit.\nImmediate reactions force an animation to run. Disabling will make for a more static AI + + + Disable enhanced unit fleeing + + + Toggles enhanced fleeing function for units. + + + Disable unit callouts + + + Toggles extra unit callouts based on situations + + + CQB Range + + + Range at which units consider themselves in assault range + + + Minimum Distance for Suppression Fire + + + Within this distance AI will not perform suppression fire + + + Panic Chance + + + Chance to panic in percentage + + + Disable information sharing + + + Toggle information sharing betweem units + + + Shout + + + Range AI units share information without radios + + + Base West + + + Base range side WEST share information + + + Base East + + + Base range side EAST share information + + + Base Independent + + + Base range independent and civilian sides share information + + + Backpack radios + + + Range added to units wearing backpack radios (Vanilla, TFAR, or configured by variable) + + + Units set to CQB formations will methodically clear buildings when an enemy is encountered + + + Debug FSM + + + Shows FSM debug messages + + + Debug Functions + + + Shows Function debug messages + + + Debug Civ + + + Shows FSM debug messages for civilians + + + Debug Draw + + + Draws 3d Text over Units with AI Informations + + + Debug Draw Expected Destination + + + Draws Expected Destinations of AI Units (Requires Debug Draw) + + + AI Disabled + + + Unit has advanced danger.fsm features disabled\n\nWARNING checking this will add mod dependency + + + Has Radio + + + Unit counts as carrying backpack radio for information sharing\n\nWARNING checking this will add mod dependency + + + diff --git a/addons/eventhandlers/config.cpp b/addons/eventhandlers/config.cpp index b15f09db..74fcfbad 100644 --- a/addons/eventhandlers/config.cpp +++ b/addons/eventhandlers/config.cpp @@ -6,7 +6,7 @@ class CfgPatches { weapons[] = {}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"lambs_danger"}; - author = "LAMBS Dev Team"; + author = ECSTRING(main,Team); VERSION_CONFIG; }; }; diff --git a/addons/eventhandlers/settings.sqf b/addons/eventhandlers/settings.sqf index da689c07..3086c70d 100644 --- a/addons/eventhandlers/settings.sqf +++ b/addons/eventhandlers/settings.sqf @@ -1,9 +1,9 @@ -private _curCat = "Explosion"; +private _curCat = LSTRING(Settings_Cat); [ QGVAR(ExplosionEventHandlerEnabled), "CHECKBOX", - ["Enable Explosion Eventhandler", "Toggle AI Reactions to nearby explosions"], + [LSTRING(Settings_EnabledExplosionEH_DisplayName), LSTRING(Settings_EnabledExplosionEH_ToolTip)], [COMPONENT_NAME, _curCat], true, true // players may configure their own preferences @@ -12,7 +12,7 @@ private _curCat = "Explosion"; [ QGVAR(ExplosionReactionTime), "SLIDER", - ["Explosion EH reset Time", "Configures explosions reset time."], + [LSTRING(Settings_ExplosionResetTime_DisplayName), LSTRING(Settings_ExplosionResetTime_ToolTip)], [COMPONENT_NAME, _curCat], [0, 25, 9, 2], true // players may configure their own preferences diff --git a/addons/eventhandlers/stringtable.xml b/addons/eventhandlers/stringtable.xml new file mode 100644 index 00000000..e93cd47a --- /dev/null +++ b/addons/eventhandlers/stringtable.xml @@ -0,0 +1,20 @@ + + + + + Explosion + + + Enable Explosion Eventhandler + + + Toggle AI Reactions to nearby explosions + + + Explosion EH reset Time + + + Configures explosions reset time. + + + diff --git a/addons/main/config.cpp b/addons/main/config.cpp index 3c7d5294..1b063508 100644 --- a/addons/main/config.cpp +++ b/addons/main/config.cpp @@ -6,7 +6,7 @@ class CfgPatches { weapons[] = {}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"cba_main"}; - author = "LAMBS Dev Team"; + author = CSTRING(Team); VERSION_CONFIG; }; }; diff --git a/addons/main/functions/fnc_showDialog.sqf b/addons/main/functions/fnc_showDialog.sqf index 6c281be1..cec27a0b 100644 --- a/addons/main/functions/fnc_showDialog.sqf +++ b/addons/main/functions/fnc_showDialog.sqf @@ -61,6 +61,10 @@ _globalGroup ctrlSetBackgroundColor BACKGROUND_RGB(0.8); _globalGroup ctrlSetPosition [_basePositionX, 0.5 - (_height / 2), PX(CONST_WIDTH), _height]; _globalGroup ctrlCommit 0; +if (isLocalized _name) then { + _name = localize _name; +}; + private _header = _display ctrlCreate ["RscText", -1, _globalGroup]; _header ctrlSetText _name; _header ctrlSetFontHeight PY(CONST_HEIGHT); @@ -70,6 +74,12 @@ _header ctrlCommit 0; private _fnc_CreateLabel = { params ["_text", ["_tooltip", ""]]; + if (isLocalized _text) then { + _text = localize _text; + }; + if (isLocalized _tooltip) then { + _tooltip = localize _tooltip; + }; private _label = _display ctrlCreate ["RscText", -1, _globalGroup]; _label ctrlSetPosition [_basePositionX + PY(CONST_SPACE_HEIGHT), _basePositionY + PY(CONST_HEIGHT / 2), PX(CONST_WIDTH / 2), PY(CONST_HEIGHT / CONST_ELEMENTDIVIDER)]; _label ctrlSetFontHeight PY(CONST_HEIGHT/2); @@ -81,7 +91,9 @@ private _fnc_CreateLabel = { private _fnc_AddTextField = { params ["_text", "", ["_tooltip", ""], ["_default", ""]]; - + if (isLocalized _tooltip) then { + _tooltip = localize _tooltip; + }; private _cacheName = format ["lambs_%1_%2", _name, _text]; _default = GVAR(ChooseDialogSettingsCache) getVariable [_cacheName, _default]; _basePositionY = _basePositionY + PY(CONST_HEIGHT + CONST_SPACE_HEIGHT); @@ -101,7 +113,9 @@ private _fnc_AddTextField = { private _fnc_AddBoolean = { params ["_text", "", ["_tooltip", ""], ["_default", false, [false]]]; - + if (isLocalized _tooltip) then { + _tooltip = localize _tooltip; + }; private _cacheName = format ["lambs_%1_%2", _name, _text]; _default = GVAR(ChooseDialogSettingsCache) getVariable [_cacheName, _default]; @@ -119,7 +133,9 @@ private _fnc_AddBoolean = { private _fnc_AddDropDown = { params ["_text", "", ["_tooltip", ""], ["_values", [], []], ["_default", 0, [0]]]; - + if (isLocalized _tooltip) then { + _tooltip = localize _tooltip; + }; private _cacheName = format ["lambs_%1_%2", _name, _text]; _default = GVAR(ChooseDialogSettingsCache) getVariable [_cacheName, _default]; @@ -132,7 +148,7 @@ private _fnc_AddDropDown = { if (_x isEqualType "") then { _dropDownField lbAdd _x; } else { - _dropDownField lbAdd ("Not A String " + (str _x)); + _dropDownField lbAdd (str _x); }; } forEach _values; @@ -146,7 +162,9 @@ private _fnc_AddDropDown = { private _fnc_AddSlider = { params ["_text", "", ["_tooltip", ""], ["_range", [0, 1]], ["_speed", [0.01, 0.1]], "_default"]; - + if (isLocalized _tooltip) then { + _tooltip = localize _tooltip; + }; private _cacheName = format ["lambs_%1_%2", _name, _text]; _default = GVAR(ChooseDialogSettingsCache) getVariable [_cacheName, _default]; @@ -193,7 +211,7 @@ private _controls = []; _basePositionY = _basePositionY + PY(CONST_HEIGHT + (CONST_SPACE_HEIGHT*2)); private _cancelButton = _display ctrlCreate ["RscButton", -1, _globalGroup]; -_cancelButton ctrlSetText "CANCEL"; +_cancelButton ctrlSetText (localize "STR_DISP_CANCEL"); _cancelButton ctrlSetPosition [_basePositionX, _basePositionY, PX(CONST_WIDTH / 2)- PX(CONST_SPACE_HEIGHT/2), PY(CONST_HEIGHT / 2)]; @@ -206,7 +224,7 @@ _cancelButton ctrlAddEventHandler ["ButtonClick", { _cancelButton ctrlCommit 0; private _okButton = _display ctrlCreate ["RscButton", -1, _globalGroup]; -_okButton ctrlSetText "OK"; +_okButton ctrlSetText (localize "STR_DISP_OK"); _okButton ctrlSetPosition [_basePositionX + PX(CONST_WIDTH / 2) + PX(CONST_SPACE_HEIGHT/2), _basePositionY, PX(CONST_WIDTH / 2) - PX(CONST_SPACE_HEIGHT/2), PY(CONST_HEIGHT / 2)]; _okButton ctrlAddEventHandler ["ButtonClick", { diff --git a/addons/main/script_macros.hpp b/addons/main/script_macros.hpp index 295092a6..7f92910d 100644 --- a/addons/main/script_macros.hpp +++ b/addons/main/script_macros.hpp @@ -18,7 +18,7 @@ _unit \ } -// #define DISABLE_COMPILE_CACHE +#define DISABLE_COMPILE_CACHE #ifdef DISABLE_COMPILE_CACHE #undef PREP diff --git a/addons/main/stringtable.xml b/addons/main/stringtable.xml new file mode 100644 index 00000000..8781de8a --- /dev/null +++ b/addons/main/stringtable.xml @@ -0,0 +1,29 @@ + + + + + No Unit Selected + + + Players are not a Valid Selections + + + No Group Selected + + + LAMBS Danger Dev Team + LAMBS Danger Dev Team + LAMBS Danger Dev Team + LAMBS Danger Dev Team + LAMBS Danger Dev Team + LAMBS Danger Dev Team + LAMBS Danger Dev Team + LAMBS Danger Dev Team + LAMBS Danger Dev Team + LAMBS Danger Dev Team + LAMBS Danger Dev Team + LAMBS Danger Dev Team + LAMBS Danger Dev Team + + + diff --git a/addons/wp/Cfg3DEN.hpp b/addons/wp/Cfg3DEN.hpp index 3a54f3b8..86357d26 100644 --- a/addons/wp/Cfg3DEN.hpp +++ b/addons/wp/Cfg3DEN.hpp @@ -23,7 +23,7 @@ class Cfg3DEN { h = 5 * GRID_3DEN_H; rows = 1; columns = 3; - strings[] = { "West", "East", "Independent" }; + strings[] = { "$STR_A3_CfgGroups_West0", "$STR_A3_CfgGroups_East0", "$STR_A3_CfgGroups_Indep0" }; }; }; }; @@ -35,8 +35,8 @@ class Cfg3DEN { class EGVAR(WP,Editor_IsArtillery) { property = QEGVAR(WP,Editor_IsArtillery); control = "Checkbox"; - displayName = "Register as LAMBS artillery"; - tooltip = "Vehicle will be automatically registered as available artillery for dynamic strikes"; + displayName = CSTRING(3DEN_Attributes_RegisterArtillery_DisplayName); + tooltip = CSTRING(3DEN_Attributes_RegisterArtillery_ToolTip); expression = "if (_value) then {_this spawn {waitUntil {!isNil 'lambs_danger_Loaded_WP'};if (lambs_danger_Loaded_WP) then {[gunner _this] call lambs_wp_fnc_taskArtilleryRegister;};};};"; typeName = "BOOL"; condition = "objectVehicle"; diff --git a/addons/wp/config.cpp b/addons/wp/config.cpp index e3bd4889..871e7d76 100644 --- a/addons/wp/config.cpp +++ b/addons/wp/config.cpp @@ -30,7 +30,7 @@ class CfgPatches { weapons[] = {}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"lambs_danger"}; - author = "LAMBS Dev Team"; + author = ECSTRING(main,Team); VERSION_CONFIG; }; }; diff --git a/addons/wp/functions/Modules/fnc_moduleArtillery.sqf b/addons/wp/functions/Modules/fnc_moduleArtillery.sqf index e7061c77..2606dd3d 100644 --- a/addons/wp/functions/Modules/fnc_moduleArtillery.sqf +++ b/addons/wp/functions/Modules/fnc_moduleArtillery.sqf @@ -48,34 +48,28 @@ switch (_mode) do { }, [_side, _salvo, _spread, _skipCheckround, getPos _logic]] call CBA_fnc_waitUntilAndExecute; }; if (_isCuratorPlaced) then { - //--- Get unit under cursor - private _error = ""; - if (_error == "") then { - ["Task Artillery", - [ - ["Side", "DROPDOWN", "Which side is calling for artillery", SIDES apply { str _x }], - ["Main Salvo", "NUMBER", "Number of rounds in main salvo", 6], - ["Spread", "NUMBER", "Default dispersion of main salvo", 75], - ["Skip adjusting rounds", "BOOLEAN", "Check this to disable initial rounds used by the fire controller to adjust rounds on target.\nSkipping this will make the barrage immediately hit on target", false] - ], { - params ["_data", "_args"]; - _args params ["_logic", "_fnc_callArtillery"]; - _data params ["_sideIndex", "_salvo", "_spread", "_skipCheckround"]; - [SIDES select _sideIndex, _salvo, _spread, _skipCheckround, _logic] call _fnc_callArtillery; - [objNull, format ["Artillery target created for %1", SIDES select _sideIndex]] call BIS_fnc_showCuratorFeedbackMessage; - deleteVehicle _logic; - }, { - params ["_logic"]; - deleteVehicle _logic; - }, { - params ["_logic"]; - deleteVehicle _logic; - }, [_logic, _fnc_callArtillery] - ] call EFUNC(main,showDialog); - } else { - [objNull, _error] call BIS_fnc_showCuratorFeedbackMessage; - deleteVehicle _logic; - }; + private _sides = SIDES apply { str _x }; + [LSTRING(Module_TaskArtillery_DisplayName), + [ + [LSTRING(Module_TaskArtillery_Side_DisplayName), "DROPDOWN", LSTRING(Module_TaskArtillery_Side_Tooltip), _sides], + [LSTRING(Module_TaskArtillery_MainSalvo_DisplayName), "NUMBER", LSTRING(Module_TaskArtillery_MainSalvo_Tooltip), 6], + [LSTRING(Module_TaskArtillery_Spread_DisplayName), "NUMBER", LSTRING(Module_TaskArtillery_Spread_Tooltip), 75], + [LSTRING(Module_TaskArtillery_SkipCheckrounds_DisplayName), "BOOLEAN", LSTRING(Module_TaskArtillery_SkipCheckrounds_Tooltip), false] + ], { + params ["_data", "_args"]; + _args params ["_logic", "_fnc_callArtillery"]; + _data params ["_sideIndex", "_salvo", "_spread", "_skipCheckround"]; + [SIDES select _sideIndex, _salvo, _spread, _skipCheckround, _logic] call _fnc_callArtillery; + [objNull, format [localize LSTRING(Module_TaskArtillery_ZeusNotification), SIDES select _sideIndex]] call BIS_fnc_showCuratorFeedbackMessage; + deleteVehicle _logic; + }, { + params ["_logic"]; + deleteVehicle _logic; + }, { + params ["_logic"]; + deleteVehicle _logic; + }, [_logic, _fnc_callArtillery] + ] call EFUNC(main,showDialog); } else { private _sideIndex = _logic getVariable [QGVAR(Side), 0]; private _salvo = _logic getVariable [QGVAR(MainSalvo), 6]; diff --git a/addons/wp/functions/Modules/fnc_moduleArtilleryRegister.sqf b/addons/wp/functions/Modules/fnc_moduleArtilleryRegister.sqf index ed047647..b0365b65 100644 --- a/addons/wp/functions/Modules/fnc_moduleArtilleryRegister.sqf +++ b/addons/wp/functions/Modules/fnc_moduleArtilleryRegister.sqf @@ -30,19 +30,19 @@ switch (_mode) do { //--- Check if the unit is suitable private _error = ""; if (isNull _group) then { - _error = "No Unit Seleted"; + _error = ELSTRING(main,NoUnitSelected); }; if (_error == "") then { private _success = [_group] call FUNC(taskArtilleryRegister); if (_success) then { - [objNull, "Units have been added to Artillery Pool"] call BIS_fnc_showCuratorFeedbackMessage; + [objNull, LSTRING(Module_TaskArtilleryRegister_ZeusNotificatio_UnitAdded)] call BIS_fnc_showCuratorFeedbackMessage; } else { - [objNull, "No Units have been added to Artillery Pool"] call BIS_fnc_showCuratorFeedbackMessage; + [objNull, LSTRING(Module_TaskArtilleryRegister_ZeusNotificatio_NoUnitAdded)] call BIS_fnc_showCuratorFeedbackMessage; }; deleteVehicle _logic; } else { - [objNull, _error] call BIS_fnc_showCuratorFeedbackMessage; + [objNull, localize _error] call BIS_fnc_showCuratorFeedbackMessage; deleteVehicle _logic; }; } else { diff --git a/addons/wp/functions/Modules/fnc_moduleAssault.sqf b/addons/wp/functions/Modules/fnc_moduleAssault.sqf index c04fde7f..e45fdfab 100644 --- a/addons/wp/functions/Modules/fnc_moduleAssault.sqf +++ b/addons/wp/functions/Modules/fnc_moduleAssault.sqf @@ -31,13 +31,13 @@ switch (_mode) do { _groups = _groups select { ((units _x) findIf { alive _x }) != -1; }; _groups = [_groups, [], {_logic distance (leader _x) }, "ASCEND"] call BIS_fnc_sortBy; - ["Task Assault", + [LSTRING(Module_TaskAssault_DisplayName), [ - ["Groups", "DROPDOWN", "Select which unit script applies to.\nList is sorted by distance", _groups apply { format ["%1 - %2 (%3 m)", side _x, groupId _x, round ((leader _x) distance _logic)] }, 0], - ["Unit is fleeing", "BOOLEAN", "Enable this to make the unit retreat and ignore enemies", false], - ["Completion Threshold", "NUMBER", "Units within this many meters will revert to regular behaviour", 15], - ["Script interval", "NUMBER", "The cycle time of the script", 3], - ["Remove module after start", "BOOLEAN", "Check this to remove module after script initiates\n If module is present it can be moved to dynamically alter destination", false] + [LSTRING(Groups_DisplayName), "DROPDOWN", LSTRING(Groups_ToolTip), _groups apply { format ["%1 - %2 (%3 m)", side _x, groupId _x, round ((leader _x) distance _logic)] }, 0], + [LSTRING(Module_TaskAssault_Retreating_DisplayName), "BOOLEAN", LSTRING(Module_TaskAssault_Retreating_Tooltip), false], + [LSTRING(Module_TaskAssault_DistanceThreshold_DisplayName), "NUMBER", LSTRING(Module_TaskAssault_DistanceThreshold_Tooltip), 15], + [LSTRING(Module_TaskAssault_CycleTime_DisplayName), "NUMBER", LSTRING(Module_TaskAssault_CycleTime_Tooltip), 3], + [LSTRING(Module_TaskAssault_DeleteOnStartup_DisplayName), "BOOLEAN", LSTRING(Module_TaskAssault_DeleteOnStartup_Tooltip), false] ], { params ["_data", "_args"]; _args params ["_groups", "_logic"]; @@ -58,12 +58,12 @@ switch (_mode) do { GVAR(ModuleTargets) = GVAR(ModuleTargets) - [objNull]; private _targets = GVAR(ModuleTargets); _targets = [_targets, [], {_logic distance _x }, "ASCEND"] call BIS_fnc_sortBy; - ["Task Assault", + [LSTRING(Module_TaskAssault_DisplayName), [ - ["Center", "DROPDOWN", "Sets center for the script execution. This can be self or a LAMBS Dynamic Target selected from the list", _targets apply { format ["%1 (%2 m)", vehicleVarName _x, round (_x distance _logic)] }, 0], - ["Is Retreating", "BOOLEAN", "Enable this to make the unit retreat and ignore enemies", false], - ["Completion Threshold", "NUMBER", "Units within this many meters will revert to regular behaviour", 15], - ["Script interval", "NUMBER", "The cycle time of the script", 3] + [LSTRING(Centers_DisplayName), "DROPDOWN", LSTRING(Centers_ToolTip), _targets apply { format ["%1 (%2 m)", vehicleVarName _x, round (_x distance _logic)] }, 0], + [LSTRING(Module_TaskAssault_Retreating_DisplayName), "BOOLEAN", LSTRING(Module_TaskAssault_Retreating_Tooltip), false], + [LSTRING(Module_TaskAssault_DistanceThreshold_DisplayName), "NUMBER", LSTRING(Module_TaskAssault_DistanceThreshold_Tooltip), 15], + [LSTRING(Module_TaskAssault_CycleTime_DisplayName), "NUMBER", LSTRING(Module_TaskAssault_CycleTime_Tooltip), 3] ], { params ["_data", "_args"]; _args params ["_targets", "_logic", "_group"]; diff --git a/addons/wp/functions/Modules/fnc_moduleCQB.sqf b/addons/wp/functions/Modules/fnc_moduleCQB.sqf index 0baa5a2b..59e72614 100644 --- a/addons/wp/functions/Modules/fnc_moduleCQB.sqf +++ b/addons/wp/functions/Modules/fnc_moduleCQB.sqf @@ -31,12 +31,12 @@ switch (_mode) do { _groups = _groups select { ((units _x) findIf { alive _x }) != -1; }; _groups = [_groups, [], {_logic distance (leader _x) }, "ASCEND"] call BIS_fnc_sortBy; - ["Task CQB", + [LSTRING(Module_TaskCQB_DisplayName), [ - ["Groups", "DROPDOWN", "Select which unit script applies to.\nList is sorted by distance", _groups apply { format ["%1 - %2 (%3 m)", side _x, groupId _x, round ((leader _x) distance _logic)] }, 0], - ["Radius", "NUMBER", "Max distance houses will be searched", 50], - ["Script interval", "NUMBER", "The cycle time for the script in seconds. Higher numbers make units search buildings more carefully.\nDefault 21 seconds", 21], - ["Dynamic center", "BOOLEAN", "Enable this to make it possible to move the center/module of the building search pattern", false] + [LSTRING(Groups_DisplayName), "DROPDOWN", LSTRING(Groups_ToolTip), _groups apply { format ["%1 - %2 (%3 m)", side _x, groupId _x, round ((leader _x) distance _logic)] }, 0], + [LSTRING(Module_TaskCQB_Radius_DisplayName), "NUMBER", LSTRING(Module_TaskCQB_Radius_ToolTip), 50], + [LSTRING(Module_TaskCQB_CycleTime_DisplayName), "NUMBER", LSTRING(Module_TaskCQB_CycleTime_Tooltip), 21], + [LSTRING(Module_TaskCQB_DeleteOnStartUp_DisplayName), "BOOLEAN", LSTRING(Module_TaskCQB_DeleteOnStartUp_Tooltip), false] ], { params ["_data", "_args"]; _args params ["_groups", "_logic"]; @@ -54,17 +54,17 @@ switch (_mode) do { }, [_groups, _logic] ] call EFUNC(main,showDialog); } else { - _logic setVehicleVarName "Self"; + _logic setVehicleVarName localize LSTRING(Self); private _targets = [_logic]; GVAR(ModuleTargets) = GVAR(ModuleTargets) - [objNull]; _targets append GVAR(ModuleTargets); _targets = [_targets, [], {_logic distance _x }, "ASCEND"] call BIS_fnc_sortBy; - ["Task CQB", + [LSTRING(Module_TaskCQB_DisplayName), [ - ["Center", "DROPDOWN", "Sets center for the script execution. This can be self or a LAMBS Dynamic Target selected from the list", _targets apply { format ["%1 (%2 m)", vehicleVarName _x, round (_x distance _logic)] }, 0], - ["Radius", "NUMBER", "Max distance houses will be searched", 50], - ["Script interval", "NUMBER", "The cycle time for the script in seconds. Higher numbers make units search buildings more carefully.\nDefault 21 seconds", 21] + [LSTRING(Centers_DisplayName), "DROPDOWN", LSTRING(Centers_ToolTip), _targets apply { format ["%1 (%2 m)", vehicleVarName _x, round (_x distance _logic)] }, 0], + [LSTRING(Module_TaskCQB_Radius_DisplayName), "NUMBER", LSTRING(Module_TaskCQB_Radius_ToolTip), 50], + [LSTRING(Module_TaskCQB_CycleTime_DisplayName), "NUMBER", LSTRING(Module_TaskCQB_CycleTime_Tooltip), 21] ], { params ["_data", "_args"]; _args params ["_targets", "_logic", "_group"]; diff --git a/addons/wp/functions/Modules/fnc_moduleCamp.sqf b/addons/wp/functions/Modules/fnc_moduleCamp.sqf index 49573365..64f61299 100644 --- a/addons/wp/functions/Modules/fnc_moduleCamp.sqf +++ b/addons/wp/functions/Modules/fnc_moduleCamp.sqf @@ -32,10 +32,10 @@ switch (_mode) do { _groups = _groups select { ((units _x) findIf { alive _x }) != -1; }; _groups = [_groups, [], {_logic distance (leader _x) }, "ASCEND"] call BIS_fnc_sortBy; - ["Task Camp", + [LSTRING(Module_TaskCamp_DisplayName), [ - ["Groups", "DROPDOWN", "Select which unit script applies to.\nList is sorted by distance.", _groups apply { format ["%1 - %2 (%3 m)", side _x, groupId _x, round ((leader _x) distance _logic)] }, 0], - ["Radius", "NUMBER", "Radius buildings and static weapons are garrisoned and manned\nTwice this number is used for patrols", 50] + [LSTRING(Groups_DisplayName), "DROPDOWN", LSTRING(Groups_ToolTip), _groups apply { format ["%1 - %2 (%3 m)", side _x, groupId _x, round ((leader _x) distance _logic)] }, 0], + [LSTRING(Module_TaskCamp_Radius_DisplayName), "NUMBER", LSTRING(Module_TaskCamp_Radius_ToolTip), 50] ], { params ["_data", "_args"]; _args params ["_groups", "_logic"]; @@ -51,16 +51,16 @@ switch (_mode) do { }, [_groups, _logic] ] call EFUNC(main,showDialog); } else { - _logic setVehicleVarName "Self"; + _logic setVehicleVarName localize LSTRING(Self); private _targets = [_logic]; GVAR(ModuleTargets) = GVAR(ModuleTargets) - [objNull]; _targets append GVAR(ModuleTargets); _targets = [_targets, [], {_logic distance _x }, "ASCEND"] call BIS_fnc_sortBy; - ["Task Camp", + [LSTRING(Module_TaskCamp_DisplayName), [ - ["Center", "DROPDOWN", "Sets center for the script execution. This can be self or a LAMBS Dynamic Target selected from the list", _targets apply { format ["%1 (%2 m)", vehicleVarName _x, round (_x distance _logic)] }, 0], - ["Radius", "NUMBER", "Radius buildings and static weapons are garrisoned and manned\nTwice this number is used for patrols", 50] + [LSTRING(Centers_DisplayName), "DROPDOWN", LSTRING(Centers_ToolTip), _targets apply { format ["%1 (%2 m)", vehicleVarName _x, round (_x distance _logic)] }, 0], + [LSTRING(Module_TaskCamp_Radius_DisplayName), "NUMBER", LSTRING(Module_TaskCamp_Radius_ToolTip), 50] ], { params ["_data", "_args"]; _args params ["_group", "_logic", "_targets"]; diff --git a/addons/wp/functions/Modules/fnc_moduleCreep.sqf b/addons/wp/functions/Modules/fnc_moduleCreep.sqf index 8f344fa5..935157b4 100644 --- a/addons/wp/functions/Modules/fnc_moduleCreep.sqf +++ b/addons/wp/functions/Modules/fnc_moduleCreep.sqf @@ -28,15 +28,15 @@ switch (_mode) do { //--- Check if the unit is suitable private _error = ""; if (isNull _group) then { - _error = "No Unit Seleted"; + _error = ELSTRING(main,NoUnitSelected); }; if (_error == "") then { - ["Task Creep", + [LSTRING(Module_TaskCreep_DisplayName), [ - ["Radius", "NUMBER", "Distance creeping group will search for enemies.\nThis module only targets enemy players", 1000], - ["Script Interval", "NUMBER", "The cycle time for the script in seconds. Higher numbers can be used to make the creeping group less accurate\nDefault 15 seconds", 15], - ["Use Group As Center", "BOOLEAN", "The creeping group will use the group leader as a center for the search pattern. Disable to have the unit use the module position instead", true] + [LSTRING(Module_TaskCreep_Radius_DisplayName), "NUMBER", LSTRING(Module_TaskCreep_Radius_ToolTip), 1000], + [LSTRING(Module_TaskCreep_CycleTime_DisplayName), "NUMBER", LSTRING(Module_TaskCreep_CycleTime_ToolTip), 15], + [LSTRING(Module_TaskCreep_MovingCenter_DisplayName), "BOOLEAN", LSTRING(Module_TaskCreep_MovingCenter_ToolTip), true] ], { params ["_data", "_args"]; _args params ["_group", "_logic"]; @@ -56,7 +56,7 @@ switch (_mode) do { }, [_group, _logic] ] call EFUNC(main,showDialog); } else { - [objNull, _error] call BIS_fnc_showCuratorFeedbackMessage; + [objNull, localize _error] call BIS_fnc_showCuratorFeedbackMessage; deleteVehicle _logic; }; } else { diff --git a/addons/wp/functions/Modules/fnc_moduleGarrison.sqf b/addons/wp/functions/Modules/fnc_moduleGarrison.sqf index 1d016427..0a644dbb 100644 --- a/addons/wp/functions/Modules/fnc_moduleGarrison.sqf +++ b/addons/wp/functions/Modules/fnc_moduleGarrison.sqf @@ -31,10 +31,10 @@ switch (_mode) do { private _groups = allGroups; _groups = _groups select { ((units _x) findIf { alive _x }) != -1; }; _groups = [_groups, [], {_logic distance (leader _x) }, "ASCEND"] call BIS_fnc_sortBy; - ["Task Garrison", + [LSTRING(Module_TaskGarrison_DisplayName), [ - ["Groups", "DROPDOWN", "Select which unit script applies to.\nList is sorted by distance", _groups apply { format ["%1 - %2 (%3 m)", side _x, groupId _x, round ((leader _x) distance _logic)] }, 0], - ["Radius", "NUMBER", "Distance buildings are occupied", 50] + [LSTRING(Groups_DisplayName), "DROPDOWN", LSTRING(Groups_ToolTip), _groups apply { format ["%1 - %2 (%3 m)", side _x, groupId _x, round ((leader _x) distance _logic)] }, 0], + [LSTRING(Module_TaskGarrison_Radius_DisplayName), "NUMBER", LSTRING(Module_TaskGarrison_Radius_ToolTip), 50] ], { params ["_data", "_args"]; _args params ["_groups", "_logic"]; @@ -50,16 +50,16 @@ switch (_mode) do { }, [_groups, _logic] ] call EFUNC(main,showDialog); } else { - _logic setVehicleVarName "Self"; + _logic setVehicleVarName localize LSTRING(Self); private _targets = [_logic]; GVAR(ModuleTargets) = GVAR(ModuleTargets) - [objNull]; _targets append GVAR(ModuleTargets); _targets = [_targets, [], {_logic distance _x }, "ASCEND"] call BIS_fnc_sortBy; - ["Task Garrison", + [LSTRING(Module_TaskGarrison_DisplayName), [ - ["Center", "DROPDOWN", "Sets center for the script execution. This can be self or a LAMBS Dynamic Target selected from the list", _targets apply { format ["%1 (%2 m)", vehicleVarName _x, round (_x distance _logic)] }, 0], - ["Radius", "NUMBER", "Distance buildings are occupied", 50] + [LSTRING(Centers_DisplayName), "DROPDOWN", LSTRING(Centers_ToolTip), _targets apply { format ["%1 (%2 m)", vehicleVarName _x, round (_x distance _logic)] }, 0], + [LSTRING(Module_TaskGarrison_Radius_DisplayName), "NUMBER", LSTRING(Module_TaskGarrison_Radius_ToolTip), 50] ], { params ["_data", "_args"]; _args params ["_group", "_logic", "_targets"]; diff --git a/addons/wp/functions/Modules/fnc_moduleHunt.sqf b/addons/wp/functions/Modules/fnc_moduleHunt.sqf index 11d06f4e..249b9b46 100644 --- a/addons/wp/functions/Modules/fnc_moduleHunt.sqf +++ b/addons/wp/functions/Modules/fnc_moduleHunt.sqf @@ -29,15 +29,15 @@ switch (_mode) do { //--- Check if the unit is suitable private _error = ""; if (isNull _group) then { - _error = "No Unit Seleted"; + _error = ELSTRING(main,NoUnitSelected); }; if (_error == "") then { - ["Task Hunt", + [LSTRING(Module_TaskHunt_DisplayName), [ - ["Radius", "NUMBER", "Distance hunting group will search for enemies.\nThis module only targets enemy players", 1000], - ["Script interval", "NUMBER", "The cycle time for the script in seconds. Higher numbers can be used to make the hunting group less accurate.\nDefault 70 seconds", 70], - ["Use Group As Center", "BOOLEAN", "The hunting group will use the group leader as a center for the search pattern. Disable to have the unit use the module position instead", true] + [LSTRING(Module_TaskHunt_Radius_DisplayName), "NUMBER", LSTRING(Module_TaskHunt_Radius_ToolTip), 1000], + [LSTRING(Module_TaskHunt_CycleTime_DisplayName), "NUMBER", LSTRING(Module_TaskHunt_CycleTime_ToolTip), 70], + [LSTRING(Module_TaskHunt_MovingCenter_DisplayName), "BOOLEAN", LSTRING(Module_TaskHunt_MovingCenter_ToolTip), true] ], { params ["_data", "_args"]; _args params ["_group", "_logic"]; @@ -57,7 +57,7 @@ switch (_mode) do { }, [_group, _logic] ] call EFUNC(main,showDialog); } else { - [objNull, _error] call BIS_fnc_showCuratorFeedbackMessage; + [objNull, localize _error] call BIS_fnc_showCuratorFeedbackMessage; deleteVehicle _logic; }; } else { diff --git a/addons/wp/functions/Modules/fnc_modulePatrol.sqf b/addons/wp/functions/Modules/fnc_modulePatrol.sqf index 92489113..41527b47 100644 --- a/addons/wp/functions/Modules/fnc_modulePatrol.sqf +++ b/addons/wp/functions/Modules/fnc_modulePatrol.sqf @@ -31,12 +31,12 @@ switch (_mode) do { _groups = _groups select { ((units _x) findIf { alive _x }) != -1; }; _groups = [_groups, [], {_logic distance (leader _x) }, "ASCEND"] call BIS_fnc_sortBy; - ["Task Patrol", + [LSTRING(Module_TaskPatrol_DisplayName), [ - ["Groups", "DROPDOWN", "Select which unit script applies to.\nList is sorted by distance", _groups apply { format ["%1 - %2 (%3 m)", side _x, groupId _x, round ((leader _x) distance _logic)] }, 0], - ["Range", "NUMBER", "Max distance between waypoints", 200], - ["Waypoints", "NUMBER", "Number of waypoints created", 3], - ["Dynamic patrol pattern", "BOOLEAN", "Unit will create new patrol pattern once one patrol cycle is complete", false] + [LSTRING(Groups_DisplayName), "DROPDOWN", LSTRING(Groups_ToolTip), _groups apply { format ["%1 - %2 (%3 m)", side _x, groupId _x, round ((leader _x) distance _logic)] }, 0], + [LSTRING(Module_TaskPatrol_Range_DisplayName), "NUMBER", LSTRING(Module_TaskPatrol_Range_ToolTip), 200], + [LSTRING(Module_TaskPatrol_Waypoints_DisplayName), "NUMBER", LSTRING(Module_TaskPatrol_Waypoints_ToolTip), 3], + [LSTRING(Module_TaskPatrol_MoveWaypoints_DisplayName), "BOOLEAN", LSTRING(Module_TaskPatrol_MoveWaypoints_ToolTip), false] ], { params ["_data", "_args"]; _args params ["_groups", "_logic"]; @@ -52,18 +52,18 @@ switch (_mode) do { }, [_groups, _logic] ] call EFUNC(main,showDialog); } else { - _logic setVehicleVarName "Self"; + _logic setVehicleVarName localize LSTRING(Self); private _targets = [_logic]; GVAR(ModuleTargets) = GVAR(ModuleTargets) - [objNull]; _targets append GVAR(ModuleTargets); _targets = [_targets, [], {_logic distance _x }, "ASCEND"] call BIS_fnc_sortBy; - ["Task Patrol", + [LSTRING(Module_TaskPatrol_DisplayName), [ - ["Center", "DROPDOWN", "Sets center for the script execution. This can be self or a LAMBS Dynamic Target selected from the list.\nIf Dynamic patrol pattern is enabled, the target can be moved to update patrol route", _targets apply { format ["%1 (%2 m)", vehicleVarName _x, round (_x distance _logic)] }, 0], - ["Range", "NUMBER", "Max distance between waypoints", 200], - ["Waypoints", "NUMBER", "Number of waypoints created", 3], - ["Dynamic patrol pattern", "BOOLEAN", "Unit will generate a new patrol pattern once one patrol cycle is complete", false] + [LSTRING(Centers_DisplayName), "DROPDOWN", LSTRING(Centers_ToolTip), _targets apply { format ["%1 (%2 m)", vehicleVarName _x, round (_x distance _logic)] }, 0], + [LSTRING(Module_TaskPatrol_Range_DisplayName), "NUMBER", LSTRING(Module_TaskPatrol_Range_ToolTip), 200], + [LSTRING(Module_TaskPatrol_Waypoints_DisplayName), "NUMBER", LSTRING(Module_TaskPatrol_Waypoints_ToolTip), 3], + [LSTRING(Module_TaskPatrol_MoveWaypoints_DisplayName), "BOOLEAN", LSTRING(Module_TaskPatrol_MoveWaypoints_ToolTip), false] ], { params ["_data", "_args"]; _args params ["_targets", "_logic", "_group"]; diff --git a/addons/wp/functions/Modules/fnc_moduleReset.sqf b/addons/wp/functions/Modules/fnc_moduleReset.sqf index 228a26a8..be4816f2 100644 --- a/addons/wp/functions/Modules/fnc_moduleReset.sqf +++ b/addons/wp/functions/Modules/fnc_moduleReset.sqf @@ -31,7 +31,7 @@ switch (_mode) do { //--- Check if the unit is suitable private _error = ""; if (isNull _group) then { - _error = "No Unit Seleted"; + _error = ELSTRING(main,NoUnitSelected); }; // resets unit @@ -42,7 +42,7 @@ switch (_mode) do { // display error } else { - [objNull, _error] call BIS_fnc_showCuratorFeedbackMessage; + [objNull, localize _error] call BIS_fnc_showCuratorFeedbackMessage; }; // clean up diff --git a/addons/wp/functions/Modules/fnc_moduleRush.sqf b/addons/wp/functions/Modules/fnc_moduleRush.sqf index fe60dd7a..d8046657 100644 --- a/addons/wp/functions/Modules/fnc_moduleRush.sqf +++ b/addons/wp/functions/Modules/fnc_moduleRush.sqf @@ -29,15 +29,15 @@ switch (_mode) do { //--- Check if the unit is suitable private _error = ""; if (isNull _group) then { - _error = "No Unit Seleted"; + _error = ELSTRING(main,NoUnitSelected); }; if (_error == "") then { - ["Task Rush", + [LSTRING(Module_TaskRush_DisplayName), [ - ["Radius", "NUMBER", "Distance rushing group will search for enemies.\nThis module only targets enemy players", 1000], - ["Script interval", "NUMBER", "The cycle time for the script in seconds. Higher numbers can be used to make rushers less accurate\nDefault 4 seconds", 4], - ["Use Group As Center", "BOOLEAN", "The rushing group will use the group leader as a center for the search pattern. Disable to have the unit use the module position instead", true] + [LSTRING(Module_TaskRush_Radius_DisplayName), "NUMBER", LSTRING(Module_TaskRush_Radius_ToolTip), 1000], + [LSTRING(Module_TaskRush_CycleTime_DisplayName), "NUMBER", LSTRING(Module_TaskRush_CycleTime_ToolTip), 4], + [LSTRING(Module_TaskRush_MovingCenter_DisplayName), "BOOLEAN", LSTRING(Module_TaskRush_MovingCenter_ToolTip), true] ], { params ["_data", "_args"]; _args params ["_group", "_logic"]; @@ -57,7 +57,7 @@ switch (_mode) do { }, [_group, _logic] ] call EFUNC(main,showDialog); } else { - [objNull, _error] call BIS_fnc_showCuratorFeedbackMessage; + [objNull, localize _error] call BIS_fnc_showCuratorFeedbackMessage; deleteVehicle _logic; }; } else { diff --git a/addons/wp/modules.hpp b/addons/wp/modules.hpp index 6f64676a..ef65211b 100644 --- a/addons/wp/modules.hpp +++ b/addons/wp/modules.hpp @@ -2,15 +2,15 @@ class GVAR(TaskArtillery) : GVAR(BaseModule) { _generalMacro = QGVAR(TaskArtillery); scope = 2; - displayName = "Task Artillery"; + displayName = CSTRING(Module_TaskArtillery_DisplayName); category = "Lambs_Danger_WP_Cat"; function = QFUNC(moduleArtillery); icon = "\a3\ui_f\data\IGUI\Cfg\simpleTasks\types\destroy_ca.paa"; portrait = "\a3\ui_f\data\IGUI\Cfg\simpleTasks\types\destroy_ca.paa"; class Attributes: AttributesBase { class GVAR(Side) { - displayName = "Side"; - tooltip = "Which side is calling for artillery"; + displayName = CSTRING(Module_TaskArtillery_Side_DisplayName); + tooltip = CSTRING(Module_TaskArtillery_Side_Tooltip); property = QGVAR(Side); defaultValue = "0"; unique = 0; @@ -21,8 +21,8 @@ class GVAR(TaskArtillery) : GVAR(BaseModule) { expression = "_this setVariable ['%s', _value, true];"; }; class GVAR(MainSalvo): EditShort { - displayName = "Main Salvo"; - tooltip = "Number of rounds in the main salvo"; + displayName = CSTRING(Module_TaskArtillery_MainSalvo_DisplayName); + tooltip = CSTRING(Module_TaskArtillery_MainSalvo_Tooltip); property = QGVAR(MainSalvo); defaultValue = "6"; unique = 0; @@ -31,8 +31,8 @@ class GVAR(TaskArtillery) : GVAR(BaseModule) { typeName = "NUMBER"; }; class GVAR(Spread): EditShort { - displayName = "Spread"; - tooltip = "Default dispersion of the main salvo"; + displayName = CSTRING(Module_TaskArtillery_Spread_DisplayName); + tooltip = CSTRING(Module_TaskArtillery_Spread_Tooltip); property = QGVAR(Spread); defaultValue = "75"; unique = 0; @@ -41,8 +41,8 @@ class GVAR(TaskArtillery) : GVAR(BaseModule) { typeName = "NUMBER"; }; class GVAR(SkipCheckRounds): Checkbox { - displayName = "Skip adjusting rounds"; - tooltip = "Check this to disable initial rounds used by the fire controller to adjust rounds on target.\nSkipping this will make the barrage immediately hit on target"; + displayName = CSTRING(Module_TaskArtillery_SkipCheckrounds_DisplayName); + tooltip = CSTRING(Module_TaskArtillery_SkipCheckrounds_Tooltip); property = QGVAR(SkipCheckRounds); unique = 0; validate = "none"; @@ -52,14 +52,14 @@ class GVAR(TaskArtillery) : GVAR(BaseModule) { class ModuleDescription: ModuleDescription {}; }; class ModuleDescription: ModuleDescription { - description = "This location is targeted by the first available artillery unit of a given side. The artillery unit must be registered to the side and be within striking distance"; + description = CSTRING(Module_TaskArtillery_ModuleDescription); }; }; class GVAR(TaskArtilleryRegister) : GVAR(BaseModule) { _generalMacro = QGVAR(TaskArtilleryRegister); scope = 2; - displayName = "Task Artillery Register"; + displayName = CSTRING(Module_TaskArtilleryRegister_DisplayName); category = "Lambs_Danger_WP_Cat"; function = QFUNC(moduleArtilleryRegister); icon = "\A3\ui_f\data\igui\cfg\simpleTasks\types\intel_ca.paa"; @@ -76,22 +76,22 @@ class GVAR(TaskArtilleryRegister) : GVAR(BaseModule) { class ModuleDescription: ModuleDescription { duplicate = 1; direction = 1; - description = "Register units to that sides artillery pool."; + description = CSTRING(Module_TaskArtilleryRegister_ModuleDescription); }; }; class GVAR(TaskAssault) : GVAR(BaseModule) { _generalMacro = QGVAR(TaskAssault); scope = 2; - displayName = "Task Assault/Retreat"; + displayName = CSTRING(Module_TaskAssault_DisplayName); category = "Lambs_Danger_WP_Cat"; function = QFUNC(moduleAssault); icon = "\a3\ui_f\data\GUI\Cfg\CommunicationMenu\attack_ca.paa"; portrait = "\a3\ui_f\data\GUI\Cfg\CommunicationMenu\attack_ca.paa"; class Attributes: AttributesBase { class GVAR(IsRetreat): Checkbox { - displayName = "Unit is fleeing"; - tooltip = "Enable this to make the unit retreat and ignore enemies"; + displayName = CSTRING(Module_TaskAssault_Retreating_DisplayName); + tooltip = CSTRING(Module_TaskAssault_Retreating_Tooltip); property = QGVAR(IsRetreat); unique = 0; validate = "none"; @@ -99,8 +99,8 @@ class GVAR(TaskAssault) : GVAR(BaseModule) { typeName = "BOOL"; }; class GVAR(DeleteOnStartUp): Checkbox { - displayName = "Remove module on Start-Up"; - tooltip = "Deletes module on startup.\nIf unchecked it is possible to move the module to change destination dynamically"; + displayName = CSTRING(Module_TaskAssault_DeleteOnStartup_DisplayName); + tooltip = CSTRING(Module_TaskAssault_DeleteOnStartup_Tooltip); property = QGVAR(DeleteOnStartUp); unique = 0; validate = "none"; @@ -108,8 +108,8 @@ class GVAR(TaskAssault) : GVAR(BaseModule) { typeName = "BOOL"; }; class GVAR(DistanceThreshold): EditShort { - displayName = "Completion Threshold"; - tooltip = "Units within this many meters will revert to regular behavior"; + displayName = CSTRING(Module_TaskAssault_DistanceThreshold_DisplayName); + tooltip = CSTRING(Module_TaskAssault_DistanceThreshold_Tooltip); property = QGVAR(DistanceThreshold); defaultValue = "15"; unique = 0; @@ -118,8 +118,8 @@ class GVAR(TaskAssault) : GVAR(BaseModule) { typeName = "NUMBER"; }; class GVAR(CycleTime): EditShort { - displayName = "Script interval"; - tooltip = "The cycle time of the script"; + displayName = CSTRING(Module_TaskAssault_CycleTime_DisplayName); + tooltip = CSTRING(Module_TaskAssault_CycleTime_Tooltip); property = QGVAR(CycleTime); defaultValue = "3"; unique = 0; @@ -131,14 +131,14 @@ class GVAR(TaskAssault) : GVAR(BaseModule) { }; class ModuleDescription: ModuleDescription { duplicate = 1; - description = "Task Assault/Retreat is a multi-purpose module. It makes linked unit rush or retreat madly towards the module destination. The module can be moved to dynamically alter the final destination."; + description = CSTRING(Module_TaskAssault_ModuleDescription); }; }; class GVAR(TaskCamp) : GVAR(BaseModule) { _generalMacro = QGVAR(TaskCamp); scope = 2; - displayName = "Task Camp"; + displayName = CSTRING(Module_TaskCamp_DisplayName); category = "Lambs_Danger_WP_Cat"; function = QFUNC(moduleCamp); icon = "\a3\3DEN\Data\CfgWaypoints\Guard_ca.paa"; @@ -157,14 +157,14 @@ class GVAR(TaskCamp) : GVAR(BaseModule) { duplicate = 1; position = 1; direction = 1; - description = "Task Camp makes the unit appear to gather around a single point, typically a campsite. Some units will peel off to man static weapons, garrison buildings and patrol the area.
Set area in 3DEN."; + description = CSTRING(Module_TaskCamp_ModuleDescription); }; }; class GVAR(TaskCQB) : GVAR(BaseModule) { _generalMacro = QGVAR(TaskCQB); scope = 2; - displayName = "Task CQB"; + displayName = CSTRING(Module_TaskCQB_DisplayName); category = "Lambs_Danger_WP_Cat"; function = QFUNC(moduleCQB); icon = "\a3\3DEN\Data\CfgWaypoints\Scripted_ca.paa"; @@ -177,8 +177,8 @@ class GVAR(TaskCQB) : GVAR(BaseModule) { }; class Attributes: AttributesBase { class GVAR(CycleTime): EditShort { - displayName = "Script interval"; - tooltip = "The cycle time for the script in seconds. Higher numbers make units search buildings more carefully.\nDefault 21 seconds"; + displayName = CSTRING(Module_TaskCQB_CycleTime_DisplayName); + tooltip = CSTRING(Module_TaskCQB_CycleTime_Tooltip); property = QGVAR(CycleTime); defaultValue = "21"; unique = 0; @@ -187,8 +187,8 @@ class GVAR(TaskCQB) : GVAR(BaseModule) { typeName = "NUMBER"; }; class GVAR(DeleteOnStartUp): Checkbox { - displayName = "Remove Dynamic center"; - tooltip = "With the dynamic center present, it is possible to move the center point of the building search pattern"; + displayName = CSTRING(Module_TaskCQB_DeleteOnStartUp_DisplayName); + tooltip = CSTRING(Module_TaskCQB_DeleteOnStartUp_Tooltip); property = QGVAR(DeleteOnStartUp); unique = 0; validate = "none"; @@ -200,14 +200,14 @@ class GVAR(TaskCQB) : GVAR(BaseModule) { class ModuleDescription: ModuleDescription { duplicate = 1; direction = 1; - description = "Task CQB makes the unit search buildings with the area. Set the module size in 3DEN to configure the search area. The module can be moved to dynamically shift the searched area.

In general the module works best with a smaller AOE. Better to string multiple modules or waypoints together than have one massive one. Groups of the same side will share which buildings have been cleared and which still need searching."; + description = CSTRING(Module_TaskCQB_ModuleDescription); }; }; class GVAR(TaskGarrison) : GVAR(BaseModule) { _generalMacro = QGVAR(TaskGarrison); scope = 2; - displayName = "Task Garrison"; + displayName = CSTRING(Module_TaskGarrison_DisplayName); category = "Lambs_Danger_WP_Cat"; function = QFUNC(moduleGarrison); icon = "\a3\3DEN\Data\CfgWaypoints\Guard_ca.paa"; @@ -224,14 +224,14 @@ class GVAR(TaskGarrison) : GVAR(BaseModule) { class ModuleDescription: ModuleDescription { duplicate = 1; direction = 1; - description = "Task Garrison makes the unit take up positions in buildings and man available turrets and static weapons within an area defined by 3DEN attributes."; + description = CSTRING(Module_TaskGarrison_ModuleDescription); }; }; class GVAR(TaskPatrol) : GVAR(BaseModule) { _generalMacro = QGVAR(TaskPatrol); scope = 2; - displayName = "Task Patrol"; + displayName = CSTRING(Module_TaskPatrol_DisplayName); category = "Lambs_Danger_WP_Cat"; function = QFUNC(modulePatrol); icon = "\A3\3DEN\Data\CfgWaypoints\Loiter_ca.paa"; @@ -244,8 +244,8 @@ class GVAR(TaskPatrol) : GVAR(BaseModule) { }; class Attributes: AttributesBase { class GVAR(WaypointCount): EditShort { - displayName = "Waypoints"; - tooltip = "Number of waypoints created"; + displayName = CSTRING(Module_TaskPatrol_Waypoints_DisplayName); + tooltip = CSTRING(Module_TaskPatrol_Waypoints_Tooltip); property = QGVAR(WaypointCount); defaultValue = "4"; unique = 0; @@ -254,8 +254,8 @@ class GVAR(TaskPatrol) : GVAR(BaseModule) { typeName = "NUMBER"; }; class GVAR(MoveWaypoints): Checkbox { - displayName = "Dynamic patrol pattern"; - tooltip = "The unit will generate a new patrol pattern once one patrol cycle is complete"; + displayName = CSTRING(Module_TaskPatrol_MoveWaypoints_DisplayName); + tooltip = CSTRING(Module_TaskPatrol_MoveWaypoints_Tooltip); property = QGVAR(moveWaypoints); unique = 0; validate = "none"; @@ -267,20 +267,23 @@ class GVAR(TaskPatrol) : GVAR(BaseModule) { class ModuleDescription: ModuleDescription { duplicate = 1; direction = 1; - description = "Task Patrol makes the unit patrol within the area set by 3DEN attributes."; + description = CSTRING(Module_TaskPatrol_ModuleDescription); }; }; class GVAR(TaskReset) : GVAR(BaseModule) { _generalMacro = QGVAR(TaskReset); scope = 2; - displayName = "Task Reset"; + displayName = CSTRING(Module_TaskReset_DisplayName); category = "Lambs_Danger_WP_Cat"; function = QFUNC(moduleReset); icon = "\a3\3DEN\Data\CfgWaypoints\Scripted_ca.paa"; portrait = "\a3\3DEN\Data\CfgWaypoints\Scripted_ca.paa"; + class Attributes: AttributesBase { + class ModuleDescription: ModuleDescription {}; + }; class ModuleDescription: ModuleDescription { - description = "This module resets all custom LAMBS scripts running on the unit"; + description = CSTRING(Module_TaskReset_ModuleDescription); // THIS IS NOT SHOWING UP @JOKO }; }; @@ -288,7 +291,7 @@ class GVAR(TaskReset) : GVAR(BaseModule) { class GVAR(TaskCreep) : GVAR(BaseModule) { _generalMacro = QGVAR(TaskCreep); scope = 2; - displayName = "Task Creep"; + displayName = CSTRING(Module_TaskCreep_DisplayName); category = "Lambs_Danger_WP_Search_Cat"; function = QFUNC(moduleCreep); icon = "\a3\3DEN\Data\CfgWaypoints\Sentry_ca.paa"; @@ -301,8 +304,8 @@ class GVAR(TaskCreep) : GVAR(BaseModule) { }; class Attributes: AttributesBase { class GVAR(MovingCenter): Checkbox { - displayName = "Use Group As Center"; - tooltip = "The creeping group will use the group leader as a center for the search pattern. Disable to have the unit use the module position instead. This creates a more defensive group"; + displayName = CSTRING(Module_TaskCreep_MovingCenter_DisplayName); + tooltip = CSTRING(Module_TaskCreep_MovingCenter_Tooltip); property = QGVAR(MovingCenter); unique = 0; validate = "none"; @@ -311,8 +314,8 @@ class GVAR(TaskCreep) : GVAR(BaseModule) { defaultValue = "(true)"; }; class GVAR(CycleTime): EditShort { - displayName = "Script interval"; - tooltip = "The cycle time for the script in seconds. Higher numbers can be used to make the creeping group less accurate.\nDefault 15 seconds"; + displayName = CSTRING(Module_TaskCreep_CycleTime_DisplayName); + tooltip = CSTRING(Module_TaskCreep_CycleTime_Tooltip); property = QGVAR(CycleTime); defaultValue = "15"; unique = 0; @@ -325,14 +328,14 @@ class GVAR(TaskCreep) : GVAR(BaseModule) { class ModuleDescription: ModuleDescription { duplicate = 1; direction = 1; - description = "Task Creep makes the unit attempt to ambush enemies within the area set by 3DEN attributes. The group will use available cover and keep a low stance to remain undiscovered.

Search modules only target hostile players"; + description = CSTRING(Module_TaskCreep_ModuleDescription); }; }; class GVAR(TaskHunt) : GVAR(BaseModule) { _generalMacro = QGVAR(TaskHunt); scope = 2; - displayName = "Task Hunt"; + displayName = CSTRING(Module_TaskHunt_DisplayName); category = "Lambs_Danger_WP_Search_Cat"; function = QFUNC(moduleHunt); icon = "\a3\3DEN\Data\CfgWaypoints\Sentry_ca.paa"; @@ -345,8 +348,8 @@ class GVAR(TaskHunt) : GVAR(BaseModule) { }; class Attributes: AttributesBase { class GVAR(MovingCenter): Checkbox { - displayName = "Use Group As Center"; - tooltip = "The hunting group will use the group leader as a center for the search pattern. Disable to have the unit use the module position instead. This creates a more defensive group"; + displayName = CSTRING(Module_TaskHunt_MovingCenter_DisplayName); + tooltip = CSTRING(Module_TaskHunt_MovingCenter_ToolTip); property = QGVAR(MovingCenter); unique = 0; validate = "none"; @@ -355,8 +358,8 @@ class GVAR(TaskHunt) : GVAR(BaseModule) { defaultValue = "(true)"; }; class GVAR(CycleTime): EditShort { - displayName = "Script interval"; - tooltip = "The cycle time for the script in seconds. Higher numbers can be used to make the hunting group less accurate.\nDefault 70 seconds"; + displayName = CSTRING(Module_TaskHunt_CycleTime_DisplayName); + tooltip = CSTRING(Module_TaskHunt_CycleTime_ToolTip); property = QGVAR(CycleTime); defaultValue = "70"; unique = 0; @@ -369,14 +372,14 @@ class GVAR(TaskHunt) : GVAR(BaseModule) { class ModuleDescription: ModuleDescription { duplicate = 1; direction = 1; - description = "Task Hunt makes the unit patrol the area within the area set by 3DEN attributes. The group will move casually in a search pattern gradually spiraling closer to the target. The unit will enable flashlights if available.

Search modules only target hostile players."; + description = CSTRING(Module_TaskHunt_ModuleDescription); }; }; class GVAR(TaskRush) : GVAR(BaseModule) { _generalMacro = QGVAR(TaskRush); scope = 2; - displayName = "Task Rush"; + displayName = CSTRING(Module_TaskRush_DisplayName); category = "Lambs_Danger_WP_Search_Cat"; function = QFUNC(moduleRush); icon = "\a3\3DEN\Data\CfgWaypoints\Sentry_ca.paa"; @@ -389,8 +392,8 @@ class GVAR(TaskRush) : GVAR(BaseModule) { }; class Attributes: AttributesBase { class GVAR(MovingCenter): Checkbox { - displayName = "Use Group As Center"; - tooltip = "The rushing group will use the group leader as a center for the search pattern. Disable to have the unit use the module position instead. This creates a more defensive group"; + displayName = CSTRING(Module_TaskRush_MovingCenter_DisplayName); + tooltip = CSTRING(Module_TaskRush_MovingCenter_ToolTip); property = QGVAR(MovingCenter); unique = 0; validate = "none"; @@ -399,8 +402,8 @@ class GVAR(TaskRush) : GVAR(BaseModule) { defaultValue = "(true)"; }; class GVAR(CycleTime): EditShort { - displayName = "Script interval"; - tooltip = "The cycle time for the script in seconds. Higher numbers can be used to make rushers less accurate.\nDefault 4 seconds"; + displayName = CSTRING(Module_TaskRush_CycleTime_DisplayName); + tooltip = CSTRING(Module_TaskRush_CycleTime_ToolTip); property = QGVAR(CycleTime); defaultValue = "4"; unique = 0; @@ -413,6 +416,6 @@ class GVAR(TaskRush) : GVAR(BaseModule) { class ModuleDescription: ModuleDescription { duplicate = 1; direction = 1; - description = "Task Rush makes the unit attempt to run aggressively towards enemies within the area set by 3DEN attributes. The unit will move extremely aggressively, often ignoring cover and suppression.

Search modules only target hostile players. Disable unit FSM for a truly terrifying enemy."; + description = CSTRING(Module_TaskRush_ModuleDescription); }; }; diff --git a/addons/wp/settings.sqf b/addons/wp/settings.sqf index e12ca3e2..84608faa 100644 --- a/addons/wp/settings.sqf +++ b/addons/wp/settings.sqf @@ -1,4 +1,4 @@ -private _curCat = "Settings"; +private _curCat = ELSTRING(Danger,Settings_MainCat); // Enable automatic artillery registration DFUNC(ArtilleryScan) = { if (!GVAR(autoAddArtillery)) exitWith { @@ -16,7 +16,7 @@ GVAR(autoArtilleryRunning) = false; [ QGVAR(autoAddArtillery), "CHECKBOX", - ["Enable automatic artillery registration", "Automatically adds artillery already present in the mission to Side"], + [LSTRING(Settings_AutoRegisterArtillery_DisplayName), LSTRING(Settings_AutoRegisterArtillery_ToolTip)], [COMPONENT_NAME, _curCat], false, true, { diff --git a/addons/wp/stringtable.xml b/addons/wp/stringtable.xml new file mode 100644 index 00000000..bd3b4e00 --- /dev/null +++ b/addons/wp/stringtable.xml @@ -0,0 +1,260 @@ + + + + + Register as LAMBS artillery + + + Vehicle will be automatically registered as available artillery for dynamic strikes + + + Dynamic Target + + + Task Artillery + + + This location is targeted by the first available artillery unit of a given side. The artillery unit must be registered to the side and be within striking distance + + + Side + + + Which side is calling for artillery + + + Main Salvo + + + Number of rounds in the main salvo + + + Spread + + + Default dispersion of the main salvo + + + Skip adjusting rounds + + + Check this to disable initial rounds used by the fire controller to adjust rounds on target.\nSkipping this will make the barrage immediately hit on target + + + Artillery target created for %1 + + + Task Artillery Register + + + Register units to that sides artillery pool. + + + Units have been added to Artillery Pool + + + No Units have been added to Artillery Pool + + + Task Assault/Retreat + + + Task Assault/Retreat is a multi-purpose module. It makes linked unit rush or retreat madly towards the module destination. The module can be moved to dynamically alter the final destination. + + + Unit is fleeing + + + Enable this to make the unit retreat and ignore enemies + + + Remove module on Start-Up + + + Deletes module on startup.\nIf unchecked it is possible to move the module to change destination dynamically + + + Completion Threshold + + + Units within this many meters will revert to regular behavior + + + Script interval + + + The cycle time of the script + + + Task Camp + + + Task Camp makes the unit appear to gather around a single point, typically a campsite. Some units will peel off to man static weapons, garrison buildings and patrol the area.<br/>Set area in 3DEN. + + + Radius + + + Radius buildings and static weapons are garrisoned and manned\nTwice this number is used for patrols + + + Task CQB + + + Script interval + + + The cycle time for the script in seconds. Higher numbers make units search buildings more carefully.\nDefault 21 seconds + + + Remove Dynamic center + + + With the dynamic center present, it is possible to move the center point of the building search pattern + + + Radius + + + Max distance houses will be searched + + + Task CQB makes the unit search buildings with the area. Set the module size in 3DEN to configure the search area. The module can be moved to dynamically shift the searched area.<br/><br/>In general the module works best with a smaller AOE. Better to string multiple modules or waypoints together than have one massive one. Groups of the same side will share which buildings have been cleared and which still need searching. + + + Task Garrison + + + Radius + + + Distance buildings are occupied + + + Task Garrison makes the unit take up positions in buildings and man available turrets and static weapons within an area defined by 3DEN attributes. + + + Task Patrol + + + Waypoints + + + Number of waypoints created + + + Dynamic patrol pattern + + + The unit will generate a new patrol pattern once one patrol cycle is complete + + + Range + + + Max distance between waypoints + + + Task Patrol makes the unit patrol within the area set by 3DEN attributes. + + + Task Reset + + + This module resets all custom LAMBS scripts running on the unit + + + Task Creep + + + Use Group As Center + + + The creeping group will use the group leader as a center for the search pattern. Disable to have the unit use the module position instead. This creates a more defensive group + + + Script interval + + + The cycle time for the script in seconds. Higher numbers can be used to make the creeping group less accurate.\nDefault 15 seconds + + + Radius + + + Distance creeping group will search for enemies.\nThis module only targets enemy players + + + Task Creep makes the unit attempt to ambush enemies within the area set by 3DEN attributes. The group will use available cover and keep a low stance to remain undiscovered.<br/><br/>Search modules only target hostile players + + + Task Hunt + + + Task Hunt makes the unit patrol the area within the area set by 3DEN attributes. The group will move casually in a search pattern gradually spiraling closer to the target. The unit will enable flashlights if available.<br/><br/>Search modules only target hostile players. + + + Use Group As Center + + + The hunting group will use the group leader as a center for the search pattern. Disable to have the unit use the module position instead. This creates a more defensive group + + + Script interval + + + The cycle time for the script in seconds. Higher numbers can be used to make the hunting group less accurate.\nDefault 70 seconds + + + Radius + + + Distance hunting group will search for enemies.\nThis module only targets enemy players + + + Task Rush + + + Task Rush makes the unit attempt to run aggressively towards enemies within the area set by 3DEN attributes. The unit will move extremely aggressively, often ignoring cover and suppression.<br/><br/>Search modules only target hostile players. Disable unit FSM for a truly terrifying enemy. + + + Use Group As Center + + + The rushing group will use the group leader as a center for the search pattern. Disable to have the unit use the module position instead. This creates a more defensive group + + + Script interval + + + The cycle time for the script in seconds. Higher numbers can be used to make rushers less accurate.\nDefault 4 seconds + + + Radius + + + Distance rushing group will search for enemies.\nThis module only targets enemy players + + + Enable automatic artillery registration + + + Automatically adds artillery already present in the mission to Side + + + Self + + + Groups + + + Select which unit script applies to.\nList is sorted by distance + + + Center + + + Sets center for the script execution. This can be self or a LAMBS Dynamic Target selected from the list + + + diff --git a/addons/wp/zeusModules.hpp b/addons/wp/zeusModules.hpp index b9b228eb..69c9eef4 100644 --- a/addons/wp/zeusModules.hpp +++ b/addons/wp/zeusModules.hpp @@ -4,7 +4,7 @@ class GVAR(Target) : Module_F { scope = 1; scopeCurator = 2; isGlobal = 0; - displayName = "Dynamic Target"; + displayName = CSTRING(Module_Target_DisplayName); category = "Lambs_Danger_WP_Cat"; icon = "\a3\3den\Data\CfgWaypoints\destroy_ca.paa"; portrait = "\a3\3den\Data\CfgWaypoints\destroy_ca.paa"; @@ -23,7 +23,7 @@ class GVAR(ZeusTaskArtillery) : Module_F { scopeCurator = 2; isGlobal = 0; is3DEN = 1; - displayName = "Task Artillery"; + displayName = CSTRING(Module_TaskArtillery_DisplayName); category = "Lambs_Danger_WP_Cat"; icon = "\a3\ui_f\data\IGUI\Cfg\simpleTasks\types\destroy_ca.paa"; portrait = "\a3\ui_f\data\IGUI\Cfg\simpleTasks\types\destroy_ca.paa"; @@ -42,7 +42,7 @@ class GVAR(ZeusTaskArtilleryRegister) : Module_F { scopeCurator = 2; isGlobal = 0; is3DEN = 1; - displayName = "Task Artillery Register"; + displayName = CSTRING(Module_TaskArtilleryRegister_DisplayName); category = "Lambs_Danger_WP_Cat"; icon = "\A3\ui_f\data\igui\cfg\simpleTasks\types\intel_ca.paa"; portrait = "\A3\ui_f\data\igui\cfg\simpleTasks\types\intel_ca.paa"; @@ -61,7 +61,7 @@ class GVAR(ZeusTaskAssault) : Module_F { scopeCurator = 2; isGlobal = 0; is3DEN = 1; - displayName = "Task Assault/Retreat"; + displayName = CSTRING(Module_TaskAssault_DisplayName); category = "Lambs_Danger_WP_Cat"; icon = "\a3\ui_f\data\GUI\Cfg\CommunicationMenu\attack_ca.paa"; portrait = "\a3\ui_f\data\GUI\Cfg\CommunicationMenu\attack_ca.paa"; @@ -80,7 +80,7 @@ class GVAR(ZeusTaskCamp) : Module_F { scopeCurator = 2; isGlobal = 0; is3DEN = 1; - displayName = "Task Camp"; + displayName = CSTRING(Module_TaskCamp_DisplayName); category = "Lambs_Danger_WP_Cat"; icon = "\a3\3DEN\Data\CfgWaypoints\Guard_ca.paa"; portrait = "\a3\3DEN\Data\CfgWaypoints\Guard_ca.paa"; @@ -99,7 +99,7 @@ class GVAR(ZeusTaskCQB) : Module_F { scopeCurator = 2; isGlobal = 0; is3DEN = 1; - displayName = "Task CQB"; + displayName = CSTRING(Module_TaskCQB_DisplayName); category = "Lambs_Danger_WP_Cat"; icon = "\a3\3DEN\Data\CfgWaypoints\Scripted_ca.paa"; portrait = "\a3\3DEN\Data\CfgWaypoints\Scripted_ca.paa"; @@ -118,7 +118,7 @@ class GVAR(ZeusTaskGarrison) : Module_F { scopeCurator = 2; isGlobal = 0; is3DEN = 1; - displayName = "Task Garrison"; + displayName = CSTRING(Module_TaskGarrison_DisplayName); category = "Lambs_Danger_WP_Cat"; icon = "\a3\3DEN\Data\CfgWaypoints\Guard_ca.paa"; portrait = "\a3\3DEN\Data\CfgWaypoints\Guard_ca.paa"; @@ -137,7 +137,7 @@ class GVAR(ZeusTaskPatrol) : Module_F { scopeCurator = 2; isGlobal = 0; is3DEN = 1; - displayName = "Task Patrol"; + displayName = CSTRING(Module_TaskPatrol_DisplayName); category = "Lambs_Danger_WP_Cat"; icon = "\A3\3DEN\Data\CfgWaypoints\Loiter_ca.paa"; portrait = "\A3\3DEN\Data\CfgWaypoints\Loiter_ca.paa"; @@ -156,7 +156,7 @@ class GVAR(ZeusTaskReset) : Module_F { scopeCurator = 2; isGlobal = 0; is3DEN = 1; - displayName = "Task Reset"; + displayName = CSTRING(Module_TaskReset_DisplayName); category = "Lambs_Danger_WP_Cat"; icon = "\a3\3DEN\Data\CfgWaypoints\Scripted_ca.paa"; portrait = "\a3\3DEN\Data\CfgWaypoints\Scripted_ca.paa"; @@ -176,7 +176,7 @@ class GVAR(ZeusTaskCreep) : Module_F { scopeCurator = 2; isGlobal = 0; is3DEN = 1; - displayName = "Task Creep"; + displayName = CSTRING(Module_TaskCreep_DisplayName); category = "Lambs_Danger_WP_Search_Cat"; icon = "\a3\3DEN\Data\CfgWaypoints\Sentry_ca.paa"; portrait = "\a3\3DEN\Data\CfgWaypoints\Sentry_ca.paa"; @@ -195,7 +195,7 @@ class GVAR(ZeusTaskHunt) : Module_F { scopeCurator = 2; isGlobal = 0; is3DEN = 1; - displayName = "Task Hunt"; + displayName = CSTRING(Module_TaskHunt_DisplayName); category = "Lambs_Danger_WP_Search_Cat"; icon = "\a3\3DEN\Data\CfgWaypoints\Sentry_ca.paa"; portrait = "\a3\3DEN\Data\CfgWaypoints\Sentry_ca.paa"; @@ -214,7 +214,7 @@ class GVAR(ZeusTaskRush) : Module_F { scopeCurator = 2; isGlobal = 0; is3DEN = 1; - displayName = "Task Rush"; + displayName = CSTRING(Module_TaskRush_DisplayName); category = "Lambs_Danger_WP_Search_Cat"; icon = "\a3\3DEN\Data\CfgWaypoints\Sentry_ca.paa"; portrait = "\a3\3DEN\Data\CfgWaypoints\Sentry_ca.paa"; diff --git a/tools/stringtableDeploy.py b/tools/stringtableDeploy.py new file mode 100644 index 00000000..48dae363 --- /dev/null +++ b/tools/stringtableDeploy.py @@ -0,0 +1,60 @@ +#!/usr/bin/env python3 + +################################### +# ZEN automatic deployment script # +# =============================== # +# This is not meant to be run # +# directly! # +################################### + +import os +import sys +import shutil +import traceback +import subprocess as sp +from github import Github + +TRANSLATIONISSUE = 91 +TRANSLATIONBODY = """**[Translation Guide](http://ace3mod.com/wiki/development/how-to-translate-ace3.html)** +{} +""" + +REPOUSER = "nk3nny" +REPONAME = "LambsDanger" +REPOPATH = "{}/{}".format(REPOUSER,REPONAME) + + +def update_translations(repo): + diag = sp.check_output(["python3", "tools/stringtablediag.py", "--markdown"]) + diag = str(diag, "utf-8") + issue = repo.get_issue(TRANSLATIONISSUE) + issue.edit(body=TRANSLATIONBODY.format(diag)) + + +def main(): + print("Obtaining token ...") + try: + token = os.environ["GH_TOKEN"] + repo = Github(token).get_repo(REPOPATH) + except: + print("Could not obtain token.") + print(traceback.format_exc()) + return 1 + else: + print("Token sucessfully obtained.") + + print("\nUpdating translation issue ...") + try: + update_translations(repo) + except: + print("Failed to update translation issue.") + print(traceback.format_exc()) + return 1 + else: + print("Translation issue successfully updated.") + + return 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/tools/stringtable_validator.py b/tools/stringtable_validator.py new file mode 100644 index 00000000..a4642284 --- /dev/null +++ b/tools/stringtable_validator.py @@ -0,0 +1,186 @@ +#!/usr/bin/env python3 + +import fnmatch +import os +import sys +import xml.etree.ElementTree as ET + +# STRINGTABLE VALIDATOR +# Author: mharis001 +# --------------------- +# Verifies all stringtable.xml files in the project. Checks for: +# - proper XML tree structure. +# - English as first translation. +# - no Original translation. +# - duplicated entries and languages. + + +######## GLOBALS ######### +PROJECT_NAME = "Lambs" +########################## + + +def check_stringtable(filepath): + try: + tree = ET.parse(filepath) + except: + print(" ERROR: Failed to parse file.") + return 1 + + errors = 0 + + # Verify that the root tag is Project and its name attribute is the project name + root = tree.getroot() + + if root.tag != "Project": + print(" ERROR: Invalid root tag '{}' found, must be 'Project'.".format(root.tag)) + errors += 1 + + if root.get("name") != PROJECT_NAME: + print(" ERROR: Invalid name attribute '{}' for Project tag, must be '{}'.".format(root.get("name"), PROJECT_NAME)) + errors += 1 + + # Verify that the root has a Package tag and its name attribute matches the component's folder name + package = root.find("Package") + + if package is None: + print(" ERROR: Failed to find 'Package' tag under 'Project' tag.") + errors += 1 + else: + package_name = package.get("name") + + if package_name.islower(): + print(" ERROR: Package name attribute '{}' is all lowercase, should be in titlecase.".format(package_name)) + errors += 1 + + if package_name.lower() != os.path.basename(os.path.dirname(filepath)): + print(" ERROR: Package name attribute '{}' does not match the component folder name.".format(package_name)) + errors += 1 + + # Get all keys contained in the stringtable + keys = package.findall("Key") + + for container in package.findall("Container"): + keys.extend(container.findall("Key")) + + key_ids = [] + key_prefix = "STR_{}_{}_".format(PROJECT_NAME, package_name) + + for key in keys: + key_id = key.get("ID") + + # Verify that the key has a valid ID attribute + if key_id is None: + print(" ERROR: Key '{}' had no ID attribute.".format(key_id)) + errors += 1 + elif key_id.find(key_prefix) != 0: + print(" ERROR: Key '{}' does not have a valid ID attribute, should be in format {}{{name}}.".format(key_id, key_prefix)) + errors += 1 + + key_ids.append(key_id) + + # Verify language entries for the key, check that the key: + # - contains at least one translation + # - does not contain an Original translation + # - has English as the first listed translation + # - has only one entry for each language + entries = list(key) + + if len(entries) == 0: + print(" ERROR: Key '{}' has no translation entries.".format(key_id)) + errors += 1 + else: + if not key.find("Original") is None: + print(" ERROR: Key '{}' has an Original translation, unnecessary with English as first.".format(key_id)) + errors += 1 + + if entries[0].tag != "English": + print(" ERROR: Key '{}' does not have its English translation listed first.".format(key_id)) + errors += 1 + + languages = list(map(lambda l: l.tag, entries)) + + for language in set(languages): + count = languages.count(language) + + if count > 1: + print(" ERROR: Key '{}' has {} {} translations.".format(key_id, count, language)) + errors += 1 + + # Verify that key IDs are unique + for id in set(key_ids): + count = key_ids.count(id) + + if count > 1: + print(" ERROR: Key '{}' is defined {} times.".format(id, count)) + errors += 1 + + # Check whitespace for tabs and correct number of indenting spaces + with open(filepath, "r", encoding = "utf-8") as file: + spacing_depth = 0 + + for line_number, line in enumerate(file, 1): + if "\t" in line: + print(" ERROR: Found a tab on line {}.".format(line_number)) + errors += 1 + + line_clean = line.lstrip().lower() + + if line_clean.startswith("