1

I'm planning on creating a plugin that fixes the translation issues of a specific theme. This theme is already translated into multiple languages but the translation is horrible. I don't know how to start here or what is the best approach so please give me your suggestions.

I'm thinking, creating a page option where I have one field of two inputs, in one you add the incorrect text (example "holo") and the second input you add the correct translation (example "hola"). I can have the user add as many fields as needed. Then I use the gettext filter to switch all the cases that the user added.

Problem.. Will gettext pick up the translation strings added in Spanish or French where the original pot file is in English? My test says it does, but I want to confirm.

Also, is this going to cause performance issues when people add 30 string?

  • Editing the po mo files is not an option,

    The theme is not free,

    I don't want to use plugins (I want to build one),

    And it's for multiple users correcting multiple languages;

What do you guys think? Any suggestions?

Thank you.

  • to correct translation, it's better to create a new ".mo" file. then you load it before the file of the theme and then it will have the priority for the strings in the file. for other strings, the 2nd and default file will be used. – mmm Dec 5 '17 at 12:58
  • Thanks but I'm trying to avoid editing the po and mo files because you need to move those to a child theme and when the theme updates a string, the user will still have the old translation and will not get the new strings (coming from new theme features for example) – mrKC.988 Dec 5 '17 at 13:00
  • 1
    If it's a theme on the .org repo users can contribute translations at translate.wordpress.org, and if you need to do translations manually for a single install there are plugin's like that available, like this one: wordpress.org/plugins/say-what – Jacob Peattie Dec 5 '17 at 13:03
  • thanks, I want to build the plugin to be used by different people. this doesn't concern one installation. – mrKC.988 Dec 5 '17 at 13:30
  • You should work careful. The filter hook gettext is often fired and also fast an performance issue. – bueltge Dec 6 '17 at 15:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.