Part of theme fails to translate when Child active

Community Forums Forums Design Tips and Tricks Part of theme fails to translate when Child active

This topic is: not resolved

Tagged: 

This topic contains 6 replies, has 2 voices, and was last updated by  Len 1 year, 3 months ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #53795

    CJWilly
    Participant
    Post count: 2

    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.0

    I’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.info
    #53807

    Len
    Participant
    Post count: 54

    Hi 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.


    #53983

    Len
    Participant
    Post count: 54

    Hi 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.


    #53985

    CJWilly
    Participant
    Post count: 2

    That’s great to know. Thanks for your help.

    #54014

    Len
    Participant
    Post count: 54

    Hi 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.


    #54056

    CJWilly
    Participant
    Post count: 2

    I 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).

    #54058

    Len
    Participant
    Post count: 54

    Hi 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.mo

    Issue #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.


Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.