Issue #495930 by fietserwin: Translated strings not correctly marked in the administrative interface when the default language is not English
parent
9ddfc4697d
commit
25ddf78e41
|
@ -1931,7 +1931,7 @@ function _locale_translate_seek() {
|
|||
$groups[$string['group']],
|
||||
array('data' => check_plain(truncate_utf8($string['source'], 150, FALSE, TRUE)) . '<br /><small>' . $string['location'] . '</small>'),
|
||||
$string['context'],
|
||||
array('data' => _locale_translate_language_list($string['languages'], $limit_language), 'align' => 'center'),
|
||||
array('data' => _locale_translate_language_list($string, $limit_language), 'align' => 'center'),
|
||||
array('data' => l(t('edit'), "admin/config/regional/translate/edit/$lid", array('query' => drupal_get_destination())), 'class' => array('nowrap')),
|
||||
array('data' => l(t('delete'), "admin/config/regional/translate/delete/$lid", array('query' => drupal_get_destination())), 'class' => array('nowrap')),
|
||||
);
|
||||
|
@ -2126,16 +2126,21 @@ function _locale_rebuild_js($langcode = NULL) {
|
|||
/**
|
||||
* List languages in search result table
|
||||
*/
|
||||
function _locale_translate_language_list($translation, $limit_language) {
|
||||
function _locale_translate_language_list($string, $limit_language) {
|
||||
// Add CSS.
|
||||
drupal_add_css(drupal_get_path('module', 'locale') . '/locale.css');
|
||||
|
||||
// Include both translated and not yet translated target languages in the
|
||||
// list. The source language is English for built-in strings and the default
|
||||
// language for other strings.
|
||||
$languages = language_list();
|
||||
unset($languages['en']);
|
||||
$default = language_default();
|
||||
$omit = $string['group'] == 'default' ? 'en' : $default->language;
|
||||
unset($languages[$omit]);
|
||||
$output = '';
|
||||
foreach ($languages as $langcode => $language) {
|
||||
if (!$limit_language || $limit_language == $langcode) {
|
||||
$output .= (!empty($translation[$langcode])) ? $langcode . ' ' : "<em class=\"locale-untranslated\">$langcode</em> ";
|
||||
$output .= (!empty($string['languages'][$langcode])) ? $langcode . ' ' : "<em class=\"locale-untranslated\">$langcode</em> ";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1139,11 +1139,11 @@ function locale_translate_edit_form($form, &$form_state, $lid) {
|
|||
'#value' => $source->location
|
||||
);
|
||||
|
||||
// Include default form controls with empty values for all languages.
|
||||
// This ensures that the languages are always in the same order in forms.
|
||||
// Include both translated and not yet translated target languages in the
|
||||
// list. The source language is English for built-in strings and the default
|
||||
// language for other strings.
|
||||
$languages = language_list();
|
||||
$default = language_default();
|
||||
// We don't need the default language value, that value is in $source.
|
||||
$omit = $source->textgroup == 'default' ? 'en' : $default->language;
|
||||
unset($languages[($omit)]);
|
||||
$form['translations'] = array('#tree' => TRUE);
|
||||
|
|
Loading…
Reference in New Issue