Fix Google Language Translator Plugin Changing Letter Case After Translation

Google Language Translator plugin changes the letter case after translation

If you do not want to spend time on translating a site, WordPress has many automatic options, including the Google Language Translator plugin (by Translate AI Multilingual Solutions). It is simple and does not require any special skills. But you may notice strange behavior: after translation some words change their letter case, for example menu items that start with a capital letter become lowercase. The plugin also sometimes translates numbers, which is wrong for counters.

Problem: The Google Language Translator plugin changes uppercase letters to lowercase after translation.

Solution: I do not know the reason for this behavior, but I noticed it only in inline elements (<a>, <span> and so on). Block-level elements are translated fine. So there are three steps.

1. Replace inline elements with block-level ones where you can, for example <span> with <p>. If the markup cannot be changed, do it in CSS with display: block or display: inline-block.

2. Make the first letter uppercase with CSS. This is useful for navigation menu items:

.menu a {
    display: inline-block;
}

.menu a::first-letter {
    text-transform: uppercase;
}

::first-letter works only on block and inline-block elements, so the display rule is needed here anyway.

3. Add the notranslate class to elements that must not be translated: counters, prices, phone numbers, brand names.

<span class="notranslate">1 250</span>

That’s all. Good luck!

NOTE: notranslate is a class of Google Translate itself, so it also protects the element when a visitor translates the page in the browser. The HTML attribute translate="no" does the same.