• Resolved carosch

    (@carosch)


    Hello,

    I have a website with french and english.
    I need to use your plugin for the french part, but not for the english part.
    I use WPML to translate the website.

    I try to exclude ID’s, so I add ID name of an english page but that doesn’t work.

    Can you help me ?

    Carosch

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author pepe

    (@pputzer)

    Hello @carosch!

    “ID” means the HTML ID attribute of an element on the page (and this really only works for elements within the post content, not for anything outside added by the theme or a plugin).

    What should work is adding a class to the body element for the English pages and ignoring that in class in the settings.

    Thread Starter carosch

    (@carosch)

    I used “post-5126” from this code:
    <article id="post-5126" class="post-5126 page type-page status-publish hentry">

    you said that’s is not good ?

    I’m sorry, I don’t have a very good english, so I misunderstood somethings perhaps.

    Could you explain me how to do that thing with “adding a class to the body element” ?
    Sorry, I didn’t find where it is.

    carosch

    Plugin Author pepe

    (@pputzer)

    Ah. That would be the correct ID, except that filtering by body ID is not supported. The body classes on the other hand are supported (by some special magic). Filtering by the class post-5126 should work as expected.

    What I meant, though, was adding a class like language-english to the body element via a filter hook. If you don’t know how to code PHP, that’s probably not an option.

    Thread Starter carosch

    (@carosch)

    oh no… why the possibility is given for the ID but that it does not work, it would be necessary to suppress the field and to say that it is necessary to know php to use this plugin on multilingual sites … it is a pity, I wasted a lot of time.
    I do not know how to code in php, I’ll have to remove the plugin and forget the French syntax
    I’m rather bothered by this situation

    Plugin Author pepe

    (@pputzer)

    @carosch: I’m sorry, but it looks like we have got a language issue here.

    Since WordPress by default also adds the post ID (post-<ID>) to the list of body classes, you can use a modified version of your original approach and add that string (post-<ID>) to the list of ignored CSS classes (instead of to the list of ignored IDs). That should work.

    The technical limitations of the “ignore X” feature are explained both on the settings page itself and in the associated help text. That’s simply due to the way the WordPress API works.

    All this aside, why don’t you want to use wp-Typography for the English language pages? There is a rather nice multilingual setting that should take the WPML language into account for each page (regarding quotes, hyphens and the “French punctuation” setting).

    Thread Starter carosch

    (@carosch)

    This is probably because I didn’t understand that we can use the plugin for different languages in the same time.

    In the setting I saw that I can choose the languages for the syntaxe rules, and I assume that if I made a choice, it’s for the entire website…

    If your plugin can apply the french rules to the french pages and the english rules to the english pages, I’ll be the happiest!

    can it ?

    Plugin Author pepe

    (@pputzer)

    @carosch: Yes, it can! Please select Multilingual support, the last checkbox on the General Scope tab. The following settings will be automatically adapted to be language-specific (the rest follows the choices made via the GUI):

    • hyphenation language,
    • diacritics language,
    • dash style,
    • primary quote style,
    • secondary quote style, and
    • French punctuation spacing.

    There are also filter hooks if for some reason you don’t like a setting for a given locale, e.g. the selected quote style can be adjusted via typo_primary_quote_style_for_locale (see API documentation for details).

    Plugin Author pepe

    (@pputzer)

    @carosch Did the option work for your site?

    Thread Starter carosch

    (@carosch)

    Yess!!! it’s Perfect!!

    thank you!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘multilingual website’ is closed to new replies.