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

Translation: understrap-child not all translated in inc/template-tags.php #893

Closed
2 tasks
SvaSanRA opened this issue Jan 14, 2019 · 5 comments · Fixed by #1303
Closed
2 tasks

Translation: understrap-child not all translated in inc/template-tags.php #893

SvaSanRA opened this issue Jan 14, 2019 · 5 comments · Fixed by #1303

Comments

@SvaSanRA
Copy link

SvaSanRA commented Jan 14, 2019

Issue is about..

  • a Question
  • I need help

Please tell us about your environment:

  • WordPress Version: 5.0.3
  • OS Version: [Windows 10] | Linux [Linux Mint 19.1 Tessa]
  • Browser: [ Chrome XX | Firefox XX | IE XX | Mobile Chrome XX ]

Hello Hologer. I liked your starting theme Understrap and I decided to use it in my project. While the project is being created for a Russian-speaking audience, but in the future I plan to make it in English. After installing the child theme Understrap, in my case the translations into Russian did not work completely, such as “Posted on”, “by”, “Posted in”, although there is a translation in the ru_RU.PO file. I started to figure it out and found out that something is not correctly working out substituting the macro for the phrases injected into the function esc_html_x () and esc_html __ () thet are in the file inc/template-tags.php. When I change a line:
esc_html_x ('Posted on', 'post date', 'understrap');
on
esc_html_x ('Posted on% s', 'post date', 'understrap');

The translation occurs, but the macro "% s" falls into the translated word.

The only way out for me is to substitute the translated words directly into functions, but this is not the correct approach.
Please tell me what could be the reason for this behavior of built-in functions. Perhaps the problem is just me and she on the surface.


Thank you in advance.

@Anzan
Copy link

Anzan commented Apr 18, 2019

I'm using Understrap for a french theme and some translatable strings in the theme are out of sync with the PO file: "Posted on %s" is now "Posted on", "by %s" is now "by". It's simple to just add a new string in the .PO file for the new content and save it as .MO with Poedit but someone should update the language files that are provided.

@Thomas-A-Reinert
Copy link
Contributor

Sorry, but call me stupid - I´m not really getting the problem. Could you please clarify?

@Anzan
Copy link

Anzan commented Jul 11, 2019

When making a theme in another language than english, you realize some Understrap strings are still in english when you switch language, even with all the PO/MO files in /languages/, I think some people have made changes to strings without updating the PO files that contain the translation in other languages. For example, see this commit:

b6af4ac#diff-5915276465e785d5f7897d71685fca5f

'Tagged %1$s' was changed to 'Tagged %s', but the language PO file that associates the translation with 'Tagged %1$s' was not updated to 'Tagged %s', so now that translation is lost, and a theme in french (in my case) that should be translated to, say, Taggé %s, is still in english instead, because it contains a translation for 'Tagged %1$s', an orphan string not found in the theme files anymore.

@danemorgan
Copy link
Contributor

I have never worked with internationalization.

Can anyone explain why the change was made from 'Tagged %1$s' to 'Tagged %s' in this specific location. There is a lot of '%1$s' still through the PHP in the theme. Why does this one change but not the others?

Is the solution here to modify the .po and .mo files to match the new PHP, or is it to modify the PHP back to what it was?

@bacoords
Copy link
Member

bacoords commented Sep 8, 2021

Closing with the launch of 1.0.0.

@bacoords bacoords closed this as completed Sep 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment