mirror of
https://github.com/monstra-cms/monstra.git
synced 2025-08-03 19:57:57 +02:00
System Plugin: Monstra Localization Improvments
This commit is contained in:
@@ -27,6 +27,44 @@
|
|||||||
|
|
||||||
class SystemAdmin extends Backend {
|
class SystemAdmin extends Backend {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Locales array
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
public static $locales = array(
|
||||||
|
'ar' => 'العربية',
|
||||||
|
'bg' => 'Български',
|
||||||
|
'ca' => 'Català',
|
||||||
|
'cs' => 'Česky',
|
||||||
|
'da' => 'Dansk',
|
||||||
|
'de' => 'Deutsch',
|
||||||
|
'el' => 'Ελληνικά',
|
||||||
|
'en' => 'English',
|
||||||
|
'es' => 'Español',
|
||||||
|
'fi' => 'Suomi',
|
||||||
|
'fr' => 'Français',
|
||||||
|
'gl' => 'Galego',
|
||||||
|
'hu' => 'Magyar',
|
||||||
|
'it' => 'Italiano',
|
||||||
|
'ja' => '日本語',
|
||||||
|
'lt' => 'Lietuvių',
|
||||||
|
'nl' => 'Nederlands',
|
||||||
|
'no' => 'Norsk',
|
||||||
|
'pl' => 'Polski',
|
||||||
|
'pt' => 'Português',
|
||||||
|
'pt-br' => 'Português do Brasil',
|
||||||
|
'ru' => 'Русский',
|
||||||
|
'sk' => 'Slovenčina',
|
||||||
|
'sl' => 'Slovenščina',
|
||||||
|
'sv' => 'Svenska',
|
||||||
|
'tr' => 'Türkçe',
|
||||||
|
'uk' => 'Українська',
|
||||||
|
'zh' => '中文',
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* System plugin admin
|
* System plugin admin
|
||||||
*/
|
*/
|
||||||
@@ -39,6 +77,7 @@
|
|||||||
$components = Plugin::$components;
|
$components = Plugin::$components;
|
||||||
$actions = Action::$actions;
|
$actions = Action::$actions;
|
||||||
|
|
||||||
|
|
||||||
// Get pages table
|
// Get pages table
|
||||||
$pages = new Table('pages');
|
$pages = new Table('pages');
|
||||||
|
|
||||||
@@ -48,14 +87,12 @@
|
|||||||
|
|
||||||
|
|
||||||
// Get languages files
|
// Get languages files
|
||||||
$language_files = File::scan('../plugins/box/system/languages/', '.lang.php');
|
$language_files = File::scan(PLUGINS_BOX . DS . 'system' . DS . 'languages' . DS, '.lang.php');
|
||||||
foreach ($language_files as $language) {
|
foreach ($language_files as $language) {
|
||||||
$parts = explode('.', $language);
|
$parts = explode('.', $language);
|
||||||
$l = $parts[0];
|
$languages_array[$parts[0]] = SystemAdmin::$locales[$parts[0]];
|
||||||
$languages_array[$l] = $l;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Get all pages
|
// Get all pages
|
||||||
$pages_array = array();
|
$pages_array = array();
|
||||||
$pages_list = $pages->select('[slug!="error404" and parent=""]');
|
$pages_list = $pages->select('[slug!="error404" and parent=""]');
|
||||||
|
@@ -43,7 +43,7 @@
|
|||||||
Form::label('system_timezone', __('Time zone', 'system')).
|
Form::label('system_timezone', __('Time zone', 'system')).
|
||||||
Form::select('system_timezone', Date::timezones(), Option::get('timezone'), array('class' => 'span7')). Html::br().
|
Form::select('system_timezone', Date::timezones(), Option::get('timezone'), array('class' => 'span7')). Html::br().
|
||||||
Form::label('system_language', __('Language', 'system')).
|
Form::label('system_language', __('Language', 'system')).
|
||||||
Form::select('system_language', $languages_array, Option::get('language'), array('class' => 'span2')). Html::br().
|
Form::select('system_language', $languages_array, Option::get('language'), array('class' => 'span3')). Html::br().
|
||||||
Form::label('site_maintenance_message', __('Maintenance Mode', 'system')).
|
Form::label('site_maintenance_message', __('Maintenance Mode', 'system')).
|
||||||
Form::textarea('site_maintenance_message', Html::toText(Option::get('maintenance_message')), array('style' => 'width:640px;height:160px;')). Html::br(2)
|
Form::textarea('site_maintenance_message', Html::toText(Option::get('maintenance_message')), array('style' => 'width:640px;height:160px;')). Html::br(2)
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user