I would like to add a custom column that displays the word count for each translation job/task in the table. This would help our translators gauge the size of each task at a glance.
I've tried to find hooks or filters in the WPML documentation that would allow me to add this custom column, but I haven't had any luck so far. Could you guide me on how to achieve this? Is there a specific hook or method within WPML that I can use to add a custom column to the Translation Management table?
Additionally, I would like this custom column to calculate and display the word count for the original content that needs to be translated. Any guidance on this would be greatly appreciated.
Languages: English (English )German (Deutsch )French (Français )
Timezone: Europe/Zagreb (GMT+02:00)
Hi,
Thank you for contacting WPML support!
I'm afraid there isn't a way to achieve this nor officially supported hook. I was able to trace this down to wpml_tm_dashboard_word_count_estimation action within classes\words-count\hooks\wpml-tm-word-count-admin-hooks.php.
Perhaps you can try using this function like this:
function custom_wpml_word_count_estimation($word_count, $post_id, $lang_code) {
// Your custom word count estimation logic goes here
// $word_count is the default word count calculated by WPML
// $post_id is the post ID for which the word count is being estimated
// $lang_code is the language code for the target language
return $custom_word_count;
}
add_action('wpml_tm_dashboard_word_count_estimation', 'custom_wpml_word_count_estimation', 10, 3);
But then you would still need to somehow hook it into the location you are after. I'm afraid not this is officially supported or documented, you can perhaps check with our https://wpml.org/contractors/ to have this solution custom coded.
The topic ‘[Closed] Adding a Custom Column to the Translation Management Table’ is closed to new replies.
Manage Cookie Consent
We use cookies to optimize our website and services. Your consent allows us to process data such as browsing behavior. Not consenting may affect some features.
Functional
Always active
Required for our website to operate and communicate correctly.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
We use these to analyze the statistics of our site. Collected information is completely anonymous.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
These cookies track your browsing to provide ads relevant to you.