Setelah 16 Bertahun -tahun beroperasi dan lebih dari dua tahun tanpa rilis baru, Plugin kami menghadapi tantangan luas yang dikenal sebagai pembusukan kode. Masalah ini muncul ketika fungsionalitas menurun dari waktu ke waktu - bahkan tanpa perubahan pada kode plugin - cocok untuk faktor eksternal. Rilis WordPress Baru, Versi PHP yang diperbarui, dan pergeseran dalam layanan terjemahan dapat mengganggu fitur yang dirancang dengan cermat.
Dalam versi 1.0.9.5, Kami telah menangani tantangan ini, dengan fokus utama pada mesin terjemahan. Kami menghapus kode yang sudah ketinggalan zaman dan memperkenalkan implementasi baru untuk mengembalikan dukungan untuk layanan terjemahan Yandex dan Baidu, yang berhenti bekerja dalam beberapa tahun terakhir. Pembaruan ini memastikan bahwa fitur terjemahan beroperasi penuh sekali lagi. Selain itu, Kami telah memperluas dukungan bahasa untuk memasukkan bahasa baru yang ditambahkan ke layanan terjemahan ini dari waktu ke waktu.
Rilis ini mencerminkan dedikasi kami untuk menjaga plugin yang andal dan efektif, beradaptasi dengan lanskap teknologi dan layanan yang berkembang.

Kami telah memperkenalkan widget baru yang memanfaatkan emoji bendera standar, yang telah dimasukkan ke dalam emoji yang ditetapkan selama bertahun -tahun. Pembaruan ini menyederhanakan kode widget secara signifikan, sementara juga memungkinkan kustomisasi bendera yang mudah untuk memenuhi kebutuhan spesifik Anda.
Anda dapat memeriksa widget baru ini beraksi di situs kami, Di mana kami telah menambahkan trik CSS pintar yang membuat ikon bahasa saat ini dua kali lebih besar dari yang lain, dicapai hanya dengan dua baris kode berikut!.transposh_flags{font-size:22px}
.tr_active{font-size:44px; float:left}
Kami harap Anda menikmati versi baru ini!
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:
tambahkan_filter(‘rank_math/frontend/title’, fungsi($judul) {
global $my_transposh_plugin;
// Controleer of Transposh actief is
jika (!isset($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
jika ($panjang && !$my_transposh_plugin->pilihan->is_default_language($panjang)) {
// Gebruik fetch_translation om de title te vertalen
list(, $translated_title) = $my_transposh_plugin->database->fetch_translation($judul, $panjang);
jika ($translated_title) {
$title = $translated_title;
}
}
return $title;
});
tambahkan_filter(‘rank_math/frontend/description’, fungsi($deskripsi) {
global $my_transposh_plugin;
// Controleer of Transposh actief is
jika (!isset($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
jika ($panjang && !$my_transposh_plugin->pilihan->is_default_language($panjang)) {
// Gebruik fetch_translation om de description te vertalen
list(, $translated_description) = $my_transposh_plugin->database->fetch_translation($deskripsi, $panjang);
jika ($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’, fungsi() {
global $post;
jika (is_singular() && $post) {
$meta_title = get_post_meta($post->ID, ‘rank_math_title’, true);
$meta_description = get_post_meta($post->ID, ‘rank_math_description’, true);
// Controleer of de meta description is ingevuld
jika (!empty($meta_description)) {
// Standaard meta title als deze leeg is
jika (empty($meta_title)) {
$meta_title = get_the_title($post->ID);
}
?>
document.addEventListener(‘DOMContentLoaded’, fungsi() {
var metaElement = document.getElementById(‘transposh-meta’);
jika (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=”deskripsi”]');
jika (metaTag) {
metaTag.setAttribute(‘content’, translatedDesc);
} lain {
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:
Peringatan: 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
jika ($langrec[‘engines’][$mesin]) {
ke
jika (isset($langrec[‘engines’][$mesin])) {
Terima kasih telah melaporkan ini, tetap di https://github.com/oferwald/transposh/commit/70f1a6bafc72a0358b42ada8a576a9f02b5ed136