Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Untranslated strings in patterns; question regarding footer offset patterns #68

Open
luminuu opened this issue Jun 14, 2022 · 2 comments

Comments

@luminuu
Copy link
Contributor

luminuu commented Jun 14, 2022

There are several untranslated strings in the patterns which I discovered while looking through the files of the theme. For the majority of this strings adding a translation isn't a big deal.

However there is one string, that might be a bit tricky to translate and keep the styling in place. In the footer-offset-* patterns, there's this big Let's Work Together. The words are put separately in span elements, with the first one having a bunch of additional CSS. It would be wrong to translate the words individually without the spans, because in different languages the grammar can be in a different order. Let's take German for example:

  • Translated word by word: "Lass arbeiten zusammen"
  • Translated meaningfully, informal version: "Lass uns zusammen arbeiten"
  • Translated meaningfully, formal version: "Lassen Sie uns zusammen arbeiten"

As you can see, not only the word order changes from the original English string, but in German there need more words to be added to make it grammatically correct. So it's not possible to translate each word individually, instead the entire string with the span tags and additional CSS must be included to ensure correct translation. And then this leads to the fact that a translator is now in charge of the design decision which words to highlight with the first span. The final question is: shall this string remain untranslated to ensure it follows the design, or is the entire string added to the translation to ensure it can be translated correctly?

Here's an overview of the untranslated strings per pattern file:

footer-call-to-action-dark.php

<h2 class="has-text-align-center has-x-large-font-size" id="let-s-work-together">Let's Work Together</h2>

<div class="wp-block-button"><a class="wp-block-button__link">Contact Us</a></div>

<p class="has-text-align-right has-secondary-color has-text-color has-link-color" style="font-size:0.95rem">Proudly powered by <a href="https://wordpress.org" rel="nofollow">WordPress</a></p>

footer-call-to-action.php

<p>Providing reliable business since forever.</p>

<p class="has-text-align-left" style="font-size:0.95rem">Proudly powered by <a href="https://wordpress.org" rel="nofollow">WordPress</a></p>

<h4 class="has-small-font-size" id="about">About</h4>

<h4 class="has-small-font-size" id="company-1">Products</h4>

footer-default.php

<p class="has-small-font-size">© <?php echo gmdate( 'Y' ); ?> Your Company LLC</p>

footer-logo-desc-two-nav.php

<h2 class="has-text-align-center has-x-large-font-size" id="let-s-work-together">Let's Work Together</h2>

<div class="wp-block-button"><a class="wp-block-button__link">Contact Us</a></div>

<p class="has-text-align-right" style="font-size:0.95rem">Proudly powered by <a href="https://wordpress.org" rel="nofollow">WordPress</a></p>

footer-logo-nav.php

* Title: Footer, Logo and Navigation TEST
I guess the TEST can be removed here, it currently shows up in the translation strings.

<p class="has-text-align-right has-small-font-size">Proudly powered by <a href="https://wordpress.org" rel="nofollow">WordPress</a></p>

footer-offset-heading-buttons-dark.php

<h2 class="has-text-align-left is-offset-copy has-xx-large-font-size" id="let-s-work-together" style="line-height:1.1"><span style="color: revert; font-family: var(--wp--preset--font-family--source-serif-4); font-size: clamp(3.5rem, 8vw, 8rem); display: inline !important;">Let's</span><span>Work</span><span>Together</span></h2>

<div class="wp-block-button is-style-outline"><a class="wp-block-button__link">Learn More</a></div>

<div class="wp-block-button"><a class="wp-block-button__link">Contact Us</a></div>

<p class="has-text-align-right has-secondary-color has-text-color has-link-color" style="font-size:0.95rem">Proudly powered by <a href="https://wordpress.org" rel="nofollow">WordPress</a></p>

footer-offset-heading-buttons-primary.php

<h2 class="has-text-align-left is-offset-copy has-xx-large-font-size" id="let-s-work-together" style="line-height:1.1"><span style="color: revert; font-family: var(--wp--preset--font-family--source-serif-4); font-size: clamp(3.5rem, 8vw, 8rem); display: inline !important;">Let's</span><span>Work</span><span>Together</span></h2>

<div class="wp-block-button is-style-outline"><a class="wp-block-button__link has-primary-color has-text-color">Learn More</a></div>

<div class="wp-block-button"><a class="wp-block-button__link">Contact Us</a></div>

<p class="has-text-align-right has-secondary-color has-text-color has-link-color" style="font-size:0.95rem">Proudly powered by <a href="https://wordpress.org" rel="nofollow">WordPress</a></p>

footer-offset-heading-buttons.php

<h2 class="has-text-align-left is-offset-copy has-xx-large-font-size" id="let-s-work-together" style="line-height:1.1"><span style="color: revert; font-family: var(--wp--preset--font-family--source-serif-4); font-size: clamp(3.5rem, 8vw, 8rem); display: inline !important;">Let's</span><span>Work</span><span>Together</span></h2>

<div class="wp-block-button is-style-outline"><a class="wp-block-button__link">Learn More</a></div>

<div class="wp-block-button"><a class="wp-block-button__link has-primary-color has-background-background-color has-text-color has-background">Contact Us</a></div>

<p class="has-text-align-right has-background-color has-text-color has-link-color" style="font-size:0.95rem">Proudly powered by <a href="https://wordpress.org" rel="nofollow">WordPress</a></p>

header-title-nav-button.php

<div class="wp-block-button"><a class="wp-block-button__link">Get Started</a></div>

@luminuu luminuu added the help wanted Extra attention is needed label Jun 14, 2022
@clubkert
Copy link
Member

Hmm... thanks @luminuu. Good catch.

The final question is: shall this string remain untranslated to ensure it follows the design, or is the entire string added to the translation to ensure it can be translated correctly?

I think this is my overall question. Maybe it is fine for this string to be untranslated. That ensures the pattern structure remains intact (both the styling and the space that the text takes up).

@KevinBatdorf
Copy link
Member

One option is using wp_sprintf with _x you can format it with the <span> tags in a responsible way. The translator would have to decide where to place the tags but the inline styling would be abstracted.

wp_sprintf(
  _x(
    '<span %1$s>Let's</span><span>Work</span><span>Together</span>',
    'Translators, chose meaningful places to break the sentence apart, but keep the inline styles in the first span',
    'extendable'
  ),
  'style="color: revert; font-family: var(--wp--preset--font-family--source-serif-4); font-size: clamp(3.5rem, 8vw, 8rem); display: inline !important;"'
);

@clubkert clubkert removed the help wanted Extra attention is needed label Dec 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants