Translates data where data["Type"]=="Section"
966894
def translate_section(data):
    
    sect_str = ""
    elements = data.get("Elements", [])
    for elem in elements:
            print("    Translating " + elem["Type"])
            sect_str += translate_map[elem["Type"]](elem)
    return sect_str
1059154
def translate_file_diff(data):
    
    diff = '\\FloatBarrier \section{Configuration}'
    sections = data.get('Data')
    for title, config in sections.items():
        title = title.replace('_', '\_')
        diff += ' \n \\subsection{$NAME}'.replace('$NAME', title)
        for opt, vals in config.items():
            opt = opt.replace('_', '\_')
            diff += '\n\n \\texttt{$NAME} : '.replace('$NAME', opt)
            if vals[0]:
                diff += '$NAME'.replace('$NAME', vals[-1])
            else:
                diff += ('{} \\textit{{{}}}'.format(vals[1], vals[-1]))
    diff += '\n\n'
    return diff
844028
function translateFormat(formatString, mapping) {
  let len = formatString.length,
    i = 0,
    beginIndex = -1,
    lastChar = null,
    currentChar = "",
    resultString = "";

  for (; i < len; i++) {
    currentChar = formatString.charAt(i);

    if (lastChar === null || lastChar !== currentChar) {
      // change detected
      resultString = _appendMappedString(formatString, mapping, beginIndex, i, resultString);

      beginIndex = i;
    }

    lastChar = currentChar;
  }

  return _appendMappedString(formatString, mapping, beginIndex, i, resultString);
}
491449
function translate(val, scope, status) {
        var app = (scope && scope.appName) || context.get('app') || '';
        var lang = (scope && scope.lang) || context.get('lang') || 'en';
        var translated;

        // if just one character or is a number, don't do translation
        if (!val || val.length < 2 || !isNaN(val)) {
            return val;
        }

        // translations could be either nested (on the server) or at the root (on the client)
        translated = (translations[app] && translations[app][lang] && translations[app][lang][val]) ||
            (_.isString(translations[val]) && translations[val]);

        // if no transation AND caller passed in status object AND lang is not default (i.e. not english),
        // set the status object values which the caller can use to record some info
        // note: this is kind of hacky, but we want the caller (i.e. jng.directives.js) to handle
        // it because jng.directives has more info about the translation than we do at this level
        if (!translated && config.i18nDebug && status && lang !== config.lang.default) {
            status.app = app;
            status.lang = lang;
            status.missing = true;
        }

        // attempt to interpolate and return the resulting value (val if no translation found)
        return interpolate(translated || val, scope);
    }
890515
function translate (content, contentTypes) {
  let output = {}
  content.forEach(each => {
    const base = path.parse(each.file).base
    if (base === 'index.md') {
      const type = each.dir.split('/').pop()
      const contentTypeTranslation = contentTypes.find(contentType => contentType[type])
      if (contentTypeTranslation && contentTypeTranslation[type]) {
        output[type] = contentTypeTranslation[type](content, type)
      }
    }
  })
  return output
}
1151567
def translate(patterns, *, flags=0):
    """"""

    flags = _flag_transform(flags)
    return _wcparse.translate(_wcparse.split(patterns, flags), flags)
596842
public void translateClassArrays ()
    {
        ImportSet arrayTypes = new ImportSet();
        Iterator<String> i = _imports.iterator();
        while (i.hasNext()) {
            String name = i.next();
            int bracket = name.lastIndexOf('[');
            if (bracket != -1 &&
                name.charAt(bracket + 1) == 'L') {
                arrayTypes.add(name.substring(bracket + 2, name.length() - 1));
            }
        }

        addAll(arrayTypes);
    }
1335072
function transformData( &$data, /* bool */ $toLocal )
    {
        // Check if it is already in correct format
        if ( isset( $data['_info']['format'] ) )
        {
            if ( $data['_info']['format'] == ( $toLocal ? 'local' : 'generic' ) )
                return true;
        }

        // Set the new format it will get
        $data['_info']['format'] = $toLocal ? 'local' : 'generic';

        // load the schema transformation rules
        $schemaType = $this->schemaType();
        $schemaTransformationRules = eZDBSchemaInterface::loadSchemaTransformationRules( $schemaType );
        if ( $schemaTransformationRules === false )
            return false;

        // transform column names
        foreach ( $schemaTransformationRules['column-name'] as $key => $val )
        {
            list( $tableName, $genericColName ) = explode( '.', $key );
            $localColName = $val;

            if ( $toLocal )
            {
                $searchColName = $genericColName;
                $replacementColName = $localColName;
            }
            else
            {
                $searchColName = $localColName;
                $replacementColName = $genericColName;
            }

            if ( !isset( $data[$tableName] ) )
                continue;

            // transform column names in tables
            $fieldsData = $data[$tableName]['fields'];
            foreach ( $fieldsData as $key => $fieldName )
            {
                if ( $searchColName == $fieldName )
                {
                    $data[$tableName]['fields'][$key] = $replacementColName;
                    eZDebugSetting::writeDebug( 'lib-dbschema-data-transformation', '',
                                                "transformed table column name $tableName.$searchColName to $replacementColName" );
                }
            }
        }

        return true;
    }
