Best Multi Vendor Marketplace Plugin for WordPress › Forums › WCFM – Ultimate › Language translation missing
- This topic has 4 replies, 2 voices, and was last updated 8 years, 2 months ago by
WCFM Forum.
- AuthorPosts
- August 23, 2018 at 9:12 am #29324
Flore
GuestHi again,
I found a translation missing.
When I create a new woocommerce bookings product :
In Disponibility tab : Bookable “NO” “YES”.Waiting for, I add it to my own language file 😉
I add this in my child theme waiting for a correction :
add_filter( ‘resource_manager_fields_availability’, function($ressource_availability){
//Modify the text because it is not translatable
$ressource_availability[‘_wc_booking_availability_rules’][‘options’][‘bookable’][‘options’] = array( ‘no’ => __(‘Non’, ‘les2frangines’), ‘yes’ => __(‘Oui’, ‘les2frangines’) );return $ressource_availability;
}, 20, 1);
Thank you for your work,
Your extensions are powerful !Flore
- August 23, 2018 at 9:14 am #29328
Flore
GuestI forget to mention the file where translation are missing, if I can help :
wc-frontend-manager-ultimate\core\class-wcfmu-wcbookings.php
in the select boxes, the ‘YES’ and ‘NO’ choices are not translatables. - August 23, 2018 at 9:16 am #29329
WCFM Forum
MemberHi,
Kindly use this to add translation for this –
function wcfm_custom_translate_text( $translated ) { $translated = str_ireplace( 'no', 'no', $translated ); $translated = str_ireplace( 'yes', 'yes', $translated ); $translated = str_ireplace( 'NO', 'no', $translated ); $translated = str_ireplace( 'YES', 'yes', $translated ); return $translated; } add_filter('gettext', 'wcfm_custom_translate_text'); add_filter('ngettext', 'wcfm_custom_translate_text');Add your translated string at 2nd parameter for “str_ireplace” function.
Thank You
- August 23, 2018 at 9:33 am #29332
Flore
GuestThank you ! Nice to know.
- August 23, 2018 at 9:42 am #29333
WCFM Forum
MemberYou are welcome 🙂
- AuthorPosts
- The topic ‘Language translation missing’ is closed to new replies.

