Hi,
… I use the tool “Poedit” for my translations. It works very fine with the theme Vantage!
But, now I found a little point, who will not translated.
In /Vantage/inc/template-tags.php – Line: 141 – in the following string line:
'on' => __('Posted on <a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a><time class="updated" datetime="' . esc_attr( get_the_modified_date( 'c' ) ) . '">' . esc_html( get_the_modified_date() ) . '</time></span>', 'vantage'),
———————————————————————————————-
Here the complete function for a better overview:
function vantage_posted_on() { $posted_on_parts = array( 'on' => __('Posted on <a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a><time class="updated" datetime="' . esc_attr( get_the_modified_date( 'c' ) ) . '">' . esc_html( get_the_modified_date() ) . '</time></span>', 'vantage'), 'by' => __( '<span class="byline"> by <span class="author vcard"><a class="url fn n" href="%5$s" title="%6$s" rel="author">%7$s</a></span></span>', 'vantage' ), );
My problem/wish is, that I can translate the string “Posted on”!
But in the “.po”-file is not the right string – I think..
There is this string:
Posted on <a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a>
————————————
How I write the correct translation-string?
I hope you understand my question.
GM
Hi – Its me again…
… the same problem I’ve with the strings
and …
In the same file “/Vantage/inc/template-tags.php” – on Line: 317 until 324 – in the following string line:
Can you help me please – I must this translate urgent ;)
GM
Hi Mike
I’ll jump in tomorrow and take a look at this with Poedit. If you want to hotfix right now you could drop that entire function into the functions.php file of a child theme and manually change those strings. Not ideal…but if you want to fix right now:
If you’d like to keep your translated files in the languages folder of a child theme, I’ve got one ready to go here:
https://siteorigin.com/wp-content/uploads/2015/01/vantage-child-translation-ready-02.zip
The child theme has a function in functions.php that tells WordPress to look for the translated files in the child theme languages folder.
Is it possible also place a other “CHILD” file except the language “.po” and the /style.css?
Example the file “/vantage/inc/template-tags.php”
I create folder -> “/vantage-child/inc/” and copy the file “template-tags.php” in this folder.
And then I can make my changes in this file.
Thanks – GM ;)
If you can reply I’ll then star that email as it comes to me and help out with the string issue as soon as I can tomorrow.
Thanks
Hallo Andrew,
… many thanks for the CHILD Theme. It works fine.
After A few little adjustments!
—————————————————————————–
NOTE for VANTAGEfriends:… in WP-Admin, under Appearance -> Customize
Note: Before you change the theme (vantage) to (vantage-child), you have to remember your own layout colors!
Only – If you have previously changed the colors in the main theme (vantage).
Your changed theme colors are not adopted!
Good News:
ONLY the first time. After the first time, you can change between both themes without additional adjustments.
—————————————————————————–
GM
That’s correct. Thanks for pointing that. Unfortunately menu and Customizer settings reset when activating a child theme. It’s expected but still a pain.
Hallo Andrew (again),
… thanks for your (Not ideal…) fix tipp.
I think it’s up to line 141 in the /vantage/inc/template-tags.php:
I have tried the following and it works for me:
Unfortunately, I don´t know if this correct (clean) code.
I’m not so good CODER ;( !
GM ;)
A little correction in the line with “onMIKE”:
The “, ‘vantage’ ” are missing.
GM ;)
Sorry, I’m not following there. What is the added line for? Where you are you then using it?
I take a additional line in the file “/vantage/inc/template-tags.php”. After line 141.
The line begins with ‘onMIKE’ instead of normaly with ‘on’
And that I forgot to place followings “‘, ‘vantage’),” in this line (on the end of line).
Do you know now – what I means? I hope ;)
Maybe you can integrate the the next update?
GM ;)
I can confirm that right now I can translate the following:
But as you’ve pointed out, I’m unable to translate:
Thanks for bringing this to our attention. I’ll log a bug report now.
You can place in your next “vantage Theme” update,
also a additional line in the file “/vantage/inc/template-tags.php”. After line 141.
Then works the translation of this string “Posted on”.
Or not ?!?
GM ;)
Ok got you. Thanks for clearing this up. I’ll log this now.
Thanks – GM ;)
Hi GM
I’m going to answer here at the bottom rather.
You can copy many files over but not template-tags.php. If a function is wrapped in template-tags.php as follows:
Then it’s save to copy that entire function over to your functions.php file in your child theme. That’s the only way of changing the contents of template-tags.php, function by function. But the function must be wrapped as I indicated in order for you to copy it.
Hallo Andrew,
Many thanks for your help, it is a nice “TEMPSolution”.
But I think is better – I’m looking for your next update ;)
Many thanks again!
GM
Thanks again GM. I have definitely logged this. Unfortunately from then on it’s up to the developers to decide what lands up in the next update based on how much time they have etc. I have pushed this though so hopefully we’ll see it included soon.
I ended up with this exact problem: unable to translate that exact string “Posted on…”. Looking at the code here, I think the issue is that the ‘on’ string tries to translate a string including the “modified date” . A minor change fixes this:
Apologies for the hassle rolf, thanks for posting. We’ve fixed this, the change will be included in x.3.4. This is what the posted_on function will look like in the new version: