X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=index.php;h=1dc81843f2c8ed09b55fd2904bdec24ec75727b8;hb=f39580c6fd171b849cec5832b4912182696341f2;hp=98171d786a75e3a03db57d6e024523f1fe94dec9;hpb=d6379763290230242caac5fe1e7c589a29fa6bf0;p=github%2Fshaarli%2FShaarli.git diff --git a/index.php b/index.php index 98171d78..1dc81843 100644 --- a/index.php +++ b/index.php @@ -1170,6 +1170,8 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history) $conf->set('privacy.hide_public_links', !empty($_POST['hidePublicLinks'])); $conf->set('api.enabled', !empty($_POST['enableApi'])); $conf->set('api.secret', escape($_POST['apiSecret'])); + $conf->set('translation.language', escape($_POST['language'])); + try { $conf->write(isLoggedIn()); $history->updateSettings(); @@ -1207,6 +1209,8 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history) $PAGE->assign('hide_public_links', $conf->get('privacy.hide_public_links', false)); $PAGE->assign('api_enabled', $conf->get('api.enabled', true)); $PAGE->assign('api_secret', $conf->get('api.secret')); + $PAGE->assign('languages', Languages::getAvailableLanguages()); + $PAGE->assign('language', $conf->get('translation.language')); $PAGE->renderPage('configure'); exit; } @@ -1232,9 +1236,10 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history) } $delete = empty($_POST['totag']); $redirect = $delete ? 'do=changetag' : 'searchtags='. urlencode(escape($_POST['totag'])); + $count = count($alteredLinks); $alert = $delete - ? sprintf(t('The tag was removed from %d links.'), count($alteredLinks)) - : sprintf(t('The tag was renamed in %d links.'), count($alteredLinks)); + ? sprintf(t('The tag was removed from %d link.', 'The tag was removed from %d links.', $count), $count) + : sprintf(t('The tag was renamed in %d link.', 'The tag was renamed in %d links.', $count), $count); echo ''; exit; } @@ -1450,7 +1455,7 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history) if ($url == '') { $url = '?' . smallHash($linkdate . $LINKSDB->getNextId()); - $title = $conf->get('general.default_note_title', 'Note: '); + $title = $conf->get('general.default_note_title', t('Note: ')); } $url = escape($url); $title = escape($title); @@ -2018,6 +2023,7 @@ function install($conf) } else { $conf->set('general.title', 'Shared links on '.escape(index_url($_SERVER))); } + $conf->set('translation.language', escape($_POST['language'])); $conf->set('updates.check_updates', !empty($_POST['updateCheck'])); $conf->set('api.enabled', !empty($_POST['enableApi'])); $conf->set( @@ -2049,6 +2055,7 @@ function install($conf) list($continents, $cities) = generateTimeZoneData(timezone_identifiers_list(), date_default_timezone_get()); $PAGE->assign('continents', $continents); $PAGE->assign('cities', $cities); + $PAGE->assign('languages', Languages::getAvailableLanguages()); $PAGE->renderPage('install'); exit; }