1/** 2 * OpenMage 3 * 4 * This source file is subject to the Academic Free License (AFL 3.0) 5 * that is bundled with this package in the file LICENSE_AFL.txt. 6 * It is also available at https://opensource.org/license/afl-3-0-php 7 * 8 * @category Mage 9 * @package js 10 * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) 11 * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) 12 * @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) 13 */ 14 15var Translate = Class.create(); 16Translate.prototype = { 17 initialize: function(data){ 18 this.data = $H(data); 19 }, 20 21 translate : function(){ 22 var args = arguments; 23 var text = arguments[0]; 24 25 if(this.data.get(text)){ 26 return this.data.get(text); 27 } 28 return text; 29 }, 30 add : function() { 31 if (arguments.length > 1) { 32 this.data.set(arguments[0], arguments[1]); 33 } else if (typeof arguments[0] =='object') { 34 $H(arguments[0]).each(function (pair){ 35 this.data.set(pair.key, pair.value); 36 }.bind(this)); 37 } 38 } 39};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.