Translation2
[ class tree: Translation2 ] [ index: Translation2 ] [ all elements ]

Source for file gettext_admin.php

Documentation is available at gettext_admin.php

  1. <?php
  2. require_once 'Translation2.php';
  3. require_once 'Translation2/Admin.php';
  4. require_once 'I18Nv2/Locale.php';
  5.  
  6. PEAR::setErrorHandling(PEAR_ERROR_DIE);
  7.  
  8. $options = array(
  9.     'langs_avail_file'  => 'gettext_langs.ini',
  10.     'domains_path_file' => 'gettext_domains.ini',
  11.     'default_domain'    => 'admin'
  12. );
  13.  
  14. $tr &Translation2_Admin::factory('gettext'$optionsarray('prefetch' => false));
  15.  
  16. $langs $tr->getLangs('ids');
  17. $days  = array();
  18. $months= array();
  19.  
  20. $lc &new I18Nv2_Locale;
  21.  
  22. foreach ($langs as $lang{
  23.     $lc->setLocale($lang);
  24.     foreach (range(0,6as $day{
  25.         $days[$day][$lang$lc->dayName($day);
  26.     }
  27.     foreach (range(0,11as $month{
  28.         $months[$month][$lang$lc->monthName($month);
  29.     }
  30. }
  31.  
  32. $tr->storage->begin();
  33. foreach ($langs as $lang{
  34.     foreach (range(0,6as $day{
  35.         $tr->add('day_'sprintf('%02d'$day)null$days[$day]);
  36.     }
  37.     foreach (range(0,11as $month{
  38.         $tr->add('month_'sprintf('%02d'$month)null$months[$month]);
  39.     }
  40. }
  41. $tr->storage->commit();
  42.  
  43. foreach ($langs as $lang{
  44.     foreach (range(0,6as $day{
  45.         echo "$lang day $day"$tr->get('day_'sprintf('%02d'$day)null$lang)"\n";
  46.     }
  47.     foreach (range(0,11as $month{
  48.         echo "$lang month $month"$tr->get('month_'sprintf('%02d'$month)null$lang)"\n";
  49.     }
  50.     echo "\n";
  51. }
  52. ?>

Documentation generated on Mon, 11 Mar 2019 15:41:51 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.