• Resolved Rick Curran

    (@rickcurran)


    Hi, I’m working on a site that is an English / Thai language site, I’m using the Loco Translate plugin to deal with translations on the site.

    I’ve made profile-builder-th.po and profile-builder-th.mo files (along the lines of these instructions: https://www.cozmoslabs.com/docs/profile-builder-2/translate-profile-builder/#Manually_update_your_translation_files) so I’ve got the language files correctly in the /wp-content/languages/plugins folder. I’ve only translated a handful of strings to far as I’m only using Profile Builder for a custom Account page with Username, Email, Password and Repeat Password fields. I’ve translated all those strings and also the “Minimum length of X characters.” string, however, only that last one and the ‘Update’ on the button is actually showing translated when I switch the language of the site.

    Screenshots:
    English
    Thai

    I’ve checked the .po file and I can definitely see the translated strings in there. Can you think of any reason this could be happening?

Viewing 10 replies - 1 through 10 (of 10 total)
  • Hi Rick,

    If you remove the translation files completely do the translations go away?

    Please test this in order to make sure that the already translated strings are not coming from somewhere else.

    If when you remove the files, the few translations are gone, then it means that it certainly comes from your files.

    Next, an advice is that when you make changes to the .po file always recompile the .mp file. Perhaps you forgot to do that?

    Best regards,
    Gabriel

    Thread Starter Rick Curran

    (@rickcurran)

    Thanks Gabriel, I’ve tried removing the translation files and the translations do go away so they are definitely coming from those files. I have also recompiled the .mo file as well.

    Hi Rick,

    Another thing to try.

    Please:

    1) make sure that you are using the latest version of our plugin (3.0.1)
    2) update your .po file with the latest .pot file.
    3) make sure that the translations are still as they should be.
    4) recompile the .mo file.

    You see, sometimes changes are made to the strings inside the plugin, and those changes are always automatically reflected in the .pot file, but then they need to be manually imported into the .po file.

    Best regards,
    Gabriel

    Thread Starter Rick Curran

    (@rickcurran)

    Hi, thanks for the suggestion. I’d previously done those steps but I’ve gone back through them again just to triple check ??

    I’m definitely running the latest Profile Builder 3.0.1 and I’ve done steps 2, 3 and 4 but I’m still only getting a couple of translated strings through.

    Hi Rick,

    Oh, all right! Sorry, now I know what’s happening.

    Those are not static strings, and so can not be translated from the .po/.mo files.

    Those are dynamic strings. See that you can change those titles from Dash -> PB -> Form Fields.

    So what this means is that you can use something like the WPML String Translations or our own TranslatePress plugin.

    You see, as I understand it, Loco Translate is not intended to be a multilingual plugin, but is intended to help you localize, translate your website into 1 language.

    With the best of wishes,
    Gabriel

    Thread Starter Rick Curran

    (@rickcurran)

    Hi Gabriel, thanks, I’d seen that those fields are all in the “Form Fields” section so I thought there must be some relevance to the issue here.

    However, I’m confused as these strings do appear to get translated in your plugins code don’t they? Are you saying that whatever language these form fields are set / using will not get changed even for people using the standard translations you supply with Profile Builder?

    Hi Rick,

    Yes, since the field title strings are dynamic, it does not matter that they appear in the .po file, they do not get translated at all.

    To be honest I don’t know why they show up in the translation file. Perhaps they show up as static strings somewhere. In fact — that’s quite certainly the case.

    With the best of regards,
    Gabriel

    Thread Starter Rick Curran

    (@rickcurran)

    Ah, ok. That’s unfortunate. I’m not sure what to do now as I really need to be able to translate these names as well. Would there be any way I could programmatically override these in my own code?

    Thread Starter Rick Curran

    (@rickcurran)

    Ah yep, I can confirm that these field title strings are in the database so they don’t get translated.

    My only choice in this instance was just add the translations for the four field titles using language-specific CSS, I added ‘after’ pseudo-elements onto the form labels that the titles appear in (Username, E-mail, Password, Repeat Password) and using content: 'Thai text here' to put the text in place, making the original text colour transparent so it doesn’t show.

    A bit of a hack but the only way to do it for now.

    Not urgent on my part any more but a feature request would be to see if these strings can be pulled out of the database and passed in as string instead, I’m not 100% sure why these have to be in the database at the moment but it does mean that this plugin can’t be 100% language switched on the fly.

    Hi Rick,

    All right then, glad to hear. Thanks for letting us know.

    We are going to take note of this feature request.

    With the best of regards,
    Gabriel

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Strings not shown for custom Thai translation’ is closed to new replies.