not-only-code / qtranslate-slug

Adds support for permalink translations and fix some Qtranslate deficiencies since wordpress 3.0
http://wordpress.org/extend/plugins/qtranslate-slug
46 stars 31 forks source link

do not add a (non prefixed) two letters language code to the body css classes #126

Open aoloe opened 7 years ago

aoloe commented 7 years ago

at

https://github.com/not-only-code/qtranslate-slug/blob/trunk/includes/class-qtranslate-slug.php#L572

the current language is added as a two letters language code to the body classes.

this clashes

most (if not all) qtranslate-slug's css classes are prefixed with qts_ and i would suggest that the prefix should also be used for the language in the body classes:

        $classes[] = 'qts_'.call_user_func($this->get_plugin_prefix() . 'getLanguage');

or even better

        $classes[] = 'qts_lang_'.call_user_func($this->get_plugin_prefix() . 'getLanguage');

sadly, i could not find out where the value is being used and cannot create a correct pull request (but my supposition is that the value is never used... and the filter could simply be removed).

in my local copy i've patched the code as suggested above and i will try to see if anything breaks.

LC43 commented 7 years ago

hi @aoloe , yes, thats a good suggestion! i have to see if it breaks other sites that could rely on this