8000 Handling of leading and trailing whitespace in templates inconsistent · Issue #80 · Polyconseil/vue-gettext · GitHub
[go: up one dir, main page]

Skip to content
Handling of leading and trailing whitespace in templates inconsistent #80
@bernhardreiter

Description

@bernhardreiter

Leading and trailing whitespaces are stripped with vue-gettext@2.1.1 and easygettext@2.7.0
only if a translation is available. This is an inconsistency which can be a problem together with some styling.

example

We have code like

<a href="https://vuejs.org/">Vue.js</a>
  <translate> is nice</translate>

Case 1:

If there is no translation available, this get expanded to something like

<a href="https://vuejs.org/">Vue.js</a>
  <span data-v-26f5cf0f> is nice</span>

which in our style sheet formats with space as expected like Vue.js is nice.

Case 2

there is a translation, this becomes

<a href="https://vuejs.org/">Vue.js</a>
  <span data-v-26f5cf0f>ist nett</span>

which in our style sheet formats without space between like Vue.jsist nett.

Inconsistency

Case 1 and 2 are inconsistent, the behaviour should be the same
and not depending on if there is a translation available for a language or not,
because it is reasonable to leave the default translation untranslated in the .po file.

formatting problem

My expectation would be that the rendering of

<a href="https://vuejs.org/">Vue.js</a>
  <translate>is nice</translate>

is as similiar to those of

<a href="https://vuejs.org/">Vue.js</a>
    is nice

as possible.

But now of course I go looking into our style sheet to see where the difference
comes from.

Thanks for creating vue-gettext as Free Software! :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0