question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Improve translations by using named fomatting

See original GitHub issue

What is the motivation for adding / enhancing this feature?

Translation strings which are composed of multiple pieces like for example https://github.com/DivanteLtd/vue-storefront/blob/38fb1579c60d1aa352d353c06c1f0d9af7f79937/src/themes/default/components/core/GenericSelector.vue#L6 or https://github.com/DivanteLtd/vue-storefront/blob/6995f88dab30cbd2a10dcd6874891f6566124320/src/themes/default/components/core/ColorSelector.vue#L5 force the pieces to be composed in this exact order. So, for example first "Select " and then always followed by the label. Considering the following German translation, this results in “Auswählen Größe” which sounds really stupid as it is simply incorrect grammar:

  • "Select " translated with "Auswählen "
  • label having a value of “Größe”

Correct would be “Größe auswählen”.

What are the acceptance criteria

A translation string needs to be able to define the order of how the pieces get put together.

Can you complete this feature request by yourself?

  • YES
  • NO

Which Release Cycle state this refers to?

  • This is a normal feature request. This should be available on https://test.storefrontcloud.io and then after tests this can be added to next Vue Storefront version. In this case Developer should create branch from develop branch and create Pull Request 2. Feature / Improvement back to develop.
  • (Pick this option only if you’re sure) This is an important improvement request for current Release Candidate version on https://next.storefrontcloud.io and should be placed in next RC version. In this case Developer should create branch from release branch and create Pull Request 3. Stabilisation fix back to release.
  • (Pick this option only if you’re sure) This is a critical improvement request for current Stable version on https://demo.storefrontcloud.io and should be placed in next stable version. In this case Developer should create branch from hotfix or master branch and create Pull Request 4. Hotfix back to hotfix.

Additional information

I propose that all translations which are composed of multiple strings/translations use named formatting. This feature is already available (vue-i18n), only need to refactor existing code to take advantage of it. Translations for the above mentioned examples would look like this:

"Select {label}","{label} auswählen"
"Select color {label}","Farbe '{color}' auswählen"

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ca1zrcommented, May 9, 2019

Hi @phoenixdev-kl, it was a general request. Some translations sound pretty weird and choppy, so named formatting is a good thing.

0reactions
phoenixdev-klcommented, Sep 13, 2019

@pkarw great! sorry, the process is unfortunately not clear to me. if this feature is planned for 2.0, from which branch do i create a branch in my fork (release/v2.0 or develop)? and when the refactoring is finished, am i supposed to create the pull request in release/2.0?

Read more comments on GitHub >

github_iconTop Results From Across the Web

33 Tips to Optimize Your Word Documents for Translation
Use these 33 tips to optimize your Word documents for translation and spend less time on manually fixing your doc after translating them....
Read more >
The Importance of Formatting a Document for Translation
Formatting a document for translation means successfully replicating how a source document looks. This includes recreating watermarks, inserting borders, ...
Read more >
How formatting can help reduce your translation costs
Formatting the texts you send your translation partner is an effective way to get maximum value for money from your translations.
Read more >
7 Ideas to Consider When Formatting Your Source Document ...
Proper document format can ensure that the final translated project is accurate. Learn techniques that can help your translators create the best product....
Read more >
Format Transfer in Machine Translation - Lilt Labs
In this article, we describe how Lilt preserves formatting in translation. We'll cover Tag Representation, Word Alignment and Attention, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found