git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@43204 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Andrew O'Neil 2007-10-08 21:55:15 +00:00
parent 24be30314a
commit a0563eaba4

View File

@ -468,7 +468,7 @@ class i18n extends Controller {
'pt_TL' => 'Portuguese (East Timor)',
'qu_BO' => 'Quechua (Bolivia)',
'qu_PE' => 'Quechua (Peru)',
'rcf_RE' => 'Réunion Creole French (Reunion)',
'rcf_RE' => 'R<EFBFBD>union Creole French (Reunion)',
'rej_ID' => 'Rejang (Indonesia)',
'rif_MA' => 'Tarifit (Morocco)',
'rjb_IN' => 'Rajbanshi (India)',
@ -686,6 +686,168 @@ class i18n extends Controller {
'yi' => array('Yiddish', '&#1522;&#1460;&#1491;&#1497;&#1513;'),
'zu' => array('Zulu', 'isiZulu')
);
static $tinymce_lang = array(
'ca_AD' => 'ca',
'ca_ES' => 'ca',
'cs_CZ' => 'cs',
'cy_GB' => 'cy',
'da_DK' => 'da',
'da_GL' => 'da',
'de_AT' => 'de',
'de_BE' => 'de',
'de_CH' => 'de',
'de_DE' => 'de',
'de_LI' => 'de',
'de_LU' => 'de',
'de_BR' => 'de',
'de_US' => 'de',
'el_CY' => 'el',
'el_GR' => 'el',
'es_AR' => 'es',
'es_BO' => 'es',
'es_CL' => 'es',
'es_CO' => 'es',
'es_CR' => 'es',
'es_CU' => 'es',
'es_DO' => 'es',
'es_EC' => 'es',
'es_ES' => 'es',
'es_GQ' => 'es',
'es_GT' => 'es',
'es_HN' => 'es',
'es_MX' => 'es',
'es_NI' => 'es',
'es_PA' => 'es',
'es_PE' => 'es',
'es_PH' => 'es',
'es_PR' => 'es',
'es_PY' => 'es',
'es_SV' => 'es',
'es_UY' => 'es',
'es_VE' => 'es',
'es_AD' => 'es',
'es_BZ' => 'es',
'es_US' => 'es',
'fa_AF' => 'fa',
'fa_IR' => 'fa',
'fa_PK' => 'fa',
'fi_FI' => 'fi',
'fi_SE' => 'fi',
'fr_BE' => 'fr',
'fr_BF' => 'fr',
'fr_BI' => 'fr',
'fr_BJ' => 'fr',
'fr_CA' => 'fr_ca',
'fr_CF' => 'fr',
'fr_CG' => 'fr',
'fr_CH' => 'fr',
'fr_CI' => 'fr',
'fr_CM' => 'fr',
'fr_DJ' => 'fr',
'fr_DZ' => 'fr',
'fr_FR' => 'fr',
'fr_GA' => 'fr',
'fr_GF' => 'fr',
'fr_GN' => 'fr',
'fr_GP' => 'fr',
'fr_HT' => 'fr',
'fr_KM' => 'fr',
'fr_LU' => 'fr',
'fr_MA' => 'fr',
'fr_MC' => 'fr',
'fr_MG' => 'fr',
'fr_ML' => 'fr',
'fr_MQ' => 'fr',
'fr_MU' => 'fr',
'fr_NC' => 'fr',
'fr_NE' => 'fr',
'fr_PF' => 'fr',
'fr_PM' => 'fr',
'fr_RE' => 'fr',
'fr_RW' => 'fr',
'fr_SC' => 'fr',
'fr_SN' => 'fr',
'fr_SY' => 'fr',
'fr_TD' => 'fr',
'fr_TG' => 'fr',
'fr_TN' => 'fr',
'fr_VU' => 'fr',
'fr_WF' => 'fr',
'fr_YT' => 'fr',
'fr_GB' => 'fr',
'fr_US' => 'fr',
'he_IL' => 'he',
'hu_HU' => 'hu',
'hu_AT' => 'hu',
'hu_RO' => 'hu',
'hu_RS' => 'hu',
'is_IS' => 'is',
'it_CH' => 'it',
'it_IT' => 'it',
'it_SM' => 'it',
'it_FR' => 'it',
'it_HR' => 'it',
'it_US' => 'it',
'it_VA' => 'it',
'ja_JP' => 'ja',
'ko_KP' => 'ko',
'ko_KR' => 'ko',
'ko_CN' => 'ko',
'nb_NO' => 'nb',
'nb_SJ' => 'nb',
'nl_AN' => 'nl',
'nl_AW' => 'nl',
'nl_BE' => 'nl',
'nl_NL' => 'nl',
'nl_SR' => 'nl',
'nn_NO' => 'nn',
'pl_PL' => 'pl',
'pl_UA' => 'pl',
'pt_AO' => 'pt_br',
'pt_BR' => 'pt_br',
'pt_CV' => 'pt_br',
'pt_GW' => 'pt_br',
'pt_MZ' => 'pt_br',
'pt_PT' => 'pt_br',
'pt_ST' => 'pt_br',
'pt_TL' => 'pt_br',
'ro_MD' => 'ro',
'ro_RO' => 'ro',
'ro_RS' => 'ro',
'ru_BY' => 'ru',
'ru_KG' => 'ru',
'ru_KZ' => 'ru',
'ru_RU' => 'ru',
'ru_SJ' => 'ru',
'ru_UA' => 'ru',
'si_LK' => 'si',
'sk_SK' => 'sk',
'sk_RS' => 'sk',
'sq_AL' => 'sq',
'sr_BA' => 'sr',
'sr_ME' => 'sr',
'sr_RS' => 'sr',
'sv_FI' => 'sv',
'sv_SE' => 'sv',
'tr_CY' => 'tr',
'tr_TR' => 'tr',
'tr_DE' => 'tr',
'tr_MK' => 'tr',
'uk_UA' => 'uk',
'vi_VN' => 'vi',
'vi_US' => 'vi',
'zh_CN' => 'zh_cn',
'zh_HK' => 'zh_cn',
'zh_MO' => 'zh_cn',
'zh_SG' => 'zh_cn',
'zh_TW' => 'zh_tw',
'zh_ID' => 'zh_cn',
'zh_MY' => 'zh_cn',
'zh_TH' => 'zh_cn',
'zh_US' => 'zn_cn',
);
/**
* Get a list of commonly used languages
@ -792,6 +954,19 @@ class i18n extends Controller {
return ($code ? $code : $name);
}
/**
* Get the current tinyMCE language
*
* @return Language
*/
static function get_tinymce_lang() {
if(isset(i18n::$tinymce_lang[i18n::get_locale()])) {
return i18n::$tinymce_lang[i18n::get_locale()];
}
return 'en';
}
/**
* Searches the root-directory for module-directories
* (identified by having a _config.php on their first directory-level