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 10 replies, has 2 voices.

Last updated by Marcos Vinicios Barreto 1 month, 2 weeks ago.

Assigned support staff: Marcos Vinicios Barreto.

Author Posts
August 28, 2019 at 6:40 pm

wirathipT

I am trying to: i need to translate my shortcode.but i could see in english and i could not see in thai language

Link to a page where the issue can be seen:hidden link

I expected to see:hidden link

Instead, I got:

August 28, 2019 at 7:10 pm #4476671

wirathipT

HI Can u guide me ??? please its urgent. shortcode not showing in thai page

August 28, 2019 at 7:15 pm #4476683

Marcos Vinicios Barreto
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

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

Hello,

Thank you for contacting WPML Support. I took a look at both pages I see exactly the same content, on the Thai version everything seems to be properly translated expect the text 'You are already registered' is the issue you need to fix? Please, let me know, so we can proceed with a detailed investigation, have a nice day.

August 28, 2019 at 7:36 pm #4476715

wirathipT

HI,
please open login page in in-cognito mode. when u open hidden link url , you can see mobile input field by clicking phone tab.

But this page is translated to thai, hidden link, when i click phone i could not see mobile field section

August 28, 2019 at 7:52 pm #4476731

wirathipT

do you get my issues which i am enquiring???

August 28, 2019 at 8:03 pm #4476765

Marcos Vinicios Barreto
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

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

Hello,

Thank you for the updates. I see for the the 'Phone' tab has this shortcode '[wc_gqsize_reg_form]' inserted as the content of this tab. How this shortcode is generated? I took a detailed look in your WordPress Dashboard settings and didn't find the settings that generates it? Is it translated? I mean, is there a translated version of this shortcode? I assume it only exists in the default language and this could be the possible reason why you don't see it in your translated 'Phone' tab.

In any case, these additional details will help me to determine how the shortcode is generated and this way understand the whole issue. Thank you for your collaboration and continued patience, have a nice day.

August 28, 2019 at 8:11 pm #4476775

wirathipT

I have added as shortcode in functions.php .

add_shortcode( 'wc_gqsize_reg_form', 'gqsize_separate_registration_form' );

function gqsize_separate_registration_form() {
if ( is_admin() ) return;
if ( is_user_logged_in() ) return;
ob_start();

?>
<form method="post" class="woocommerce-form woocommerce-form-register register" <?php do_action( 'woocommerce_register_form_tag' ); ?> >

<?php do_action( 'woocommerce_register_form_start' ); ?>

<?php if ( 'no' === get_option( 'woocommerce_registration_generate_username' ) ) : ?>

<p class="woocommerce-form-row woocommerce-form-row--wide form-row form-row-wide">
<label for="reg_username"><?php esc_html_e( 'Username', 'woocommerce' ); ?> <span class="required">*</span></label>
<input type="text" class="woocommerce-Input woocommerce-Input--text input-text" name="username" id="reg_username" autocomplete="username" value="<?php echo ( ! empty( $_POST['username'] ) ) ? esc_attr( wp_unslash( $_POST['username'] ) ) : ''; ?>" /><?php // @codingStandardsIgnoreLine ?>
</p>

<?php endif; ?>

<p class="woocommerce-form-row woocommerce-form-row--wide form-row form-row-wide">
<label for="reg_email"><?php esc_html_e( 'Email address', 'woocommerce' ); ?> <span class="required">*</span></label>
<input type="email" class="woocommerce-Input woocommerce-Input--text input-text" name="email" id="reg_email" autocomplete="email" value="<?php echo ( ! empty( $_POST['email'] ) ) ? esc_attr( wp_unslash( $_POST['email'] ) ) : ''; ?>" /><?php // @codingStandardsIgnoreLine ?>
</p>

<?php if ( 'no' === get_option( 'woocommerce_registration_generate_password' ) ) : ?>

<p class="woocommerce-form-row woocommerce-form-row--wide form-row form-row-wide">
<label for="reg_password"><?php esc_html_e( 'Password', 'woocommerce' ); ?> <span class="required">*</span></label>
<input type="password" class="woocommerce-Input woocommerce-Input--text input-text" name="password" id="reg_password" autocomplete="new-password" />
</p>

<?php else : ?>

<?php endif; ?>

<?php do_action( 'woocommerce_register_form' ); ?>

<p class="woocommerce-form-row form-row">
<?php wp_nonce_field( 'woocommerce-register', 'woocommerce-register-nonce' ); ?>
<button type="submit" class="woocommerce-Button button" name="register" value="<?php esc_attr_e( 'CREATE AN ACCOUNT', 'woocommerce' ); ?>"><?php esc_html_e( 'CREATE AN ACCOUNT', 'woocommerce' ); ?></button>
</p>

<?php do_action( 'woocommerce_register_form_end' ); ?>

</form>

<?php

return ob_get_clean();
}

DO i miss anything???Please help me sort the issue?

August 28, 2019 at 8:12 pm #4476779

wirathipT

i dint not translate to any language. DO i need to do any thing additionally?

August 28, 2019 at 8:37 pm #4476855

Marcos Vinicios Barreto
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

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

Hello,

Thank you for the updates. It is somewhat complex to debug as your code doesn't seem to be affected by the settings in your WordPress Dashboard, although it is kinda of a custom code work, something out of our support scope, I am still happy and able to give a detailed look in your custom code, testing it in a local environment and making some debug efforts to provide you with an answer on the cause of the issue. For that, please, consider:

To best troubleshoot the issue, please make a snapshot of your site using the Duplicator plugin: https://wordpress.org/plugins/duplicator/. This will allow me to try and duplicate the error so that I can run further tests without interrupting your live site.

Once the snapshot is complete, either upload the snapshot ZIP file and the installer.php file to a file sharing service such as Dropbox (and share the link in your reply) or right click the Duplicator links in your wp-admin and paste in your reply.
Please note: It is important to reduce the size of the package so please exclude some paths like /cache or /uploads and also exclude archives and media files.I will also need the username and password of an account that was created BEFORE creating the duplicator package.I will enable the next reply to be private so only you and I have access to it!

Thank you for your collaboration. Have a nice day.

September 3, 2019 at 1:37 pm
September 4, 2019 at 1:50 pm #4511511

wirathipT

HI ,
U der?

September 4, 2019 at 2:23 pm #4511995

Marcos Vinicios Barreto
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

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

Hello,

Thank you for the updates. I took a detailed look in your website using the provided test environment and confirmed your custom shortcode 'wc_gqsize_reg_form' in all the languages as you can confirm at:

English: hidden link
Thai: hidden link

I've even created a test page with the custom shortcode 'wc_gqsize_reg_form' as the only content and you can see it works in both languages at:

English: hidden link
Thai: hidden link

The tests above confirms your issue doesn't come from WPML usage, instead it is related to your settings, also, please bear in mind as per our support policies we are not able to provide support for custom code as you can read at: https://wpml.org/purchase/support-policy/

Here is the workflow I followed to get your custom shortcode working in both languages:

1 - I duplicated your 'Sign up' page to the Thai language and then I chose to edit it using the default WordPress page/post editor and saved it.

2 - I created a new test page called 'WPML Test' and then I duplicated it to the Thai language and edited it with the default WordPress page/post editor and saved it.

See: https://wpml.org/documentation/translating-your-contents/using-different-translation-editors-for-different-pages/

Hope it brigs some clarifications regarding these issues. Thank you for your understanding, have a nice day.