mirror of
https://github.com/Mibew/mibew.git
synced 2025-03-01 01:24:32 +03:00
parent
cabdaed21d
commit
668e724a01
@ -41,6 +41,8 @@ class TranslationImportController extends AbstractController
|
|||||||
$target = get_current_locale();
|
$target = get_current_locale();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$override = (bool)$request->request->get('override', false);
|
||||||
|
|
||||||
$page = array(
|
$page = array(
|
||||||
// Use errors list stored in the request. We need to do so to have
|
// Use errors list stored in the request. We need to do so to have
|
||||||
// an ability to pass the request from other actions.
|
// an ability to pass the request from other actions.
|
||||||
@ -60,6 +62,7 @@ class TranslationImportController extends AbstractController
|
|||||||
$page['stored'] = $request->query->has('stored');
|
$page['stored'] = $request->query->has('stored');
|
||||||
$page['localesList'] = $locales_list;
|
$page['localesList'] = $locales_list;
|
||||||
$page['formtarget'] = $target;
|
$page['formtarget'] = $target;
|
||||||
|
$page['formoverride'] = $override;
|
||||||
$page['title'] = getlocal('Translations import');
|
$page['title'] = getlocal('Translations import');
|
||||||
$page['menuid'] = 'translation';
|
$page['menuid'] = 'translation';
|
||||||
$page = array_merge($page, prepare_menu($operator));
|
$page = array_merge($page, prepare_menu($operator));
|
||||||
@ -87,6 +90,8 @@ class TranslationImportController extends AbstractController
|
|||||||
$target = get_current_locale();
|
$target = get_current_locale();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$override = (bool)$request->request->get('override', false);
|
||||||
|
|
||||||
// Validate uploaded file
|
// Validate uploaded file
|
||||||
$file = $request->files->get('translation_file');
|
$file = $request->files->get('translation_file');
|
||||||
if ($file) {
|
if ($file) {
|
||||||
@ -107,7 +112,7 @@ class TranslationImportController extends AbstractController
|
|||||||
if (count($errors) == 0) {
|
if (count($errors) == 0) {
|
||||||
try {
|
try {
|
||||||
// Try to import new messages.
|
// Try to import new messages.
|
||||||
import_messages($target, $file->getRealPath());
|
import_messages($target, $file->getRealPath(), $override);
|
||||||
|
|
||||||
// The file is not needed any more. Remove it.
|
// The file is not needed any more. Remove it.
|
||||||
unlink($file->getRealPath());
|
unlink($file->getRealPath());
|
||||||
|
@ -35,6 +35,15 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="fieldForm">
|
<div class="fieldForm">
|
||||||
|
<div class="field">
|
||||||
|
<label for="override" class="flabel">{{l10n "Override existing translations"}}</label>
|
||||||
|
<div class="fvalue">
|
||||||
|
<input id="override" type="checkbox" name="override" value="on"{{#if formoverride}} checked="checked"{{/if}}/>
|
||||||
|
</div>
|
||||||
|
<label for="override" class="fdescr"> — {{l10n "Replaces translated strings in the database with values from the imported file."}}</label>
|
||||||
|
<br clear="all"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<label for="translation_file" class="flabel">
|
<label for="translation_file" class="flabel">
|
||||||
{{l10n "Upload translation"}}<span class="required">*</span>
|
{{l10n "Upload translation"}}<span class="required">*</span>
|
||||||
|
Loading…
Reference in New Issue
Block a user