Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When translating this views release in localise.drupal.org, HTML tags shows up to translate (DIV, SPAN, H1,H2,H3,H4,H4,H6, P, STRONG, EM). Is there a reason to make HTML tags translatable? Otherwise it is confusing for translation teams. It pops up from the function function get_elements() in views_handler.inc to enable to format HTML around a field:
function get_elements() {
static $elements = NULL;
if (!isset($elements)) {
$elements = variable_get('views_field_rewrite_elements', array(
'' => t('- Use default -'),
'0' => t('- None -'),
'div' => t('DIV'),
'span' => t('SPAN'),
'h1' => t('H1'),
'h2' => t('H2'),
'h3' => t('H3'),
'h4' => t('H4'),
'h5' => t('H5'),
'h6' => t('H6'),
'p' => t('P'),
'strong' => t('STRONG'),
'em' => t('EM'),
));
}
return $elements;
}
I would propose:
function get_elements() {
static $elements = NULL;
if (!isset($elements)) {
$elements = variable_get('views_field_rewrite_elements', array(
'' => t('- Use default -'),
'0' => t('- None -'),
'div' => 'DIV',
'span' => 'SPAN',
'h1' => 'H1',
'h2' => 'H2',
'h3' => 'H3',
'h4' => 'H4',
'h5' => 'H5',
'h6' => 'H6',
'p' => 'P',
'strong' => 'STRONG',
'em' => 'EM',
));
}
return $elements;
}
Comment | File | Size | Author |
---|---|---|---|
#2 | patch_commit_97b94d9fb77f.patch | 1.02 KB | Hanno |
Comments
Comment #0.0
Hanno CreditAttribution: Hanno commentedtypo
Comment #1
dawehnerYeah there is no reason to translate it here. It would be kind of cool if you would create a patch, otherwise i will come back to it one day.
Comment #2
Hanno CreditAttribution: Hanno commentedOK, created a patch.
Comment #3
Hanno CreditAttribution: Hanno commentedComment #4
dawehnerGreat!
Thanks for providing a patch.
Commited as it is to 6.x-3.x and 7.x-3.x
Comment #5.0
(not verified) CreditAttribution: commentedem