예제 #1
0
<?php

/**
 * \file tests/intl_parser/metadata.php
 * \author Yohann Lorant <*****@*****.**>
 * \version 0.5
 * \brief Intl_Parser class tests.
 *
 * \section LICENSE
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of
 * the License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * General Public License for more details at
 * http://www.gnu.org/copyleft/gpl.html
 *
 * \section DESCRIPTION
 *
 * This file tests the behavior of the Intl_Parser class, and how it responds for a globally exhausting file/folder_parsing.
 * This file will NOT be further documented.
 */
include '../../core/intl.class.php';
$parser = new Intl_Parser();
print_r($parser->parseFile('data/lc.conf'));
예제 #2
0
<?php

/**
 * \file tests/intl_parser/directory.php
 * \author Yohann Lorant <*****@*****.**>
 * \version 0.5
 * \brief Intl_Parser class tests.
 *
 * \section LICENSE
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of
 * the License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * General Public License for more details at
 * http://www.gnu.org/copyleft/gpl.html
 *
 * \section DESCRIPTION
 *
 * This file tests the behavior of the Intl_Parser class, and how it responds for a globally exhausting file/folder_parsing.
 * This file will NOT be further documented.
 */
include '../../core/intl.class.php';
$parser = new Intl_Parser();
print_r($parser->parseDir('data'));
예제 #3
0
파일: locale.php 프로젝트: Geolim4/Leelabot
<?php

/**
 * \file tests/intl_parser/locale.php
 * \author Yohann Lorant <*****@*****.**>
 * \version 0.5
 * \brief Intl_Parser class tests.
 *
 * \section LICENSE
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of
 * the License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * General Public License for more details at
 * http://www.gnu.org/copyleft/gpl.html
 *
 * \section DESCRIPTION
 *
 * This file tests the behavior of the Intl_Parser class, and how it responds for a globally exhausting file/folder_parsing.
 * This file will NOT be further documented.
 */
include '../../core/intl.class.php';
$parser = new Intl_Parser();
print_r($parser->parseFile('data/core.lc'));
예제 #4
0
 /** Checks if a locale exists.
  * This function checks if the locale exists, by its folder name, or by an alias.
  * 
  * \param $locale The locale to set.
  * \return The locale's real name if the locale exists, FALSE if not.
  */
 public function localeExists($locale)
 {
     $dir = scandir($this->_root);
     foreach ($dir as $el) {
         if (is_dir($this->_root . '/' . $el)) {
             if ($el == $locale) {
                 //Folder name check
                 return $el;
             }
             if (is_file($this->_root . '/' . $el . '/lc.conf')) {
                 $parser = new Intl_Parser();
                 $data = $parser->parseFile($this->_root . '/' . $el . '/lc.conf');
                 unset($parser);
                 if (isset($data['aliases']) && in_array($locale, $data['aliases'])) {
                     return $el;
                 }
             }
         }
     }
     return FALSE;
 }