Commit 5dc8b219 authored by alain_desilets's avatar alain_desilets

Added a feature to make "Translation in progress" notice optional; When...

Added a feature to make "Translation in progress" notice optional; When translating a page, if only one langage left, it is selected by default; 
parent 22a35817
......@@ -3142,6 +3142,8 @@ $lang=Array(
// "preferred languages" => "preferred languages",
// "Equivalent translations" => "Equivalent translations",
// "Translations that need improvement" => "Translations that need improvement",
// "Incomplete translation notice" => "Incomplete translation notice"
// "When a page is translated to a new language, a notice will be automatically be inserted into the page to indicate that the translation is not yet complete." => "When a page is translated to a new language, a notice will be automatically be inserted into the page to indicate that the translation is not yet complete."
// "update it" => "update it",
// "Upcoming `\$module_rows` events" => "Upcoming `\$module_rows` events",
// "The Next Event" => "The Next Event",
......
......@@ -614,11 +614,10 @@ function prefs_feature_list() {
'type' => 'flag',
),
'feature_translation_incomplete_notice' => array(
'name' => tra('Translation incomplete notice'),
'name' => tra('Incomplete translation notice'),
'description' => tra('When a page is translated to a new language, a notice will be automatically be inserted into the page to indicate that the translation is not yet complete.'),
'type' => 'flag',
),
'feature_multilingual_structures' => array(
'name' => tra('Multilingual structures'),
'description' => tra('Structures to lookup equivalent pages in other languages. May cause performance problems on larger structures.'),
......
......@@ -1030,6 +1030,7 @@ function get_default_prefs() {
'feature_best_language' => 'n',
'feature_translation' => 'n',
'feature_urgent_translation' => 'n',
'feature_translation_incomplete_notice' => 'y',
'lang_use_db' => 'n',
'language' => 'en',
'feature_babelfish' => 'n',
......
......@@ -45,6 +45,7 @@
{preference name=feature_sync_language}
{preference name=feature_translation}
{preference name=feature_urgent_translation}
{preference name=feature_translation_incomplete_notice}
{preference name=feature_multilingual_one_page}
{preference name=quantify_changes}
{preference name=feature_multilingual_structures}
......
......@@ -33,15 +33,13 @@
<option value="unspecified">{tr}Unspecified{/tr}</option>
{section name=ix loop=$languages}
{if in_array($languages[ix].value, $prefs.available_languages) or $prefs.available_languages|@count eq 0 or !is_array($prefs.available_languages)}
<option value="{$languages[ix].value|escape}">{$languages[ix].name}</option>
<option value="{$languages[ix].value|escape}"{if $only_one_language_left eq "y"} SELECTED{/if}>{$languages[ix].name}</option>
{/if}
{/section}
</select>
<br />{tr}Name of newly translated page{/tr}: <input type="text" size="40" name="page" id="translation_name"/><input type="hidden" name="translationOf" value="{$name|escape}"/>
<input type="submit" value="{tr}Create translation{/tr}"/></p>
<textarea name="edit" style="display:none">^{$translate_message}^
{$pagedata|escape:'htmlall':'UTF-8'}</textarea>
<textarea name="edit" style="display:none">{$translate_message}{$pagedata|escape:'htmlall':'UTF-8'}</textarea>
</form>
<script type='text/javascript'>
......
......@@ -57,9 +57,9 @@ if ((!isset($_REQUEST['type']) || $_REQUEST['type'] == 'wiki page' || $_REQUEST[
# it meant someone else was translating it and that they should not
# touch it.
#
echo "<pre>tiki-edit_translation: before inserting incomplete translation message</pre>\n";
$smarty->assign('translate_message', tra("Translation of this page is incomplete.", $langpage));
if ($prefs['feature_translation_incomplete_notice'] == 'y') {
$smarty->assign('translate_message', "^".tra("Translation of this page is incomplete.", $langpage)."^\n\n");
}
}
else if ($_REQUEST['id']) {
if (!isset($_REQUEST['type'])) {
......@@ -269,6 +269,9 @@ foreach( $rawLangs as $langInfo )
if( ! in_array( $langInfo['value'], $usedLang ) )
$languages[] = $langInfo;
$smarty->assign_by_ref('languages', $languages);
if (count($languages) == 1) {
$smarty->assign('only_one_language_left', 'y');
}
ask_ticket('edit-translation');
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment