This topic has 23 replies, 2 voices, and was last updated 9 years by Radu.

  • Author
  • #44329
     alkross
    Participant

    Hi, I use child Kleo and code localization plugin
    I set in Kleo child functions.php this code

    add_action( ‘after_setup_theme’, ‘my_child_theme_setup’ );
    function my_child_theme_setup() {
    load_child_theme_textdomain( ‘kleo-child’, get_stylesheet_directory() . ‘/languages’ );

    I create the language pot for the child theme
    I try to translate some string but in the site I saw always the english sentence

    #44341
     Radu
    Moderator

    Try this code

    COPY CODE
    
    function my_child_theme_setup() {
        load_child_theme_textdomain( 'kleo-child', get_stylesheet_directory() . '/languages' );
    }
    add_action( 'after_setup_theme', 'my_child_theme_setup' );
    

    Let me know if it works.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #44407
     alkross
    Participant

    Thanks , but it doesn’t work

    #44577
     Radu
    Moderator

    Make sure that your strings added in the child theme have the kleo-child domain
    Example : __( ‘My Custom Text String’, ‘kleo_child’ )

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #44658
     alkross
    Participant

    The string has ‘buddypress’
    I try to change in kleo_child rescan from localization plugin
    The string appear under kleo-child with the translation but on the front end I see always the english string
    If I set the kleo theme the translation string appears correctly
    Thanks you

    #44670
     Radu
    Moderator

    If the strings belongs ‘buddypress’, you need to translate buddypress plugin.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #44742
     alkross
    Participant

    I’m not sure the problem is to translate buddy press.
    I have the translate Buddypress file set in /wp-content/languages/plugins
    If I set the kleo theme (not child) the string is translated.

    I have the same problem with the string in the modal login pop-up
    “Log in with your credentials” is translated in kleo-child but on the pop-up I have the english text
    Best regards

    Attachments:
    You must be logged in to view attached files.
    #44816
     Radu
    Moderator

    After you translate something, you need press “generate mo file” or you can edit directly php file.

    themes/kleo/page-parts/general-popups.php line 9

    COPY CODE
    <h3 class="kleo-pop-title"><?php _e( "Log in with your credentials", "kleo_framework" ); ?>

    Let me know if you solve this.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #44841
     alkross
    Participant

    I know that I can translate directly the string into the php page.
    I regenerate the mo file
    and the mo file has the correct string as you can see int picture attachment

    Attachments:
    You must be logged in to view attached files.
    #44847
     Radu
    Moderator

    I tested on my site and works well.

    I translated that string without problems.

    If you wand to take a look closer, i need FTP details.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #44871
     alkross
    Participant
    This reply has been set as private.
    #44967
     Radu
    Moderator

    Also i need admin and password from wp, and htaccess username and password.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #44972
     alkross
    Participant
    This reply has been set as private.
    #44985
     Radu
    Moderator

    See screenshot

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    Attachments:
    You must be logged in to view attached files.
    #44987
     alkross
    Participant
    This reply has been set as private.
    #45272
     Radu
    Moderator

    I translated that string via codestyling-localization with no problems.

    Check general-popups.php from kleo-child to see that the string is in english also check the codestyling-localization

    It’s ok now.

    See screenshot

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    Attachments:
    You must be logged in to view attached files.
    #45353
     alkross
    Participant

    Thanks Radu, but was wrong?
    I saw you translated the kleo .mo files and not the child .mo files
    Regards
    Alberto

    #45359
     alkross
    Participant

    Hi Radu, but for the register.php into /kleo-child/buddypress/members
    the localization doesn’t work
    Regards

    #45360
     alkross
    Participant

    In add now I generate the .mo file for the oleo-child, and override the translation in general-popups.php

    #45587
     Radu
    Moderator

    It’s ok now ?

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #45616
     alkross
    Participant

    No:
    I sync the child translation and the original kleo and now the text are in english and I lost the translation.
    The register page take no translation
    I didn’t understand why 🙂
    But wpml plugin will resolve this problem?

    #45787
     Radu
    Moderator

    Hello,

    WPML will not fix this issue, if you lost translations, you need to translate all that strings again and make sure you press generate mo file. It should work !

    Watch at this : https://www.youtube.com/watch?v=QK6yNhQdIiI and search on youtube wordpress codestyling localization

    I hope you will solve this

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #46167
     alkross
    Participant

    I unserstand this:
    If I duplicate a file (for example: general-popups.php)
    No translated strings is kept on kleo-child mo file but the theme use only the main strings file

    #46728
     Radu
    Moderator

    In this case, translate only from kleo, and files that you copy to kleo-child translate them manualy if you encounter this problem. It should work without problems.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
Viewing 24 posts - 1 through 24 (of 24 total)

The forum ‘KLEO’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?