Skip to content

Commit

Permalink
Make the message with the list of alternatives languages optional
Browse files Browse the repository at this point in the history
  • Loading branch information
mweimerskirch committed Nov 20, 2015
1 parent 962d619 commit f7ee258
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion admin/qtx_configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,11 @@ function qtranxf_conf() {
<br/>
<p class="qtranxs_notes"><?php _e('This is relevant to all fields other than the main content of posts and pages. Such untranslated fields are always shown in an alternative available language, and will be prefixed with the language name in parentheses, if this option is on.', 'qtranslate') ?></p>
<br/>
<label for="show_alternative_content_message"><input type="checkbox" name="show_alternative_content_message" id="show_alternative_content_message" value="1"<?php checked($q_config['show_alternative_content_message']) ?>/> <?php _e('When content is displayed in an alternative language, show an explanatory message.', 'qtranslate') ?></label>
<p class="qtranxs_notes"><?php printf(__('If this option is on, a message with a list of other available languages is displayed when a page or a post with an untranslated content is viewed. The languages are ordered as defined by option "%s".', 'qtranslate'), __('Default Language / Order', 'qtranslate')) ?></p>
<br/>
<label for="show_alternative_content"><input type="checkbox" name="show_alternative_content" id="show_alternative_content" value="1"<?php checked($q_config['show_alternative_content']) ?>/> <?php _e('Show content in an alternative language when translation is not available for the selected language.', 'qtranslate') ?></label>
<p class="qtranxs_notes"><?php printf(__('When a page or a post with an untranslated content is viewed, a message with a list of other available languages is displayed, in which languages are ordered as defined by option "%s". If this option is on, then the content of the first available language will also be shown, instead of the expected language, for the sake of user convenience.', 'qtranslate'), __('Default Language / Order', 'qtranslate')) ?></p>
<p class="qtranxs_notes"><?php echo __('If this option is on, then the content of the first available language will also be shown, instead of the expected language, for the sake of user convenience.', 'qtranslate') ?></p>
</td>
</tr>
<tr valign="top">
Expand Down
2 changes: 1 addition & 1 deletion qtranslate_core.php
Original file line number Diff line number Diff line change
Expand Up @@ -1466,7 +1466,7 @@ function qtranxf_use_content($lang, $content, $available_langs, $show_available=
$alt_content = $content[$alt_lang];
$alt_lang_is_default = $alt_lang == $q_config['default_language'];

if(!$show_available){
if(!$show_available || !$q_config['show_alternative_content_message']){
if ($q_config['show_displayed_language_prefix'])
return '('.$q_config['language_name'][$alt_lang].') '.$alt_content;
else
Expand Down
1 change: 1 addition & 0 deletions qtranslate_options.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ function qtranxf_set_default_options(&$ops)
'detect_browser_language' => true,// enables browser language detection
'hide_untranslated' => false,// hide pages without content
'show_displayed_language_prefix' => true,
'show_alternative_content_message' => true,
'show_alternative_content' => false,
'hide_default_language' => true,// hide language tag for default language in urls
'use_secure_cookie' => false,
Expand Down

0 comments on commit f7ee258

Please sign in to comment.