725155
function getLocaleDayPeriods(locale, formStyle, width) {
    var /** @type {?} */ data = findLocaleData(locale);
    var /** @type {?} */ amPmData = /** @type {?} */ ([data[1 /* DayPeriodsFormat */], data[2 /* DayPeriodsStandalone */]]);
    var /** @type {?} */ amPm = getLastDefinedValue(amPmData, formStyle);
    return getLastDefinedValue(amPm, width);
}
107580
def translate(root_list, use_bag_semantics=False):
    
    translator = (Translator() if use_bag_semantics else SetTranslator())
    return [translator.translate(root).to_sql() for root in root_list]
393196
def translated_value(self):
        
        if self.typeof in self:
            return NATValue(self.get(self.typeof, {}).get(
                'translated_value'))
136324
def translate_bit_for_bit(data):
    
    headers = sorted(data.get("Headers", []))
    table = '\\FloatBarrier \n \\section{$NAME} \n'.replace('$NAME', data.get("Title", "table"))
    table += '\\begin{table}[!ht] \n \\begin{center}'
    # Set the number of columns
    n_cols = "c"*(len(headers)+1)
    table += '\n \\begin{tabular}{$NCOLS} \n'.replace("$NCOLS", n_cols)

    # Put in the headers
    table += " Variable &"
    for header in headers:
        table += ' $HEADER &'.replace('$HEADER', header).replace('%', '\%')
    table = table[:-1] + ' \\\\ \n \hline \n'

    # Put in the data
    for k, v in data.get("Data", []).items():
        table += "\n \\textbf{$VAR} & ".replace("$VAR", k)
        for header in headers:
            table += ' $VAL &'.replace("$VAL", str(v[header]))
        table = table[:-1] + ' \\\\'
    table += '\n \hline \n \end{tabular} \n \end{center} \n \end{table}\n'
    return table
999218
function(data) {
    data = data.replace(/{% highlight ([^ ]*) %}/g, '<pre class="prettyprint lang-$1">');
    data = data.replace(/{% endhighlight %}/g, '</pre>');
    return data;
  }
363423
function translate(cond, queryObj) {

    let result = {};

    // If condition is not an array...
    if (!Array.isArray(cond)) {
        //...then it is a condition cluster
        if (cond.and) {
            result = translateAndList(cond.and, queryObj)
        }
        else if (cond.or) {
            result = translateOrList(cond.or, queryObj)
        }
        else {
            //This is an illegal subject.
            throw new Error('Invalid query Object keys. Objects must be either "and" or "or"');
        }
    }
    else {
        //...then it's a singular condition
        assert(cond.length === 3, 'Invalid condition item. Condition items must be an array of 3 items representing field, comparator, and value')

        let fieldName = cond[0];
        if (fieldName === 'id') {
            fieldName = '_key';
        }
        fieldName = fieldName.replace('.*', '[*]');

        let comp = cond[1];
        let value = cond[2];

        // construct mini block
        if (comp === 'like' || comp === 'nlike') {

            value = '%' + value + '%';

        }

        const paramName = 'p' + Object.keys(queryObj.bindVars).length;
        const valueName = 'v' + Object.keys(queryObj.bindVars).length;

        const aqlComp = convertComp(comp);

        result = `c.@${paramName} ${aqlComp} @${valueName}`;

        queryObj.bindVars[paramName] = fieldName;
        queryObj.bindVars[valueName] = value;

    }

    return result;

}
1074088
function indexTranslations() {
  const { translations = {} } = getComponentsSettings();

  return index({
    file: 'translations.js',
    config: {
      type: TYPE_TRANSLATIONS,
      config: translations,
    },
    defaultContent: 'export default null;\n',
    ...getIndexLogTranslations(TYPE_TRANSLATIONS),
  });
}
1052218
static BindTransform getLanguageTransform(TypeName type) {
		String typeName = type.toString();

		if (Integer.class.getCanonicalName().equals(typeName)) {
			return new IntegerBindTransform(true);
		}
		if (Boolean.class.getCanonicalName().equals(typeName)) {
			return new BooleanBindTransform(true);
		}
		if (Long.class.getCanonicalName().equals(typeName)) {
			return new LongBindTransform(true);
		}
		if (Double.class.getCanonicalName().equals(typeName)) {
			return new DoubleBindTransform(true);
		}
		if (Float.class.getCanonicalName().equals(typeName)) {
			return new FloatBindTransform(true);
		}
		if (Short.class.getCanonicalName().equals(typeName)) {
			return new ShortBindTransform(true);
		}
		if (Byte.class.getCanonicalName().equals(typeName)) {
			return new ByteBindTransform(true);
		}
		if (Character.class.getCanonicalName().equals(typeName)) {
			return new CharacterBindTransform(true);
		}
		if (String.class.getCanonicalName().equals(typeName)) {
			return new StringBindTransform();
		}
		return null;
	}
228150
function translateUiTitles (elements) {
  if (elements.title && typeof elements.title == 'string') {
    elements.title = flattenTitles(elements.title)
  }
  if (elements.elements) {
    translateUiTitles(elements.elements)
  }
  for (section in elements) {
    if (elements[section].ui) {
      var sectionTitle = elements[section].ui.title
      elements[section].ui.title = flattenTitles(sectionTitle)
    }
    if (elements[section].components) {
      translateUiTitles(elements[section].components.elements)
    }
  }
  return elements
}