qtranslate-slug icon indicating copy to clipboard operation
qtranslate-slug copied to clipboard

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

Open aoloe opened this issue 8 years ago • 1 comments

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

  • for the french language with the woocommerce "standard" theme canvas theme (as already reported in #74)
  • for the farsi language with fontawesome (see https://github.com/qTranslate-Team/qtranslate-x/issues/344)

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.

aoloe avatar Nov 28 '16 15:11 aoloe

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

LC43 avatar Dec 06 '16 00:12 LC43