Differentiate between available and installed languages. Provide admin UI to install languages.

See: https://apps.sourceforge.net/trac/gallery/ticket/75 (first step for this task)
This commit is contained in:
Andy Staudacher
2009-02-19 08:48:14 +00:00
parent d47e4c9b43
commit 237656f6c8
3 changed files with 44 additions and 10 deletions

View File

@@ -79,13 +79,16 @@ class user_Core {
}
private static function _add_locale_dropdown(&$form, $user=null) {
$locales = locale::available();
$locales->none = t("« none »");
$selected_locale = ($user && $user->locale) ? $user->locale : "none";
$form->dropdown("locale")
->label(t("Language Preference"))
->options($locales)
->selected($selected_locale);
$locales = locale::installed();
$locales_array = (array) $locales;
if (count($locales_array) > 1) {
$locales->none = t("« none »");
$selected_locale = ($user && $user->locale) ? $user->locale : "none";
$form->dropdown("locale")
->label(t("Language Preference"))
->options($locales)
->selected($selected_locale);
}
}
static function get_delete_form_admin($user) {