/[drupal]/contributions/modules/translation_framework/contrib/google_translation/google_translation.module
ViewVC logotype

Diff of /contributions/modules/translation_framework/contrib/google_translation/google_translation.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1.2.5, Thu Apr 23 22:18:03 2009 UTC revision 1.1.2.6, Mon Aug 10 20:32:00 2009 UTC
# Line 241  function _google_translation_split_strin Line 241  function _google_translation_split_strin
241  /**  /**
242   * Function returns an array of the translatable languages that the Google interface supports   * Function returns an array of the translatable languages that the Google interface supports
243   */   */
244  function google_translation_languages($include = FALSE) {  function google_translation_languages($include = FALSE, $original = FALSE) {
245    $google_translations = array(    $google_translations = array(
246      'ar' => t('Arabic'),      'ar' => t('Arabic'),
247      'bg' => t('Bulgarian'),      'bg' => t('Bulgarian'),
# Line 267  function google_translation_languages($i Line 267  function google_translation_languages($i
267      'es' => t('Spanish'),      'es' => t('Spanish'),
268      'sv' => t('Swedish'),      'sv' => t('Swedish'),
269    );    );
270      // We only want the original with no further processing done
271      if ($original === TRUE) {
272        return $google_translations;
273      }
274      $locales = locale_language_list('name');
275    if ($include === TRUE) {    if ($include === TRUE) {
276      $mappings = variable_get('google_translation_language_mappings', array());      $mappings = variable_get('google_translation_language_mappings', array());
     $locales = locale_language_list('name');  
277      // We should now go through all of our mappings and add what we require so people can utilize the mapped fields      // We should now go through all of our mappings and add what we require so people can utilize the mapped fields
278      foreach ($mappings as $k => $v) {      foreach ($mappings as $k => $v) {
279        $google_translations[$k] = $locales[$k];        $google_translations[$k] = $locales[$k];
280      }      }
281    }    }
282      if (variable_get('google_translation_enabled_locales_only', false)) {
283        foreach ($google_translations as $k => $v) {
284          if (!isset($locales[$k])) {
285            unset($google_translations[$k]);
286          }
287        }
288      }
289    return $google_translations;    return $google_translations;
290  }  }

Legend:
Removed from v.1.1.2.5  
changed lines
  Added in v.1.1.2.6

  ViewVC Help
Powered by ViewVC 1.1.2