mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2026-02-07 08:42:54 +03:00
Do not use localize on server machine
These were resulting in sloppy mixed language sentences. The server language never changes, so localize should not be used server side, unless complete translations are added for all logs, which is not worth the effort. Only admins see them, unlike client side strings which are seen by everyone.
This commit is contained in:
@@ -126,9 +126,9 @@ _fnc_lockCode = {
|
||||
_color = "";
|
||||
_code = _code - 10000;
|
||||
|
||||
if (_code <= 99) then {_color = localize "STR_TEAM_RED";};
|
||||
if (_code >= 100 && _code <= 199) then {_color = localize "STR_TEAM_GREEN"; _code = _code - 100;};
|
||||
if (_code >= 200) then {_color = localize "STR_TEAM_BLUE"; _code = _code - 200;};
|
||||
if (_code <= 99) then {_color = "Red";};
|
||||
if (_code >= 100 && _code <= 199) then {_color = "Green"; _code = _code - 100;};
|
||||
if (_code >= 200) then {_color = "Blue"; _code = _code - 200;};
|
||||
if (_code <= 9) then {_code = format["0%1", _code];};
|
||||
_code = format ["%1%2",_color,_code];
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "\z\addons\dayz_server\compile\server_toggle_debug.hpp"
|
||||
|
||||
private ["_characterID","_minutes","_newObject","_playerID","_playerName","_key","_pos","_infected","_sourceName","_sourceWeapon","_distance","_message","_method","_suicide","_bodyName","_type"];
|
||||
private ["_characterID","_minutes","_newObject","_playerID","_playerName","_key","_pos","_infected","_sourceName","_sourceWeapon","_distance","_message","_method","_suicide","_bodyName","_type","_english"];
|
||||
//[unit, weapon, muzzle, mode, ammo, magazine, projectile]
|
||||
|
||||
_characterID = _this select 0;
|
||||
@@ -74,13 +74,34 @@ if (_playerName != "unknown" or _sourceName != "unknown") then {
|
||||
_bodyName = _message select 1;
|
||||
|
||||
if (_type == "killed" && _sourceName == "AI") then {
|
||||
_message set [2, (localize "STR_PLAYER_AI")];
|
||||
_message set [2,"AI"];
|
||||
};
|
||||
|
||||
_english = [ //Do not use localize on server machine
|
||||
"shot","a gunshot wound.",
|
||||
"shothead","a gunshot to the head.",
|
||||
"shotheavy","a large calibre gunshot.",
|
||||
"bled","blood loss.",
|
||||
"dehyd","dehydration.",
|
||||
"sick","infection.",
|
||||
"starve","starvation.",
|
||||
"combatlog","combat logging.",
|
||||
"explosion","an explosion.",
|
||||
"unknown","an unknown cause.",
|
||||
"zombie","the infected.",
|
||||
"fall","falling.",
|
||||
"crash","a vehicle crash.",
|
||||
"runover","being run over.",
|
||||
"eject","falling out of a moving vehicle.",
|
||||
"melee","blunt force trauma.",
|
||||
"rad","radiation.",
|
||||
"crushed","being crushed."
|
||||
];
|
||||
|
||||
_message = switch _type do {
|
||||
case "died": {format [localize "str_player_death_died", _bodyName, localize format["str_death_%1",_message select 2]]};
|
||||
case "killed": {format [localize "str_player_death_killed", _bodyName, _message select 2, _message select 3, _message select 4]};
|
||||
case "suicide": {format [localize "str_player_death_suicide", _bodyName]};
|
||||
case "died": {format ["%1 died from %2", _bodyName, (_english select ((_english find (_message select 2))+1))]};
|
||||
case "killed": {format ["%1 was killed by %2 with a %3 from %4m", _bodyName, _message select 2, _message select 3, _message select 4]};
|
||||
case "suicide": {format ["%1 committed suicide", _bodyName]};
|
||||
};
|
||||
diag_log format["DeathMessage: %1",_message];
|
||||
};
|
||||
|
||||
@@ -25,9 +25,9 @@ if (count _this > 7) then {
|
||||
if (typeName _currency == "STRING") then {_price = format ["%1 %2",_price,_currency];};
|
||||
|
||||
if (_buyorsell == 0) then { // Buy
|
||||
_message = format["%1: %2 (%3) purchased %4x %5 into %6 at %7 for %8",localize "STR_EPOCH_PLAYER_289",_name,_playerUID,_quantity,_classname,_container,_traderCity,_price];
|
||||
_message = format["Trader Menu: %1 (%2) purchased %3x %4 into %5 at %6 for %7",_name,_playerUID,_quantity,_classname,_container,_traderCity,_price];
|
||||
} else { // Sell
|
||||
_message = format["%1: %2 (%3) sold %4x %5 from %6 at %7 for %8",localize "STR_EPOCH_PLAYER_289",_name,_playerUID,_quantity,_classname,_container,_traderCity,_price];
|
||||
_message = format["Trader Menu: %1 (%2) sold %3x %4 from %5 at %6 for %7",_name,_playerUID,_quantity,_classname,_container,_traderCity,_price];
|
||||
};
|
||||
|
||||
diag_log _message;
|
||||
|
||||
@@ -444,7 +444,7 @@ if (dayz_townGenerator) then {execVM "\z\addons\dayz_server\system\lit_fireplace
|
||||
_source = _x select 1;
|
||||
if (!isNull _source) then {
|
||||
diag_log format ["P1ayer %1 hit by %2 %3 from %4 meters in %5 for %6 damage",
|
||||
_unit call fa_plr2Str, if (!isPlayer _source && alive _source) then {localize "STR_PLAYER_AI"} else {_source call fa_plr2Str}, toString (_x select 2), _x select 3, _x select 4, _x select 5];
|
||||
_unit call fa_plr2Str, if (!isPlayer _source && alive _source) then {"AI"} else {_source call fa_plr2Str}, toString (_x select 2), _x select 3, _x select 4, _x select 5];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user