This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 8 replies, has 2 voices.

Last updated by Diego Pereira 5 months, 3 weeks ago.

Assigned support staff: Diego Pereira.

Author Posts
April 20, 2019 at 3:58 pm #3650599

simonL-47

What would you recommend to get this text translated: "Hi there!

Thank you so much for purchasing a ticket and hope to see you soon at our event. You can edit your information at any time before the event, by visiting the following link:

{ticket_link}

Let us know if you have any questions!"

It's currently in a php file. I could edit the file and add the second language at the bottom but I thought WMPL could help by doing some magic there...
Please advise

Besides, there are a bunch of fields that are not translated in the WooCommerce box office plugin. What do you recommend to address those fields? (see image below, these "should" be in French but they stayed in English)

April 22, 2019 at 3:28 pm #3656667

Diego Pereira
Supporter

Languages: English (English ) Spanish (Español ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello @simonl-47, welcome to the WPML support Forum!

Please try the steps below:
- Make sure you have the Translation Magagement and String Translator extensions active. If not, you can download here: https://wpml.org/account/downloads/
- Go to WPML > Theme and Plugin Localization > Strings in the themes
- Select your theme and click on Scan selected theme for strings
- Go to WPML> String Translation and search for the Strings
- Translate the string, check the Translation is complete field and click on Save.

Ref: https://wpml.org/documentation/getting-started-guide/string-translation/

If you can not find the strings, check it is possible to find it on the Translate texts in admin screen page, like on this link: https://wpml.org/documentation/getting-started-guide/string-translation/#admin_texts

Please let me know if it worked for you.

All the best,
Diego

April 22, 2019 at 11:21 pm #3658751

simonL-47

Hi,

Thank you Diego but this didn't solve the issue as the text wasn't found by WMPL.
The text is located in a PHP file under the plugin directory (wp-content/plugins/woocommerce-box-office/templates/ticket/default-email-content.php).
Please advise!

April 23, 2019 at 2:50 pm #3665015

Diego Pereira
Supporter

Languages: English (English ) Spanish (Español ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hi there,

n order for a text to be translated, it must be in a translatable string, as recommended by WordPress. Please check this link: https://codex.wordpress.org/I18n_for_WordPress_Developers (see "Translatable Strings").

Could you send us a snippet of the code where the string is located? We will take a look.

Kind regards,
Diego

April 23, 2019 at 5:52 pm #3666677

simonL-47

Hi Diego,

Here's the code where the text gets called (this is from class-wc-box-office-assets.php):

$exported_js['defaultEmailContent'] = wc_get_template_html( 'ticket/default-email-content.php', array(), 'woocommerce-box-office', WCBO()->dir . 'templates/' );

and the whole function:
public function admin_enqueue_scripts( $hook = '' ) {
$exported_js = array(
'ajaxurl' => admin_url( 'admin-ajax.php' ),
);

$post_type = get_post_type();
switch ( $post_type ) {
case 'shop_order':
$exported_js['editPostUrl'] = admin_url( 'post.php?action=edit' );
wp_register_script( 'woocommerce-box-office-admin-order', WCBO()->assets_url . 'js/admin-order' . WCBO()->script_suffix . '.js', array( 'jquery' ), WCBO()->_version );
wp_enqueue_script( 'woocommerce-box-office-admin-order' );
wp_localize_script( 'woocommerce-box-office-admin-order', 'wcBoxOfficeParams', $exported_js );
break;
case 'product':
// Export default contents for print and email to JS var.
$exported_js['defaultPrintContent'] = wc_get_template_html( 'ticket/default-print-content.php', array(), 'woocommerce-box-office', WCBO()->dir . 'templates/' );
$exported_js['defaultEmailContent'] = wc_get_template_html( 'ticket/default-email-content.php', array(), 'woocommerce-box-office', WCBO()->dir . 'templates/' );

wp_register_script( 'woocommerce-box-office-admin-product', WCBO()->assets_url . 'js/admin-product' . WCBO()->script_suffix . '.js', array( 'jquery' ), WCBO()->_version );
wp_enqueue_script( 'woocommerce-box-office-admin-product' );
wp_localize_script( 'woocommerce-box-office-admin-product', 'wcBoxOfficeParams', $exported_js );
break;
case 'event_ticket':
break;
}

April 24, 2019 at 8:03 pm #3676559

Diego Pereira
Supporter

Languages: English (English ) Spanish (Español ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hi there,

Sorry, my mistake. This string is variable and defined on the plugin options, it's probably recorded on the wp_options table. In this case, we will need to register the field on the "Translate texts in admin screen page", like on this link: https://wpml.org/documentation/getting-started-guide/string-translation/#admin_texts

After that, the string should be available for translation on WML > String Translator.

If it does not work, please send us access to your WordPress dashboard (website URL, login and password) I'll check and do some tests. - Please use the private field to send the sensitive data - do not post if you do not see it.

It would be better if you give me a test site rather than the live site.

IMPORTANT Please backup a working copy of site files and database before.

Kind regards,
Diego

April 25, 2019 at 4:42 pm #3684577

Diego Pereira
Supporter

Languages: English (English ) Spanish (Español ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello,

I did a search for the "Hi there, thank you so much..." string but did not find it, even on the "Translate texts in admin screens page" (maybe the string is not stored on the wp_options table).

This seems to be a compatibility issue with the "WooCommerce Box Office". In these cases, these are the procedures:
- Install the plugin in a clean installation and reproduce the problem in this new installation. So we can isolate it and do some testing without the interference of server settings or other plugins
- After this, I will check the problem in this new installation and look for a quick solution
- If I can not find a solution, I will forward the problem to our compatibility team
- The compatibility team will do some more testing and will contact the product author to fix the issue

I created a test website with a clean WordPress install. You can access it through this link:
hidden link - Through this link you will be automatically logged in.

Please upload the plugin to this test install, setup it the same way as in your website (using the same options) and create some dummy content to reproduce the issue. Please note that we only need the plugin and the related functionality, you don't need to setup a entire website or clone your existing site.

After that, please send us clear steps on how to see/reproduce the issue on this test install. We will run some tests.

Kind regards,
Diego

May 2, 2019 at 1:59 am #3720513

simonL-47

Sorry, I don't have much time these days but I'd like to get a resolution. Can I get back to you later about this issue even if the ticket is automatically closed?

May 2, 2019 at 1:48 pm #3725107

Diego Pereira
Supporter

Languages: English (English ) Spanish (Español ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hi there,

Yes, you can. However, when the ticket is resolved or closed, it is not displayed in our queue, so we often do not receive the response notification. If the ticket is closed, I recommend creating a new ticket. You can assign directly to any supporter

The other issue is that the test site I created is automatically deleted after 7 days of inactivity - hidden link - I accessed it today, so it was renewed for more 7 days.

Kind regards,
Diego

The topic ‘[Closed] I need to have the WooCommerce Box Office ticket text translated’ is closed to new replies.