Localization/Fixup
* localize "unnamed" text for gameobjects and areatrigger * fix empty links in Quest Detail Page for quests with external completion event but empty AreaDescription * closes #501
This commit is contained in:
parent
38dc0e834e
commit
7906b6c942
9 changed files with 22 additions and 10 deletions
|
|
@ -634,7 +634,7 @@ class QuestBaseResponse extends TemplateResponse implements ICache
|
|||
// PSA: 'redundant' data is on purpose (e.g. creature required for kill, also dropps item required to collect)
|
||||
|
||||
// external events
|
||||
$endTextWrapper = '%s';
|
||||
$endText = $this->subject->parseText('end', false);
|
||||
if ($_specialFlags & QUEST_FLAG_SPECIAL_EXT_COMPLETE)
|
||||
{
|
||||
// areatrigger
|
||||
|
|
@ -643,7 +643,7 @@ class QuestBaseResponse extends TemplateResponse implements ICache
|
|||
if ($atSpawns = DB::AoWoW()->selectAssoc('SELECT `typeId` AS ARRAY_KEY, `posX`, `posY`, `floor`, `areaId` FROM ::spawns WHERE `type` = %i AND `typeId` IN %in', Type::AREATRIGGER, $atir))
|
||||
{
|
||||
if (User::isInGroup(U_GROUP_STAFF))
|
||||
$endTextWrapper = '<a href="?areatrigger='.$atir[0].'">%s</a>';
|
||||
$endText = '<a href="?areatrigger='.$atir[0].'">'.($endText ?: Lang::areatrigger('unnamed', [$atir[0]])).'</a>';
|
||||
|
||||
foreach ($atSpawns as $atId => $atsp)
|
||||
{
|
||||
|
|
@ -651,7 +651,7 @@ class QuestBaseResponse extends TemplateResponse implements ICache
|
|||
'type' => User::isInGroup(U_GROUP_STAFF) ? Type::AREATRIGGER : -1,
|
||||
'id' => $atId,
|
||||
'point' => 'requirement',
|
||||
'name' => $this->subject->parseText('end', false),
|
||||
'name' => $this->subject->parseText('end', false) ?: Lang::areatrigger('unnamed', [$atir[0]]),
|
||||
'coord' => [$atsp['posX'], $atsp['posY']],
|
||||
'coords' => [[$atsp['posX'], $atsp['posY']]],
|
||||
'objective' => $objectiveIdx++
|
||||
|
|
@ -674,7 +674,7 @@ class QuestBaseResponse extends TemplateResponse implements ICache
|
|||
// complete-spell
|
||||
else if ($endSpell = new SpellList(array(DB::OR, [DB::AND, ['effect1Id', SPELL_EFFECT_QUEST_COMPLETE], ['effect1MiscValue', $this->typeId]], [DB::AND, ['effect2Id', SPELL_EFFECT_QUEST_COMPLETE], ['effect2MiscValue', $this->typeId]], [DB::AND, ['effect3Id', SPELL_EFFECT_QUEST_COMPLETE], ['effect3MiscValue', $this->typeId]])))
|
||||
if (!$endSpell->error)
|
||||
$endTextWrapper = '<a href="?spell='.$endSpell->id.'">%s</a>';
|
||||
$endText = '<a href="?spell='.$endSpell->id.'">'.($endText ?: $endSpell->getField('name', true)).'</a>';
|
||||
}
|
||||
|
||||
// ..adding creature kill requirements
|
||||
|
|
@ -898,7 +898,7 @@ class QuestBaseResponse extends TemplateResponse implements ICache
|
|||
$this->offerReward = $this->subject->parseText('offerReward', false);
|
||||
$this->requestItems = $this->subject->parseText('requestItems', false);
|
||||
$this->completed = $this->subject->parseText('completed', false);
|
||||
$this->end = sprintf($endTextWrapper, $this->subject->parseText('end', false));
|
||||
$this->end = $endText;
|
||||
$this->suggestedPl = $this->subject->getField('suggestedPlayers');
|
||||
$this->unavailable = $_flags & QUEST_FLAG_UNAVAILABLE || $this->subject->getField('cuFlags') & CUSTOM_EXCLUDE_FOR_LISTVIEW;
|
||||
$this->redButtons = array(
|
||||
|
|
|
|||
|
|
@ -27,13 +27,13 @@ class AreaTriggerList extends DBTypeList
|
|||
|
||||
foreach ($this->iterate() as $id => &$_curTpl)
|
||||
if (!$_curTpl['name'])
|
||||
$_curTpl['name'] = 'Unnamed Areatrigger #' . $id;
|
||||
$_curTpl['name'] = Lang::areatrigger('unnamed', [$id]);
|
||||
}
|
||||
|
||||
public static function getName(int $id) : ?LocString
|
||||
{
|
||||
if ($n = DB::Aowow()->SelectRow('SELECT IF(`name`, `name`, CONCAT("Unnamed Areatrigger #", `id`) AS "name_loc0" FROM %n WHERE `id` = %i', self::$dataTable, $id))
|
||||
return new LocString($n);
|
||||
if ($n = DB::Aowow()->SelectRow('SELECT `name` AS "name_loc0" FROM %n WHERE `id` = %i', self::$dataTable, $id))
|
||||
return new LocString($n, callback: fn($x) => $x ?: Lang::areatrigger('unnamed', [$id]));
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -34,8 +34,8 @@ class GameObjectList extends DBTypeList
|
|||
// post processing
|
||||
foreach ($this->iterate() as $_id => &$curTpl)
|
||||
{
|
||||
if (!$curTpl['name_loc0'])
|
||||
$curTpl['name_loc0'] = 'Unnamed Object #' . $_id;
|
||||
if (!$curTpl['name_loc'.Lang::getLocale()->value])
|
||||
$curTpl['name_loc'.Lang::getLocale()->value] = Lang::gameObject('unnamed', [$_id]);
|
||||
|
||||
// unpack miscInfo
|
||||
$curTpl['mStone'] =
|
||||
|
|
|
|||
|
|
@ -1143,11 +1143,13 @@ $lang = array(
|
|||
'areatrigger' => array(
|
||||
'notFound' => "Dieser Areatrigger existiert nicht.",
|
||||
'foundIn' => "Dieser Areatrigger befindet sich in",
|
||||
'unnamed' => "Unbenannter Areatrigger #%d",
|
||||
'types' => ['Unbenutzt', 'Gasthaus', 'Teleporter', 'Questziel', 'Smarter Trigger', 'Script']
|
||||
),
|
||||
'gameObject' => array(
|
||||
'id' => "Objekt-ID: ",
|
||||
'notFound' => "Dieses Objekt existiert nicht.",
|
||||
'unnamed' => "Unbenanntes Objekt #%d",
|
||||
'cat' => [0 => "Anderes", 3 => "Behälter", 6 => "Fallen", 9 => "Bücher", 25 => "Fischschwärme", -5 => "Truhen", -3 => "Kräuter", -4 => "Erzadern", -2 => "Quest", -6 => "Werkzeuge"],
|
||||
'type' => [ 3 => "Behälter", 6 => "", 9 => "Buch", 25 => "", -5 => "Truhe", -3 => "Kraut", -4 => "Erzvorkommen", -2 => "Quest", -6 => ""],
|
||||
'unkPosition' => "Der Standort dieses Objekts ist nicht bekannt.",
|
||||
|
|
|
|||
|
|
@ -1143,11 +1143,13 @@ $lang = array(
|
|||
'areatrigger' => array(
|
||||
'notFound' => "This areatrigger doesn't exist.",
|
||||
'foundIn' => "This areatrigger can be found in",
|
||||
'unnamed' => "Unnamed areatrigger #%d",
|
||||
'types' => ['Unused', 'Tavern', 'Teleporter', 'Quest Objective', 'Smart Trigger', 'Script']
|
||||
),
|
||||
'gameObject' => array(
|
||||
'id' => "Object ID: ",
|
||||
'notFound' => "This object doesn't exist.",
|
||||
'unnamed' => "Unnamed object #%d",
|
||||
'cat' => [0 => "Other", 3 => "Containers", 6 => "Traps", 9 => "Books", 25 => "Fishing Pools", -5 => "Chests", -3 => "Herbs", -4 => "Mineral Veins", -2 => "Quest", -6 => "Tools"],
|
||||
'type' => [ 3 => "Container", 6 => "", 9 => "Book", 25 => "", -5 => "Chest", -3 => "Herb", -4 => "Mineral Vein", -2 => "Quest", -6 => ""], // used for tooltip
|
||||
'unkPosition' => "The location of this object is unknown.",
|
||||
|
|
|
|||
|
|
@ -1143,11 +1143,13 @@ $lang = array(
|
|||
'areatrigger' => array(
|
||||
'notFound' => "Este activador de área no existe.",
|
||||
'foundIn' => "Este activador de área se puede encontrar en",
|
||||
'unnamed' => "[Unnamed areatrigger] #%d",
|
||||
'types' => ['Sin usar', 'Taberna', 'Teletransportador', 'Objetivo de misión', 'Activador inteligente', 'Script']
|
||||
),
|
||||
'gameObject' => array(
|
||||
'id' => "ID de Entidad: ",
|
||||
'notFound' => "Esta entidad no existe.",
|
||||
'unnamed' => "[Unnamed object] #%d",
|
||||
'cat' => [0 => "Otros", 3 => "Contenedores", 6 => "Trampas", 9 => "Libros", 25 => "Bancos de peces", -5 => "Cofres", -3 => "Hierbas", -4 => "Venas de minerales", -2 => "Misiones", -6 => "Herramientas"],
|
||||
'type' => [ 3 => "Contenedore", 6 => "", 9 => "Libro", 25 => "", -5 => "Cofre", -3 => "Hierba", -4 => "Filóne de mineral", -2 => "Misión", -6 => ""],
|
||||
'unkPosition' => "No se conoce la ubicación de esta entidad.",
|
||||
|
|
|
|||
|
|
@ -1143,11 +1143,13 @@ $lang = array(
|
|||
'areatrigger' => array(
|
||||
'notFound' => "This areatrigger doesn't exist.",
|
||||
'foundIn' => "This areatrigger can be found in",
|
||||
'unnamed' => "[Unnamed areatrigger] #%d",
|
||||
'types' => ['Unused', 'Tavern', 'Teleporter', 'Quest Objective', 'Smart Trigger', 'Script']
|
||||
),
|
||||
'gameObject' => array(
|
||||
'id' => "ID Entité: ",
|
||||
'notFound' => "Cette entité n'existe pas.",
|
||||
'unnamed' => "[Unnamed object] #%d",
|
||||
'cat' => [0 => "Autre", 3 => "Conteneurs", 6 => "Pièges", 9 => "Livres", 25 => "Bancs de poissons", -5 => "Coffres", -3 => "Herbes", -4 => "Filons de minerai", -2 => "Quêtes", -6 => "Outils"],
|
||||
'type' => [ 3 => "Conteneur", 6 => "", 9 => "Livre", 25 => "", -5 => "Coffre", -3 => "Herbe", -4 => "Filon de minerai", -2 => "Quête", -6 => ""],
|
||||
'unkPosition' => "L'emplacement de cette entité est inconnu.",
|
||||
|
|
|
|||
|
|
@ -1143,11 +1143,13 @@ $lang = array(
|
|||
'areatrigger' => array(
|
||||
'notFound' => "This areatrigger doesn't exist.",
|
||||
'foundIn' => "This areatrigger can be found in",
|
||||
'unnamed' => "[Unnamed areatrigger] #%d",
|
||||
'types' => ['Unused', 'Tavern', 'Teleporter', 'Quest Objective', 'Smart Trigger', 'Script']
|
||||
),
|
||||
'gameObject' => array(
|
||||
'id' => "Объект ID: ",
|
||||
'notFound' => "Такой объект не существует.",
|
||||
'unnamed' => "[Unnamed object] #%d",
|
||||
'cat' => [0 => "Другое", 3 => "Контейнеры", 6 => "Ловушки", 9 => "Книги", 25 => "Рыболовные лунки", -5 => "Сундуки", -3 => "Травы", -4 => "Полезные ископаемые", -2 => "Задания", -6 => "Инструменты"],
|
||||
'type' => [ 3 => "Контейнер", 6 => "", 9 => "Книга", 25 => "", -5 => "Сундук", -3 => "Растение", -4 => "Полезное ископаемое", -2 => "Задание", -6 => ""],
|
||||
'unkPosition' => "Местонахождение этого объекта неизвестно.",
|
||||
|
|
|
|||
|
|
@ -1143,11 +1143,13 @@ $lang = array(
|
|||
'areatrigger' => array(
|
||||
'notFound' => "这个区域触发器不存在。",
|
||||
'foundIn' => "这个区域触发器可以在以下地区找到:",
|
||||
'unnamed' => "[Unnamed areatrigger] #%d",
|
||||
'types' => ['未使用', '酒馆', '传送门', '任务目标', 'Smart Trigger', '脚本']
|
||||
),
|
||||
'gameObject' => array(
|
||||
'id' => "对象ID:",
|
||||
'notFound' => "这个对象不存在。",
|
||||
'unnamed' => "[Unnamed object] #%d",
|
||||
'cat' => [0 => "其他", 3 => "容器", 6 => "陷阱", 9 => "书籍", 25 => "钓鱼点", -5 => "宝箱", -3 => "草药", -4 => "矿脉", -2 => "任务", -6 => "工具"],
|
||||
'type' => [ 3 => "容器", 6 => "", 9 => "书籍", 25 => "", -5 => "宝箱", -3 => "草药", -4 => "矿脉", -2 => "任务", -6 => ""],
|
||||
'unkPosition' => "这个对象的位置未知。",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue