Forcing translated field names when using translation files with WP-Members™

WP-Members™ stores all of its registration field names and some of the user dialogs in the WordPress database.  If you are installing localized translation files for WP-Members™ on a WordPress installation where you have already activated the WP-Members™ plugin, you will likely find that the translated fields names do not load into the database. 

The plugin, once installed, does not reinstall any database settings.  This is so the plugin installation process not inadvertently overwrite any custom settings that may have been set.

In order to override this and get the translated field names into the database, there is a toggle in the wp-members-install.php file. Follow these steps to make the change and load the translated field names:

  1. In the WordPress Admin Area, go to the Appearance > Editor menu.
  2. In the Editor Panel, look in the upper right of the screen for “Select plugin to edit” and select WP-Members.
  3. Below that, look in the list of Plugin Files for wp-members-install.php.
  4. Near the top of the very first function in this file, wpmem_do_install, look for $chk_force = false; Change this to $chk_force = true;
  5. Save the change by clicking “Update File”
  6. Go to the WP Plugin panel and deactivate/reactivate the plugin.

The field names should now be translated.  I would suggest changing the toggle back to false,  but it isn’t totally necessary.  Also, if you had previously customized any of the plugin’s settings, you may need to double-check your settings.

About Chad

Chad Butler is both a freelance writer and web developer. He has developed several popular WordPress plugins and his writing has appeared on forbes.com, sfomag.com, and investopedia.com.
This entry was posted in WP-Members and tagged , , , . Bookmark the permalink.

Related Posts:

11 Responses to Forcing translated field names when using translation files with WP-Members™

  1. Euclides says:

    Hello, thank you for this excellent open source plugin and for your time.

    I am trying to add a spanish version of th eplugin, I do have the .po file and I do understand this post explanaiton, however, I dont know where to upload the spanish .po file… I am assuming that it should be in the plugin file called “lang” . I did this but nothing has changed, do I need to overwrite the “wp-members.pot” file?

    Thank you in advanced!

    • Chad says:

      Euclides – you need to upload the .mo file. The .po file is the file you would edit, the .mo is the compiled machine code file that the system needs to translate.

  2. Michael says:

    Wouldn’t it be better, to always keep the english fields names in the database and translate them when rendering the HTML?

    For example, changing the line

    $wpmem_themsg = sprintf(__(‘Sorry, %s is a required field.’, ‘wp-members’), $wpmem_fields_rev[$row][1]);

    into

    $wpmem_themsg = sprintf(__(‘Sorry, %s is a required field.’, ‘wp-members’), __($wpmem_fields_rev[$row][1]));

    Or is there any problem with this approach?

  3. Amir says:

    This is not working even for me (I changed $chk_force to true, deactivated and activated), it loads the same english fields. I tried to change from the db manually the values but it wasn’t a good idea.
    I uploaded the .mo in /wp-content/plugins/wp-members/lang and then even in wp-content/languages

    Any solutions?

    • Chad says:

      Is the .mo file named appropriately (for example, in Spanish, they should be wp-members-es_ES.mo)?
      Is the rest of the site translated in the same language and working in that language?

      • Amir says:

        Ok, it was because I had Kau-Boy’s Backend Localization on.
        Solved! Thank you for the help.

        • dan says:

          Amir, thanks. I was going crazy trying to figure out why the steps given didn’t work.

          For anyone else having the same problem, I deactivated the “Admin in English” plugin, then followed the steps given by Chad above, reset the flag to “false” (just to be safe), and then reactivated the “Admin in English” plugin and everything seems to work great.

  4. HansRuedi says:

    NOT «go to the Appearance > Editor menu», go to Plug-ins…

  5. AhmidBalaze says:

    I just can´t find the wp-members-install.php file from the plugins list. I´ve just found wp-eMember/eMember_installer.php wich seems to me to be incorrect.

    I really need to change the language registration fields to spanish for my latino customers.

    I´m not much into php so I get lost easily

    Thanks in advance

Leave a Reply

Comments are welcome.
Your email address will not be published.
Required fields are marked *.
Please consider the following before posting your comment:

  • Comments are moderated, so your comment may not show up right away. Submit only once!
  • Keep things on topic. If you comment is not relevant to the specific post, it will be deleted.
  • NO soliciting of services is allowed! These comments will be deleted and the user banned.
  • If you are asking for support, please consider looking for the answer in the Quick Start Guide, the Users Guide, and the FAQs first.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>