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

Source for file gettext_prepare.php

Documentation is available at gettext_prepare.php

  1. <?php
  2.  
  3. require_once 'System.php';
  4. require_once 'File/Gettext.php';
  5. require_once 'I18Nv2/Locale.php';
  6.  
  7. $l &new I18Nv2_Locale('en');
  8. $g &File_Gettext::factory('MO');
  9.  
  10. $g->meta = array('Content-Type' => 'text/plain; charset=iso-8859-1');
  11.  
  12. $langs = array('en''de''it');
  13. foreach ($langs as $lang{
  14.     $l->setLocale($lang);
  15.     $g->strings = array();
  16.     foreach (range(06as $day{
  17.         $g->strings["day_$day"$l->dayName($day);
  18.     }
  19.     foreach (range(011as $month{
  20.         $g->strings[sprintf('month_%02d'$month + 1)$l->monthName($month);
  21.     }
  22.     $g->strings['nasty ampersand''lean & mean';
  23.     System::mkdir(array('-p'$dir 'locale/'$lang .'/LC_MESSAGES/'));
  24.     $g->save($dir 'calendar.mo');
  25. }
  26. $g->strings = array('alone' => 'solo soletto');
  27. $g->save('locale/it/LC_MESSAGES/alone.mo');
  28.  
  29. ?>

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