本文整理匯總了PHP中jLocale::getCurrentCountry方法的典型用法代碼示例。如果您正苦於以下問題:PHP jLocale::getCurrentCountry方法的具體用法?PHP jLocale::getCurrentCountry怎麽用?PHP jLocale::getCurrentCountry使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類jLocale
的用法示例。
在下文中一共展示了jLocale::getCurrentCountry方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getDictionary
/**
* Get JSON containing all translation for a given jelix property file.
* @param string $property Name of the property file. Ex: map if searched file is map.UTF-8.properties
* @param string $lang Language. Ex: fr_FR (optional)
* @return binary object The image for this project.
*/
function getDictionary()
{
$rep = $this->getResponse('json');
// Get the property file
$property = $this->param('property');
$lang = $this->param('lang');
if (!$lang) {
$lang = jLocale::getCurrentLang() . '_' . jLocale::getCurrentCountry();
}
$data = array();
$path = jApp::appPath() . 'modules/view/locales/' . $lang . '/' . $property . '.UTF-8.properties';
if (file_exists($path)) {
$lines = file($path);
foreach ($lines as $lineNumber => $lineContent) {
if (!empty($lineContent) and $lineContent != '\\n') {
$exp = explode('=', trim($lineContent));
if (!empty($exp[0])) {
$data[$exp[0]] = jLocale::get('view~dictionnary.' . $exp[0], null, $lang);
}
}
}
}
$rep->data = $data;
return $rep;
}