WordPress.org

Ready to get started?Download WordPress

Forums

Path
Translation and other questions (15 posts)

  1. Kami2
    Member
    Posted 1 year ago #

    Hello,

    I hope someone can help.
    I need to do some changes on this theme and i am sure that the following questions could be helpfull for other people as well.
    I need to translate some things on the wordpress theme named Path. I am using a child theme of path and all the changes are going on child-theme.

    1) I need to change the sentence "Leave a response" for something like "(0) no comments". I find out that shortcode.php have all i need. Should i "rewrite" this code? How?

    /** function hybrid_entry_comments_link_shortcode( $attr ) {

    $comments_link = '';
    $number = doubleval( get_comments_number() );
    $attr = shortcode_atts( array( 'zero' => __( 'Comenta', 'hybrid-core' ), 'one' => __( '%1$s Response', 'hybrid-core' ), 'more' => __( '%1$s Responses', 'hybrid-core' ), 'css_class' => 'comments-link', 'none' => '', 'before' => '', 'after' => '' ), $attr ); **/

    2) The read-more link on entry-summary class, how could i translate it?

    3) The text "You are here:" i need to translate too. On Breadcrumbs-trail.php i found "home" but not the text "You are here".

    4) When we write an article and post some picture inside it, the theme asigns a thumbnail on homepage, there is a way to disable this action? I mean sometimes i really want to show a "custom thumbnail" but other times i don't need to display a pic and then if the post have one it is displayed on homepage.

    Grateful If someone could answer some of the questions.

    thanks,

    Kami

  2. Sami Keijonen
    WordPress-asiantuntija
    Theme Author

    Posted 1 year ago #

    There is no need to ever modify theme files. You'll loose them when I update the theme.

    Here is how you translate the theme.

    Copy hybrid-core-en_EN.po and path-en_EN.po from parent theme languages folder to child theme languages folder. Then rename those files to your language setting (hybrid-core-xx_XX.po).

    http://codex.wordpress.org/WordPress_in_Your_Language

    Then open those files with Poedit and start translating.

  3. Kami2
    Member
    Posted 1 year ago #

    Hello Sami,

    Thank you for the tip. I wasn't doing that well. Now i understood how to translate for my language. Thank you very much.
    I had another short question.

    "4) When we write an article and post some picture inside it, the theme assigns a thumbnail on homepage, there is a way to disable this action? I mean, sometimes i really want to show a "custom thumbnail" but other times i don't need to display a pic and then if the post have one inside, it is displayed on homepage."

    Somehow, it is a question for another topic but if you want to disable the thumbnail the way i explained before, is it possible?

    thank you for your support,

    Kami

  4. Sami Keijonen
    WordPress-asiantuntija
    Theme Author

    Posted 1 year ago #

    4) That is because theme is using so called get-the-image script and it also grabs an image attached to your post, if there is no featured image. You can get rid of this behaviour by doing this.

    Put this line inside setup function in child theme functions,php.

    add_filter( 'get_the_image_args', 'my_get_the_image_args' );

    And this after setup function.

    function my_get_the_image_args( $args ) {
    
    	$args['attachment'] = false;
    
    	return $args;
    }

    That way only feature image will show up in front page.

  5. Kami2
    Member
    Posted 1 year ago #

    I was working to fix that problem and i realized that this code do disappear some images that the plugin, Query Posts from Justin Tadlock, uses.
    In this case, I use this plugin to display some images from custom post types and maybe it uses the function get-the-image.

    So, I tried to use a condition on content.php on the child-theme :
    <?php if ( has_post_thumbnail() ) { the_post_thumbnail( 'fullsize' ); } ?> something like

    also, i deleted this code on content.php on the child-theme:
    <?php if ( current_theme_supports( 'get-the-image' ) ) get_the_image( array( 'meta_key' => 'Thumbnail', 'size' => 'thumbnail' ) ); ?>

    On the child-theme functions.php i used:

    add_image_size('fullsize',615,261, true);

    And i edited the css file.

    Maybe it's not the best way to apply coding, but i'm really novice.
    If you have some comment to add please feel free to. I don't want to bother you.
    Thank your for your concern,

    Kami

  6. Sami Keijonen
    WordPress-asiantuntija
    Theme Author

    Posted 1 year ago #

    Yes that is perfectly fine way to do it.

    But Query Posts should have nothing to do with the get-the-image script.

  7. DaBone
    Member
    Posted 1 year ago #

    Dear Sami. First of all, I think I speak on behalf of everyone that downloads your theme when I say thank you (for the theme)! :)

    Secondly, I'm trying to translate some of the lines within the theme to a different language and I ran across your explanation about the languages parent folder and child folder above.

    However, in my current setup there's only 1 languages folder in wp-content/themes/path/languages and all the files are there (including hybrid-core-en_EN.po and path-en_EN.mo). No child folder. Care to give a bit of more detail on what you meant before ?

    Thanks.

  8. Sami Keijonen
    WordPress-asiantuntija
    Theme Author

    Posted 1 year ago #

    It means that you have to use a child theme and in child theme create languages folder.

    You can download blank child theme in here.

    http://themehybrid.com/themes/path-child

  9. DaBone
    Member
    Posted 1 year ago #

    Ok, great. Where do those folders go ? I assume they must not replace the ones in wp-content/themes/path ..
    And they should be populated with the files inside path (less the translation files that need to be updated in order to get them localized).

  10. Sami Keijonen
    WordPress-asiantuntija
    Theme Author

    Posted 1 year ago #

    No, just install and active child theme. There is already language folder in blank child theme. After that it's in wp-content/themes/path-child/languages. But you need to use FTP program like FileZilla to move language files in server to that folder.

  11. Sami Keijonen
    WordPress-asiantuntija
    Theme Author

    Posted 1 year ago #

    That's how child themes work.

    http://codex.wordpress.org/Child_Themes

  12. DaBone
    Member
    Posted 1 year ago #

    Managed to install and activate the child theme, placed the language files in the child language theme, translated them, still can't get to translate "leave a response" and "read more". Simply can't find them anywhere in those two files.

  13. Sami Keijonen
    WordPress-asiantuntija
    Theme Author

    Posted 1 year ago #

    For example Leave a response can be found in hybrid-core-en_EN.po. Use Edit >> Find.

  14. DaBone
    Member
    Posted 1 year ago #

    Right, line 795. Translated it:

    #: functions/shortcodes.php:234
    msgid "Adauga un comentariu"
    msgstr ""

    Still see "Leave a response". Is there a way to activate/enable the new translation files ? As far as my logic goes, as long as they are in the child theme languages folder and you are using the child-theme (path-child) it should pick it up automatically. Right ?

  15. Sami Keijonen
    WordPress-asiantuntija
    Theme Author

    Posted 1 year ago #

    Yes but you have to have your language settings also in wp-config.php file. Line looks like this.

    define ('WPLANG', '');

    It should look like this (in Finland).

    define ('WPLANG', 'fi');

    So replace your language in fi. And also remember to rename your files, they should be hybrid-core-fi.po and path-fi.po in my language. And when you save those files in poedit, it autocreates .mo files also. Those are the ones that needs to be in child theme language folder.

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic