qtranslate / qtranslate-xt

qTranslate-XT (eXTended) - reviving qTranslate-X multilingual plugin for WordPress. A new community-driven plugin soon. Built-in modules for WooCommerce, ACF, slugs and others.
GNU General Public License v2.0
546 stars 103 forks source link

wrong translate value of %LANG #1309

Closed artarik closed 1 year ago

artarik commented 1 year ago

i create a simple post with text: [:en] this is a simple text in english which can not be showing in other languages [:]

If a change a language on site i see a text like this

RU: Извините, этот текст доступен только в Американский Английский
DE: Leider ist der Eintrag nur auf Amerikanisches Englisch verfügbar.
FR: Désolé, cet article est seulement disponible en Anglais Américain
ES: Ci spiace, ma questo articolo è disponibile soltanto in Inglese Americano

But i want to see only language without country like this

RU: Извините, этот текст доступен только в Английский
DE: Leider ist der Eintrag nur auf Englisch verfügbar.
FR: Désolé, cet article est seulement disponible en Anglais
ES: Ci spiace, ma questo articolo è disponibile soltanto in Inglese

how can i do it? i tested in wordpress 6.2 and plugin version 3.14.0

herrvigg commented 1 year ago

It's confusing but the language name field is not used for that. The reason is qTranslate looks for the translation of the name in the current language as you also show here with the 4 descriptions, so we need more translations.

The name is retrieved from the locale defined for that language, using the MO/PO files defined in qTranslate. The default locale for English is en_US as English American so the message is consistent with this logic. If you switch to en_GB you would get "Britisches Englisch".

But I understand this is not so great from a user experience, though the content is effectively in en_US or en_GB that display you don't necessarily want to give the details of the locale at this level if there's a single "English" version. I found it annoying myself.

So it's not strictly a bug, this is the current behavior working as expected, but I change this issue to new feature request.

herrvigg commented 1 year ago

You can actually try to set the locale to en and it would be displayed as just "Englisch" (DE). But I don't know well what to expect for some other parts. Can you try this and see how it behaves? We don't store the locale in the ML tokens, only the language code, so it should not be a problem to do some experiments and move back to en_US if something goes wrong.

artarik commented 1 year ago

yes, changing locale to en solve this

herrvigg commented 1 year ago

I close this for now as it can be solved with the locale. If there's a real need for a new feature we'll come back to it later. There are other topics that are more urgent.