Hi,
I use your plugin in French and in the booking form, the State/Province is translated to ‘État/Région’ in the French po file. I would like to change the translation to ‘Province’ so I modified the po file but when I refresh the page, it’s still ‘État/Région’ that is showing. What can I do?
Also, I bought the Business license but realised I would be better with the Developper license. Can I upgrade?
Thanks,
Luc
Luc Gagnon
The .po
file is just the human-readable file for editing translations. From that you would need to create a .mo
file, which is what the plug-in uses for translation. Software like poedit can do that. You would also need to store it, appropriately named in wp-content/languages
to prevent the changes from being lost on an update (see http://docs.wp-event-organiser.com/i18n/ for details).
However, a much better way would be to use the following snippet:
add_action( 'eventorganiser_get_event_booking_form', function( $form, $event_id ){
$labels = array(
'street-address' => __( 'Street Address', 'eventorganiserp' ),
'2nd-line' => __( 'Address Line 2', 'eventorganiserp' ),
'city' => __( 'City', 'eventorganiserp' ),
'state' => __( 'Region/County', 'eventorganiserp' ),
'postcode' => __( 'Postcode', 'eventorganiserp' ),
'country' => __( 'Country', 'eventorganiserp' ),
);
$elements = $form->flatten_elements();
foreach( $elements as $element ){
if( 'address' == $element->type ){
$element->set( 'subfield_labels', $labels );
}
}
}, 10, 2 );
Just change the label values to whatever you want them to be.
Yes, it’s possible to upgrade, I’ll be in touch with a discount code you can use to purchase a developer license.
Stephen Harris
Thanks Stephen. I used poedit to edit the po file and uploaded both the po and mo file to the server but it didn’t change the label for State/Province. Using the snippet you sent did the trick.
Luc
Luc Gagnon