Currently, Tasks in the Task Framework only the Description and Title main string is localized.
Would it be possible to have a tweak to this to allow format parameters to also be checked for localization?
eg BIS_fnc_setTaskLocal currently looks like this...
private _fnc_localize = { if (typeName _this == typeName "") then { if (isLocalized _this) then {localize _this} else {_this}; } else { private _array =+ _this; private _text = _array select 0; if (islocalized _text) then {_array set [0,localize _text];}; if (count _array > 1) then { _array = format _array; } else { _array = _array select 0; }; _array }; }; //SNIP /*-------------------------------------------------------------------------------------------------- Preprocess data --------------------------------------------------------------------------------------------------*/ //localize task texts _description = _description call _fnc_localize; _title = _title call _fnc_localize;
Where only the main string is localized before formatting any parameters.
Maybe instead something like...
private _fnc_localize = { params[ "_text", "", [ "", [] ] ]; if ( typeName _text isEqualType [] ) then { _text = _text apply{ if ( _x isEqualType "" && { isLocalized _x } ) then { localize _x } else { _x } }; format _text; }else{ if (isLocalized _text) then {localize _text} else {_text}; }; }; //SNIP /*-------------------------------------------------------------------------------------------------- Preprocess data --------------------------------------------------------------------------------------------------*/ //localize task texts _description = _description call _fnc_localize; _title = _title call _fnc_localize;
So any of the format parameters can also be localized per client. This would allow better Descriptions and Titles of randomised tasks.