This topic has 6 replies, 2 voices, and was last updated 10 years by PeterB.

  • Author
  • #25969
     PeterB
    Participant

    Hi there,

    I a have a WP3.9.2 multisite installation with Buddypress + Buddypress Multilingual + WPML 3.1.6 activated, running kleo-child theme (v1.6.2).
    Translated 2 strings (id 384 and 409) of the file under themes/kleo/languages/en_US.po to sk_SK.po with poedit. Noticed that WPML looks for this file directly in /kleo folder not under /kleo/languages, so the file is copied in /kleo folder as well. WPML does find the sk_SK.mo files for the theme.

    The whole user registration process will get translated just as expected with 1 exception:
    There is a screen just after the user clicks on the email containing the activation link.
    On this screen the text remains english despite being translated in the po and mo files.
    The text is coded in line 16 of the file kleo/buddypress/members/activate.php
    “Your account was activated successfully! You can now log in with the username and password you provided when you signed up.”

    See the attached image.

    It may be a bug or maybe even i can miss something. Can you just help me what should i do to translate this text as well? There must be a way to do it with po/mo files only (I just do not want to use string translation for only this one string…)

    Any help is appreciated!

    Regards,
    Peter

    Attachments:
    You must be logged in to view attached files.
    #25999
     Catalin
    Moderator

    Hello,

    You can copy this file kleo/buddypress/members/activate.php in your child theme folder keeping the same folder structure and modify the text directly in the file.

    Thank you,
    Catalin

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

    Hi Catalin,

    Thanks for the answer!

    Yes, i already tried to change that text directly in the php file (did it in the parent theme) however only temporarly. Had 2 reasons for that:
    1. It would be lost when kleo gets updated. It can be avoided if i do the same in my child-theme as you suggest.

    2. This way however that text would be slovak even if a user registers in english. So that way english users would not understand that text.

    My site is multilingual and more languages will be added later to it.
    Do you think if i modify that string directly in the php of the child theme, it would be translated by WPML? If you are sure sure i will modify it accordingly but it is a production site where i would not like to test.

    This behaviour is really strange as all the other registration-related strings get translated by WPML from other po files. So i just do not understand what is the problem with kleo’s po file.

    Regards,
    Peter

    #26019
     PeterB
    Participant

    I think i will try a dirty solution.
    Will modify members/activate.php in the child-theme like that:
    if (ICL_LANGUAGE_CODE == ‘sk’){
    //here comes the message in slovak
    }
    if (ICL_LANGUAGE_CODE == ‘cs’){
    //here comes the message in czech
    }
    if (ICL_LANGUAGE_CODE == ‘en’){
    //here comes the message in english
    }

    Though the clean solution would be to get the job done by kleo’s po file, i will try the above solution and inform you about the results.

    #26027
     PeterB
    Participant

    Hi Catalin,

    My suggested tweak works. Will do it as a solution for now.
    By the way made some typo with the parenthesis. The right code is:
    if (ICL_LANGUAGE_CODE == sk){
    //here comes the slovak text
    }

    However please try to investigate why the modified po file from kleo does not do the job. That should be the clean and proper way to do it.

    Regards,
    Peter

    #26203
     Catalin
    Moderator

    Hello,

    Sorry for the confusion, now I understand what you mean. That string comes from BuddyPress plugin and can be translated using https://wordpress.org/plugins/codestyling-localization/

    You need to edit the language files for BuddyPress plugin.

    Thank you,
    Catalin

    Thank you,
    Catalin

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

    Hi Catalin,

    Thanks for the answer!
    Meanwhile a had to modify the logic of registration process and the default english text of buddypress does not make sense any more on my site. Found out that I can not modify the original source text in a po file (and newer BP versions will contain the default text in the source code).

    So in my case i have to stay at my dirty solution. After all it works just fine.
    You can mark the topic as solved.

    Regards,
    Peter

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

The topic ‘BP registration string will not translate’ is closed to new replies.

Log in with your credentials

Forgot your details?