[Plugin: Events Manager] "Send your booking" French translation not working
-
Sorry to post so much but it makes more sense to me to keep issues separate. In this case I see that the string displayed on the submit button of the booking form *has* a French translation in the lang files but it’s not working for some reason. Is it perhaps because the file/line reference is wrong? It seems to me like it should be em-bookings.php:54. I just installed Poedit, something new to learn, any help would be appreciated.
-
you can customized that in the options page at Settings > Booking Options > Booking Form Options > Submit button text
Is there a way to make it read from the lang files so that it’s translated into the current language?
it should read it as French if your first installation of EM was done whilst WPLANG was set to FR_fr, did it not?
Are you referring to how it appears in the admin panel? I’m referring to how it appears on the front end.
another way is editing template file templates\placeholders\bookingform.php at around line 77
Using template files
http://wp-events-plugin.com/documentation/using-template-files/The lang file is used only on installation of the plugin, it translates the default option and inserts it into the db. That’s why it’s not used.
Here’s an idea, for all the options you want translating, hook into the get_option_ hook in WP, so e.g.
function em_translation_function($string){ return __($string,'dbem'); } add_filter('get_option_optionnameshouldgohere', 'em_translation_function');
for each option, just repeat the add_filter… line. If you get that working, Please paste the list of filters 🙂
It’s actually
add_filter('option_optionnameshouldgohere', 'em_translation_function');
This will only work for hard coded strings, right? For example,'dbem_list_date_title' => __('Events', 'dbem').' - #j #M #y',
would be pointless to run through em_translation_function?yes, this won’t work on some instances
the eventual plan is to have multiple boxes in settings, one for each language, but this will take some time
Here’s a huge pile of em. I didn’t do a lot of cleanup, I basically ran through the install script looking for __(XX, ‘dbem’) calls that looked promising, perhaps there’s a better way to find the relevant ones.
function em_translation_function($string){ return __($string,'dbem'); } // EM Free add_filter('option_dbem_bookings_submit_button', 'em_translation_function'); add_filter('option_dbem_bookings_form_msg_disabled', 'em_translation_function'); add_filter('option_dbem_bookings_form_msg_closed', 'em_translation_function'); add_filter('option_dbem_bookings_form_msg_full', 'em_translation_function'); add_filter('option_dbem_bookings_form_msg_attending', 'em_translation_function'); add_filter('option_dbem_bookings_form_msg_bookings_link', 'em_translation_function'); add_filter('option_dbem_booking_warning_cancel', 'em_translation_function'); add_filter('option_dbem_booking_feedback_cancelled', 'em_translation_function'); add_filter('option_dbem_booking_feedback_pending', 'em_translation_function'); add_filter('option_dbem_booking_feedback', 'em_translation_function'); add_filter('option_dbem_booking_feedback_full', 'em_translation_function'); add_filter('option_dbem_booking_feedback_log_in', 'em_translation_function'); add_filter('option_dbem_booking_feedback_nomail', 'em_translation_function'); add_filter('option_dbem_booking_feedback_error', 'em_translation_function'); add_filter('option_dbem_booking_feedback_email_exists', 'em_translation_function'); add_filter('option_dbem_booking_feedback_new_user', 'em_translation_function'); add_filter('option_dbem_booking_feedback_reg_error', 'em_translation_function'); add_filter('option_dbem_booking_feedback_already_booked', 'em_translation_function'); add_filter('option_dbem_booking_feedback_min_space', 'em_translation_function'); add_filter('option_dbem_bookings_contact_email_subject', 'em_translation_function'); add_filter('option_dbem_contactperson_email_cancelled_subject', 'em_translation_function'); add_filter('option_dbem_bookings_email_pending_subject', 'em_translation_function'); add_filter('option_dbem_bookings_email_rejected_subject', 'em_translation_function'); add_filter('option_dbem_bookings_email_confirmed_subject', 'em_translation_function'); add_filter('option_dbem_bookings_email_cancelled_subject', 'em_translation_function'); add_filter('option_dbem_bookings_my_title_format', 'em_translation_function'); add_filter('option_dbem_locations_page_title', 'em_translation_function'); add_filter('option_dbem_categories_page_title', 'em_translation_function'); add_filter('option_dbem_events_form_result_success', 'em_translation_function'); add_filter('option_dbem_events_anonymous_result_success', 'em_translation_function'); add_filter('option_dbem_event_submitted_email_subject', 'em_translation_function'); add_filter('option_dbem_event_approved_email_subject', 'em_translation_function'); add_filter('option_dbem_events_page_title', 'em_translation_function'); add_filter('option_dbem_no_events_message', 'em_translation_function'); add_filter('option_dbem_no_locations_message', 'em_translation_function'); add_filter('option_dbem_location_no_events_message', 'em_translation_function'); add_filter('option_dbem_no_categories_message', 'em_translation_function'); add_filter('option_dbem_category_no_events_message', 'em_translation_function'); add_filter('option_dbem_tag_no_events_message', 'em_translation_function'); add_filter('option_dbem_event_approved_email_subject', 'em_translation_function'); add_filter('option_dbem_display_calendar_events_limit_msg', 'em_translation_function'); // EM Pro add_filter('option_em_booking_form_error_required', 'em_translation_function'); add_filter('option_dbem_gateway_label', 'em_translation_function'); add_filter('option_em_paypal_booking_feedback', 'em_translation_function'); add_filter('option_em_paypal_booking_feedback_free', 'em_translation_function'); add_filter('option_em_paypal_booking_feedback_thanks', 'em_translation_function'); add_filter('option_em_offline_option_name', 'em_translation_function'); add_filter('option_em_offline_booking_feedback', 'em_translation_function'); add_filter('option_em_offline_option_name', 'em_translation_function'); add_filter('option_em_offline_button', 'em_translation_function'); add_filter('option_em_authorize_aim_option_name', 'em_translation_function'); add_filter('option_em_authorize_aim_booking_feedback', 'em_translation_function'); add_filter('option_em_authorize_aim_booking_feedback_free', 'em_translation_function');
thanks for that. I’d think this’d be the best way to go about it. All the translated options would be in the em-install.php file.
- The topic ‘[Plugin: Events Manager] "Send your booking" French translation not working’ is closed to new replies.