<?php require_once '../ryzom_extra.php'; $sheetNames = array(array('fyros_outpost_04.outpost', 'Malmont Farm'), array('marauder_light_melee_fighter_b.outpost_squad', 'Marauder Warriors Squad'), array('driller_bountybeaches_kami_u1_100a.outpost_building', 'Offering for Tree-Bore')); foreach ($sheetNames as $array) { $sheetName = $array[0]; $expected = $array[1]; $text = ryzom_translate($sheetName, 'en'); $result = $text === $expected ? ' OK ' : 'FAIL'; printf("%s %s - %s\n", $result, $sheetName, $text); }
function affichage_item($item) { $url = ryzom_item_icon_url((string) $item->sheet, (int) $item->craftparameters->color, (int) $item->quality, (int) $item->stack); //ajouter les details de craftparameters $details = ""; foreach ((array) $item->craftparameters as $nom => $detail) { $details .= " - " . $nom . " : " . $detail; } return '<img src="' . $url . '" style="border: 1px solid #333;" title="' . (int) $item->stack . ' x ' . ryzom_translate((string) $item->sheet, 'fr', 0) . '(Q' . (int) $item->quality . $details . ')" /> '; }
error_reporting(E_ALL); require_once '../ryzom_extra.php'; $info = ryzom_building_info(182452286); print_r($info); $street = ryzom_translate($info['place'], 'en'); $town = ryzom_translate($info['city'], 'en'); $land = ryzom_translate($info['continent'], 'en'); echo "Location: {$land}, {$town}, {$street}\n"; // verify all location sheetid's for typos $buildings = (include '../data/buildings.inc.php'); foreach ($buildings as $b_id => $b_info) { try { $street = ryzom_translate($b_info['place'], 'en'); $town = ryzom_translate($b_info['city'], 'en'); $land = ryzom_translate($b_info['continent'], 'en'); if (is_unknown($street) || is_unknown($town) || is_unknown($land)) { echo "- [{$b_id}]: {$land}, {$town}, {$street}\n"; } else { echo "+ {$land}, {$town}, {$street}\n"; } } catch (Exception $ex) { // if '.place' is mistyped echo ".suffix error [" . $ex->getMessage() . "]\n"; } } function is_unknown($str) { if (substr($str, 0, 10) == 'NotFound:(' || substr($str, 0, 8) == 'Unknown:') { return true; }
<?php require_once '../ryzom_extra.php'; $ids = array('caaga1.creature' => array('name', 'p'), 'cdagc3.creature' => array('name', 'p'), 'fyros.faction' => array('name', 'member'), 'icmm1pdl.sitem' => array('name', 'p', 'description'), 'fyros_outpost_04.outpost' => array('name', 'description'), 'region_majesticgarden.place' => array('name'), 'bfma01.sbrick' => array('name', 'p', 'description', 'description2'), 'acuratebleedingshot.skill' => array('name', 'p', 'description'), 'abf01.sphrase' => array('name', 'p', 'description'), 'light_armsman.title' => array('name', 0, 1), 'LanguageName.uxt' => array('name')); foreach ($ids as $sheetid => $indices) { echo $sheetid . ":\n"; foreach ($indices as $i) { echo ' ' . $i . ' => ' . ryzom_translate($sheetid, 'en', $i) . "\n"; } } echo "\n";
/** * {@inheritdoc} */ function trans($id, array $params = array(), $lang = null) { if ($lang === null) { $lang = $this->defaultLanguage; } $key = strtolower($id); // check local translation first if (isset($this->messages[$lang][$key])) { $result = $this->messages[$lang][$key]; if (!empty($params)) { $result = strtr($result, $params); } } else { // pull in translation from external source $female = isset($params['female']) ? $params['female'] : false; $result = ryzom_translate($id, $lang, $female); } return $result; }
} if (isset($item['skill'])) { echo " - xp in skill= " . ryzom_translate($item['skill'], 'en') . "\n"; } if (isset($item['craftplan'])) { echo " - craft plan = " . ryzom_translate($item['craftplan'], 'en') . "\n"; if ($item['_craftplan'] === false) { echo " * craft plan was not found\n"; // print_r($item); } else { $plan = $item['_craftplan']; if (!empty($plan['mpft'])) { echo " + resources in craft plan \n"; foreach ($plan['mpft'] as $k => $v) { $r = ryzom_translate($k . '.uxt', 'en'); printf("\t - %dx %s\n", $v, $r); } } if (!empty($plan['extra'])) { echo "\t + extra items\n"; foreach ($plan['extra'] as $k => $v) { printf("\t - %dx %s\n", $v, ryzom_translate($k, 'en')); } } } } else { // print_r($item); } } echo "\n-- memory used: " . (memory_get_usage() - $mem) . "\n"; echo "</pre>\n";