Skip Navigation

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.

Tagged: 

This topic contains 5 replies, has 2 voices.

Last updated by Long Nguyen 1 year, 6 months ago.

Assisted by: Long Nguyen.

Author Posts
June 9, 2023 at 7:37 am #13797329

olegA-5

I also have the following part (classic editor):

<table id="myTable">
<thead>
<tr>
<th>Страна</th>
<th>Подписание</th>
</tr>
</thead>
<tbody>
<tr>
<td>Албания</td>
<td>13.07.1995</td>
</tr>
</tbody>
</table>

In the ATE I don't see "13.07.1995" as requiring translation because it's treated as numbers with some punctuation not to be translated. What rule should I add to wpml-config to have "13.07.1995", i.e. _all_ numbers within table with id="myTable", to be registered for mandatory translation?

Thank you!

June 9, 2023 at 7:52 am #13797433

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi Oleg,

Thank you for contacting WPML support, I'd be happy to help you with this issue.

To translate the numeric value in ATE, please add the following code to the file functions.php in your theme/child theme folder

/**
 * Allow translating numbers
 *
 * @see https://wpml.org/forums/topic/wpbakery-post-grid-element-exclude-from-filter-list-category-reappears
 */
function wpmlsupp_7499_allow_translating_numbers( $is_translatable, $job_translate ) {
    $data = $job_translate['field_data'];
	if ( 'base64' === $job_translate['field_format'] ) {
		$data = base64_decode( $data );
	}
    if ( is_numeric( $data ) ) {
    	return true;
    }
    return $is_translatable;
}
add_filter( 'wpml_tm_job_field_is_translatable', 'wpmlsupp_7499_allow_translating_numbers', 10, 2 );

❌ IMPORTANT: Please backup your database and website before proceeding ❌

Then update the page > Update the translation and search for the number in ATE to translate it, please check this screenshot hidden link

Look forward to your reply.
Thanks

June 9, 2023 at 8:42 am #13797905

olegA-5

Hello again,
It doesn't work for me, at least, by itself.
Again, I'm not looking for a way to _manually search_ (and than translate) the numbers, I need all of them be registered for _mandatory_ translation.
BTW, as I clearly see, it's about base64 encoding, which the WPBakery from the original support ticket uses. But I believe that I don't use this encoding. Moreover, this code definitely requires or specifics, or some additional config rules, or both, since I need only numbers within myTable to be registered for mandatory translation, not all numbers everywhere.
Thank you!

June 12, 2023 at 7:27 am #13806667

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

As I replied in the other ticket https://wpml.org/forums/topic/wpml-config-rule-for-href-within-content-of-a-shortcodes-tag-and-for-numbers/#post-13806661
you need to search for the number and translate it in ATE.

Thanks.

June 15, 2023 at 11:32 am #13831695

olegA-5

Too bad, but thank you for your assistance!

June 16, 2023 at 1:14 am #13835853

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

Feel free to open new tickets if you have any questions. Thanks and have a good day 🙂