From f804a7d4e205b2dcae4ced184d3ed5e6973af865 Mon Sep 17 00:00:00 2001 From: richard Date: Sun, 23 Aug 2009 17:03:14 +0200 Subject: [PATCH] Fixes in translations. Added note about compiling. See details. Fixed weapon type restriction menu not translating the first time. Fixed zmarket weapon type selection menu title not translated. Fixed too short title string space in zmarket loadout, ztele force, zspawn force and hit group menus. Fixed "empty" phrase not translated. Fixed on/off translation string space too short in hit group menu. --- compiling.txt | 25 +++++++++++++++++++++++++ src/zr/config.inc | 4 ++-- src/zr/hitgroups.inc | 4 ++-- src/zr/menu.inc | 6 +++++- src/zr/weapons/menu_weapons.inc | 3 +++ src/zr/weapons/zmarket.inc | 3 ++- 6 files changed, 39 insertions(+), 6 deletions(-) create mode 100644 compiling.txt diff --git a/compiling.txt b/compiling.txt new file mode 100644 index 0000000..b0c6213 --- /dev/null +++ b/compiling.txt @@ -0,0 +1,25 @@ +This plugin has a command for dumping detailed version info (zr_version) based +on info from a automatically generated file (hgversion.h.inc). + +There's a script that generate this file and must be executed every time before +compiling. Currently there's only a linux version of that script: + + updateversion.sh + +Mercurial must be installed for this script to work. Use the makefile to +compile since that one will do most of the work. Make sure you clean any +existing builds before compiling: + + make clean + make + +If you're compiling on windows, there's an option to disable this feature. In +zombiereloaded.sp there's a line like this: + + #define ADD_VERSION_INFO 1 + +To disable it, comment that line like this: + + //#define ADD_VERSION_INFO 1 + +Then you should be able to compile without hgversion.h.inc. diff --git a/src/zr/config.inc b/src/zr/config.inc index 402106e..bad6c29 100644 --- a/src/zr/config.inc +++ b/src/zr/config.inc @@ -906,8 +906,8 @@ stock bool:ConfigSettingToBool(const String:option[]) */ stock ConfigBoolToSetting(bool:bOption, String:option[], maxlen, bool:yesno = true, target = LANG_SERVER) { - decl String:t_yes[16], String:t_on[16]; - decl String:t_no[16], String:t_off[16]; + decl String:t_yes[16], String:t_on[32]; + decl String:t_no[16], String:t_off[32]; SetGlobalTransTarget(target); diff --git a/src/zr/hitgroups.inc b/src/zr/hitgroups.inc index 5dc71c1..33d6194 100644 --- a/src/zr/hitgroups.inc +++ b/src/zr/hitgroups.inc @@ -370,7 +370,7 @@ bool:HitgroupsMenuHitgroups(client) // Set client as translation target. SetGlobalTransTarget(client); - decl String:title[MENU_LINE_TITLE_LENGTH]; + decl String:title[MENU_LINE_HUGE_LENGTH]; decl String:enableall[MENU_LINE_REG_LENGTH]; decl String:headshotsonly[MENU_LINE_REG_LENGTH]; @@ -385,7 +385,7 @@ bool:HitgroupsMenuHitgroups(client) AddMenuItem(menu_hitgroups, "Headshots Only", headshotsonly); decl String:hitgroupoption[MENU_LINE_REG_LENGTH]; - decl String:hitgroupcandamage[8]; + decl String:hitgroupcandamage[MENU_LINE_SMALL_LENGTH]; decl String:hitgroupid[4]; // x = Hitgroup index. diff --git a/src/zr/menu.inc b/src/zr/menu.inc index 47514aa..fcb5102 100644 --- a/src/zr/menu.inc +++ b/src/zr/menu.inc @@ -232,7 +232,7 @@ stock MenuClientList(client, MenuHandler:handler, bool:team = false, bool:alive SetGlobalTransTarget(client); // Translate phrase. - decl String:translation[MENU_LINE_REG_LENGTH]; + decl String:translation[MENU_LINE_TITLE_LENGTH]; VFormat(translation, sizeof(translation), "%t", 6); // Set menu title to the translated phrase. @@ -284,6 +284,10 @@ stock MenuClientList(client, MenuHandler:handler, bool:team = false, bool:alive // If there are no clients, add an "(Empty)" line. if (count == 0) { + // Set translation language again, because SetMenuTitle above reset + // this for some reason. + SetGlobalTransTarget(client); + decl String:empty[64]; Format(empty, sizeof(empty), "%t", "Menu empty"); diff --git a/src/zr/weapons/menu_weapons.inc b/src/zr/weapons/menu_weapons.inc index c28ada7..3ade571 100644 --- a/src/zr/weapons/menu_weapons.inc +++ b/src/zr/weapons/menu_weapons.inc @@ -209,6 +209,9 @@ WeaponsMenuTypeWeapons(client) decl String:typename[WEAPONS_MAX_LENGTH]; RestrictWeaponTypeGetName(g_iWeaponsCurType[client], typename, sizeof(typename)); + // Set translation language. + SetGlobalTransTarget(client); + decl String:title[MENU_LINE_TITLE_LENGTH]; decl String:restrictall[MENU_LINE_REG_LENGTH]; decl String:unrestrictall[MENU_LINE_REG_LENGTH]; diff --git a/src/zr/weapons/zmarket.inc b/src/zr/weapons/zmarket.inc index 55b92de..b4b4ee8 100644 --- a/src/zr/weapons/zmarket.inc +++ b/src/zr/weapons/zmarket.inc @@ -431,7 +431,7 @@ bool:ZMarketMenuLoadout(client) decl String:nvgsbool[8]; ConfigBoolToSetting(bool:nvgsweapon[0], nvgsbool, sizeof(nvgsbool), true, client); - decl String:title[MENU_LINE_TITLE_LENGTH]; + decl String:title[MENU_LINE_HUGE_LENGTH]; decl String:primary[MENU_LINE_REG_LENGTH]; decl String:secondary[MENU_LINE_REG_LENGTH]; decl String:melee[MENU_LINE_REG_LENGTH]; @@ -510,6 +510,7 @@ ZMarketMenuTypes(client) new Handle:menu_zmarket_types = CreateMenu(ZMarketMenuTypesHandle); // Set translation target as client. + SetGlobalTransTarget(client); decl String:title[MENU_LINE_TITLE_LENGTH]; Format(title, sizeof(title), "%t\n ", "Weapons menu zmarket types title");