後に 16 何年もの運用と新しいリリースなしで2年以上, 私たちのプラグインは、コード腐敗として知られる広範な課題に遭遇しました. この問題は、外部要因のために、プラグインのコードを変更しなくても、機能性が時間の経過とともに低下すると発生します。. 新しいWordPressリリース, 更新されたPHPバージョン, 翻訳サービスのシフトは、慎重に設計された機能を混乱させる可能性があります.
バージョン 1.0.9.5, これらの課題に取り組みました, 翻訳エンジンに主に焦点を当てています. 時代遅れのコードを削除し、YandexおよびBaidu翻訳サービスのサポートを復元するための新しい実装を導入しました, 近年働くことが停止していました. これらの更新により、翻訳機能が再び完全に動作することが保証されます. さらに, これらの翻訳サービスに時間の経過とともに追加された新しい言語を含めるように言語サポートを拡大しました.
このリリースは、プラグインを信頼できる効果的に保つことへの献身を反映しています, 技術とサービスの進化する風景に適応します.

Standard Flag Emojisを利用する新しいウィジェットを紹介しました, 長年にわたって絵文字セットに組み込まれてきました. この更新により、ウィジェットのコードが大幅に簡素化されます, また、特定のニーズを満たすためにフラグの簡単なカスタマイズを可能にしながら.
この新しいウィジェットが私たちのサイトで動作していることを確認できます, 現在の言語アイコンを他の言語のアイコンの2倍にする巧妙なCSSトリックを追加しました, 次の2行のコードで達成されました!.transposh_flags{font-size:22px}
.tr_active{font-size:44px; float:left}
この新しいバージョンをお楽しみください!
How to translate your meta title and description with transposh!
After some “vibe coding” as they say (people who don’t know how to code but still code with AI) I figured out in a creative way how to translate the meta title and description when using transposh.
As an SEO marketing guy that was something that really bothered me. Translated sites, with English results in google.
So how did I do it.
First I added this php snippet (created by Grok 3)
That translated the meta title for me.
I called it Meta Title and Descritpion in WP Snippet:
add_filter(‘rank_math/frontend/title’, の関数($タイトル) {
グローバル$my_transposh_plugin;
// Controleer of Transposh actief is
もしも (!かどうかの判断($my_transposh_plugin) || !is_object($my_transposh_plugin)) {
return $title;
}
// Haal de huidige taal op
$lang = transposh_get_current_language();
// Vertaal alleen als de taal niet de standaardtaal is
もしも ($長い && !$my_transposh_plugin ->オプション->is_default_language($長い)) {
// Gebruik fetch_translation om de title te vertalen
list(, $translated_title) = $my_transposh_plugin->database->fetch_translation($タイトル, $長い);
もしも ($translated_title) {
$title = $translated_title;
}
}
return $title;
});
add_filter(‘rank_math/frontend/description’, の関数($説明) {
グローバル$my_transposh_plugin;
// Controleer of Transposh actief is
もしも (!かどうかの判断($my_transposh_plugin) || !is_object($my_transposh_plugin)) {
return $description;
}
// Haal de huidige taal op
$lang = transposh_get_current_language();
// Vertaal alleen als de taal niet de standaardtaal is
もしも ($長い && !$my_transposh_plugin ->オプション->is_default_language($長い)) {
// Gebruik fetch_translation om de description te vertalen
list(, $translated_description) = $my_transposh_plugin->database->fetch_translation($説明, $長い);
もしも ($translated_description) {
$description = $translated_description;
}
}
return $description;
});
– After this snippet > The Title was translated, but not the description. After further vibing and reaching a dead-end with Grok i figured that basically the transposh plugin was fetching the translation from the database multiple times.
So i told Grok, hey if we add the meta title and description in the footer (hidden) as text.
And Transposh translates it, if we than pull the description from the database that transposh manages for us wouldn’t it be translated?
And Grok3 confirmed and gave me this snippet (after giving me a compliment for thinking outside the box)
// Voeg de meta title en description toe aan de footer, alleen als de description is ingevuld
add_action(‘wp_footer’, の関数() {
global $post;
もしも (is_singular() && $ポスト) {
$meta_title = get_post_meta($post->IDは, ‘rank_math_title’, 真);
$meta_description = get_post_meta($post->IDは, ‘rank_math_description’, 真);
// Controleer of de meta description is ingevuld
もしも (!empty($meta_description)) {
// Standaard meta title als deze leeg is
もしも (empty($meta_title)) {
$meta_title = get_the_title($post->IDは);
}
?>
document.addEventListener(‘DOMContentLoaded’, の関数() {
var metaElement = document.getElementById(‘transposh-meta’);
もしも (metaElement) {
var translatedText = metaElement.innerText || metaElement.textContent;
// Splits de tekst weer op in title en description (na vertaling)
var parts = translatedText.split(‘ | ');
var translatedDesc = parts[1] || translatedText; // Gebruik description na de |, anders hele tekst
var metaTag = document.querySelector(‘meta[name=”説明”]’);
もしも (metaTag) {
metaTag.setAttribute(‘content’, translatedDesc);
} それ以外 {
var newMeta = document.createElement(‘meta’);
newMeta.name = ‘description’;
newMeta.content = translatedDesc;
document.head.appendChild(newMeta);
}
}
});
<?php
}
}
});
Just note, that I was using Rankmath as my SEO plugin, This maybe will work with Yoast? Or Other plugins, but I am sure if you feed this entire comment to an AI tool of your choice it could fix the correct fields for Yoast and others.
Happy Translating guys and thank you for picking up the support of this plugin after so many years 🙂
One of my top 3 secret weapons for sure!
Sorry I forgot to mention something.
// Voeg de meta title en description toe aan de footer, alleen als de description is ingevuld
If you’d translate this to english it says Add the meta title and description to the footer only if the description is filled in.
The reason why only if it’s filled in is the same reason why I figured this footer trick would work.
If I had a unique meta description for my pages, that was not on the website. It was not translated.
But when I didn’t add a translation at all, and kept it empty, it will pull the top words of the page. So when I only added the first snippet above, it was only translating the title, because the title is also written on the page. but the meta description was unique and nowhere seen on the website.
That’s basically how I figured out if we add an invisible meta description in the footer > we can translate meta titles and descriptions with that first snippet above.
So you need both snippets for it to work.
Or only the first if you never fill in your descriptions anyways. don’t bother.
When I save post, It shows this error:
警告: Undefined array key “b” in \wp-content\plugins\transposh-translation-filter-for-wordpress\core\constants.php on line 1702
I solved it by changing this code on line 1702
もしも ($langrec[‘engines’][$エンジン]) {
に
もしも (かどうかの判断($langrec[‘engines’][$エンジン])) {
ご報告いただきありがとうございます, で修正 https://github.com/oferwald/transposh/commit/70f1a6bafc72a0358b42ada8a576a9f02b5ed136