Community Forums › Forums › Archived Forums › Design Tips and Tricks › Part of theme fails to translate when Child active
Tagged: translation
- This topic has 6 replies, 2 voices, and was last updated 10 years, 8 months ago by Len.
-
AuthorPosts
-
August 2, 2013 at 2:21 pm #53795CJWillyMember
I am attempting to translate all English on a French-language website (http://europrotection.info/).
It is using:
* WordPress 3.5.2
* Genesis 1.9.2
* Winfield Child Theme 2.2.0I've managed to get rid of most of the English but for some reason "FILED UNDER" appears in English (instead of "CATÉGORIES"). Certain other parts also appear in English (such as "Previous article" and "Next article.")
This is despite the fact that the WP install was in French (dashboard in French) and the fact that Genesis's French-language .po file is otherwise working.
When I deactivate the Winfield Child Theme, "FILED UNDER" is correctly translated, so I assume it's something wrong with the Child theme, but I don't know where to look. "FILED UNDER" doesn't appear in Winfield's .pot file (it does appear, translated, in Genesis's .pot).
Any idea what could be deactivating the translation when I use the Child theme?
Thanks for your help.
http://europrotection.infoAugust 2, 2013 at 3:38 pm #53807LenParticipantHi CJWilly,
It looks like a bug. It seems like I missed a couple of strings when generating the po file. I'll have a look to see what's going on when I get home.
August 3, 2013 at 3:03 pm #53983LenParticipantHi CJWilly,
Just a note to let you know I'll push out a fix some time today. I'll post here when it's done.
August 3, 2013 at 3:11 pm #53985CJWillyMemberThat's great to know. Thanks for your help.
August 3, 2013 at 7:42 pm #54014LenParticipantHi CJWilly,
I believe the issue has been rectified. If you're interested in the juicy details ...
At about Line 70 of Winfield's functions.php file you'll see this,
add_filter( 'genesis_post_meta', 'post_meta_filter' ); function post_meta_filter($post_meta) { if ( !is_page() ) { $post_meta = '[post_categories before="Filed Under: "] [post_tags before="Tagged With: "]'; return $post_meta; }}
That was removed as it is redundant. The only reason it was there is because I had planned to do something with it in the future but have since changed my mind. As it stands it was merely duplicating an already present Genesis function - worse yet, it was overriding it.
With respect to the issue - the Next Article and Previous Article headings in single post navigation not translating, Lines 91 and 97 were not wrapped in a GetText function.
echo 'Next Article';
is now ...
echo (__( 'Next Article', 'winfield' ));
and ...
echo 'Previous Article';
is now ...
echo (__( 'Previous Article', 'winfield' ));
Those strings are now present in the winfield po file. When you scan that file, add your translations and save it as your mo file the translations should show up.
I tested it on both a local and a live site and it works. If there is still a problem let me know.
The update is live on GitHub.
August 4, 2013 at 2:19 am #54056CJWillyMemberI have manually deleted that section of function.php. "Filed under" is now correctly translating to "Catégorie(s)." However, "previous/next article" is not translating. Example here.
Also, unrelated issue, when I put a widget in the "home" widget areas (left, right or middle), the normal sidebars disappear and instead there are three columns with a totally different look and feel from article pages. See here. Is this working as intended?
If possible I'd want to keep the regular right sidebar on the homepage, while using the middle/right home bars to showcase content under various categories (rather than just one post after another).
August 4, 2013 at 2:37 am #54058LenParticipantHi CJWilly,
Issue #1
If open the winfield.po file that resides in the child theme's language folder with an editor like Poedit you'll see the two strings "Next Article" and "Previous Article" are present. You just need to add your translations and save. Poedit will automatically create a .mo file which you need to rename as fr_FR.moIssue #2
The way the theme is coded is the home page is fully widgetized. You add content to it via widgets. If no widgets are active it automatically falls back to a standard blog type format. As soon as you add even one widget the new format takes over. -
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.