• Resolved wesoli

    (@wesoli)


    Hello

    I am helping translate a client site to German. All the built in form fields translate 100%. However, the custom fields don’t. I’ve added the strings I want to translate by
    1/ Going to WPML -> String Translation -> Translate texts in admin screens
    2/ Adding the fields that I want translated
    3/ Translated the new fields visible in the “admin_texts_um_fields” Domain under String Translation.

    The custom strings never display correctly when viewing the pages in German. For example, if a custom field is used in Member Directory filter. The Country dropdown translates 100%. The custom field remains in English.

    I had the same issue with The Events Calendar plugin and they have a workaround:
    https://wpml.org/errata/the-events-calendar-admin-texts-do-not-translate/
    Basically you paste this code in the functions.php file:
    add_filter(‘tribe_get_single_option’, ‘tribe_options_multilingual’, 20, 3);

    function tribe_options_multilingual( $option, $default, $option_name ) {
    	if (is_string($option)) {
    		return apply_filters( 'wpml_translate_single_string', $option, 'admin_texts_tribe_events_calendar_options', '[tribe_events_calendar_options]' . $option_name);
    	} else {
    		return $option;
    	}
    }

    I tried something similar for Ultimate Member, but I didn’t succeed. Do you have a similar function I could use?

    Thank you for your time.

    Regards
    Wesley

Viewing 1 replies (of 1 total)
  • Thread Starter wesoli

    (@wesoli)

    There is a work around. From what I managed to debug all custom fields fall under the “ultimate-member” text domain when they are generated on the fly to be displayed.

    The steps are as follows:
    1/ Navigate to: WPML -> String Translation
    2/ Scroll to the bottom of the page and look for the title “Auto register strings for translation”
    3/ Check the box “Look for strings while pages are rendered”. There will be a performance impact warning and a 2 hours countdown incase you forget this option checked.
    4/ There is a button that appears underneath the checkbox. If you select it a popup window appears and you can limit which text domain is scanned. You’re looking for “ultimate-member”. Selecting only “ultimate-member” reduces the performance impact.
    5/ Now open your website and navigate to the pages where the text is that you want to translate. In my case I needed to load the page where I had a member directory shortcode and a filter that used a custom field.
    6/ Once you’re done return to step (3) and uncheck the checkbox.
    7/ Refresh the String Translation page.
    8/You can now either search for the strings you want translated or select “ultimate-member” from the “Select strings within domain” dropdown menu. I have 2 ultimate-member options in the list for some reason. My new strings appeared under the option with the highest number. Eg. “ultimate-member (1814)”
    9/ Translate your new strings and you should be good to go.

    This method seems to apply to other plugins too.

    These steps are from the following post:
    https://wpml.org/forums/topic/ultimate-member-directory-confused-in-what-field-label-to-pull-with-same-meta-ke-2/#post-5157161

    However, I did not need to edit the Ultimate Member plugin as suggested.

Viewing 1 replies (of 1 total)
  • The topic ‘WPML admin_texts_um_fields not translating’ is closed to new replies.