Skip to content

Commit 602a14a

Browse files
committed
Fixed language install message and javascript save code
1 parent 45b62b1 commit 602a14a

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

admin/controller/localization/language.php

+9-5
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,17 @@ function save() {
4747
}
4848

4949
function install() {
50-
$code = filter('/[-\w]+/', $this->request->post['code']);
51-
$url = str_replace('{code}', $code, $this->installUrl);
50+
$code = filter('/[-\w]+/', $this->request->post['code']);
51+
$url = str_replace('{code}', $code, $this->installUrl);
52+
$available = false;
5253

5354
require DIR_SYSTEM . 'functions' . DS . 'php-mo.php';
5455

5556
foreach ($this->files as $file) {
5657
$translations = download($url . $file);
5758

5859
if ($translations) {
60+
$available = true;
5961
$folder = DIR_ROOT . 'locale' . DS . $code . DS . 'LC_MESSAGES';
6062
$poFile = $folder . DS . $file;
6163
@mkdir($folder, 0755 & ~umask(), true);
@@ -74,12 +76,14 @@ function install() {
7476
break;
7577
}
7678
} else {
77-
$this->view->errors[] = __('Language pack not available!');
78-
$this->view->info[] = sprintf(__('Check available translations at %s'), '<a href="' . $this->listUrl . '" target="_blank">' . $this->listUrl . '</a>');
79-
8079
break;
8180
}
8281
}
82+
83+
if (!$available) {
84+
$this->view->errors[] = __('Language pack not available!');
85+
$this->view->info[] = sprintf(__('Check available translations at %s'), '<a href="' . $this->listUrl . '" target="_blank">' . $this->listUrl . '</a>');
86+
}
8387

8488
return $this->index();
8589
}

0 commit comments

Comments
 (0)