Needed: default to main language when disabling plugin
qTranslate is a great plugin, I’ve just started using it and i’m pretty sure I will donate soon. Congrats!
[ apologies if this has been posted before. ]
However, I’m quite surprised at the code design choice regarding embedded languages. Currently, for two languages, say “en” and “de”, qTranslate stores two strings, padded by HTML comments as follows:
<!--en:-->text in english<!--:--><!--de:-->Text in german<!--:-->
Which is fine if you have the plugin enabled. However, If you disable the plugin (see reasons for this below), then both languages show. This turns the website into a huge mess, titles having several languages, posts, etc .. everything in multiple languages displayed simultaneously.
qTranslate already sets a default language. It would be better to store the main language text as it does now, but store all other languages in HTML comments, e.g.
<!--en:-->text in english<!--:--><!--de:Text in german:-->
This way, if the plugin is disabled, only the main language is shown and at least the website doesn’t look broken, like a big mess.
Yes, you will have to take care of previously existing HTML comments within the other languages siknce that would break the qTranslate comments, but that can be easily done: you just need to escape existing comments when hiding the language, and unescape them when showing it. if the plugin is disabled, they will remain escaped and the entire language commented.
Reasons for disabling qTranslate (virtually always a temporary state):
– conflict with another plugin that is more critical than qTranslate (suppose an update breaks compatibility)
– a new version of WP is released and you *need* to update (e.g. security reasons or API reasons). Unfortunately, looking at the forums, qTranslate appears to be slow with updating the plugin when a new version of WP is released that breaks compatibility. It recently took a few months.
– etc etc
What do others think about this?
Cheers, and keep up the good work!
- The topic ‘Needed: default to main language when disabling plugin’ is closed to new replies.