2 /************************************************************************/
\r
4 /************************************************************************/
\r
5 /* Copyright (c) 2010 */
\r
6 /* Inclusive Design Institute */
\r
8 /* This program is free software. You can redistribute it and/or */
\r
9 /* modify it under the terms of the GNU General Public License */
\r
10 /* as published by the Free Software Foundation. */
\r
11 /************************************************************************/
\r
14 * Utility functions for language
\r
16 * @author Cindy Qi Li
\r
19 if (!defined('TR_INCLUDE_PATH')) exit;
\r
21 class LanguageUtility {
\r
24 * return language code from given AContent language code
\r
27 * @return language code
\r
28 * @author Cindy Qi Li
\r
30 public static function getParentCode($code = '') {
\r
31 if (!$code && isset($this)) {
\r
32 $code = $this->code;
\r
34 $peices = explode(TR_LANGUAGE_LOCALE_SEP, $code, 2);
\r
39 * return charset from given AContent language code
\r
43 * @author Cindy Qi Li
\r
45 public static function getLocale($code = '') {
\r
46 if (!$code && isset($this)) {
\r
47 $code = $this->code;
\r
49 $peices = explode(TR_LANGUAGE_LOCALE_SEP, $code, 2);
\r