Skip to content

[i18n] Incorrect usage of translation function #9175

Description

@fbausch

The file MardownSourceComparison.vue contains an incorrect usage of the t() function for loading translated UI strings. Therefore, it is not possible to translate the strings that are supposed to be displayed to users.

  • Go to
    'aria-label': operation && t('text', operation === 'removed' ? 'Removed line {line}' : 'Added line {line}', { line: value!.number }),
  • Because of the inline logic in the second parameter of the t() function, the strings Removed line {line} and Added line {line} are not detected and offered for translation in Transifex.

The code should roughly look like this, instead:

			return h('div', {
				class: ['text-source-comparison__line', operation && `text-source-comparison__line--${operation}`],
				hidden: rowProps.layoutMode === 'single' && rowProps.activeSide !== side,
				'aria-label': operation && operation === 'removed' ? t('text', 'Removed line {line}', { line: value!.number }) : t('text', 'Added line {line}', { line: value!.number }),
				'data-source-operation': operation,
			},

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions