• Resolved strarsis

    (@strarsis)


    On a WordPress installation Polylang plugin is used for multiple languages.
    wp-typography plugin got two options that are language-specific,
    language used for server-side hyphenation and type of smart dash (USA and International type).

    How can these languages automatically adjusted when a page of specific language is viewed (Polylang switched)? How can I realize a Polylang/WPML/multilanguage plugin integration?

    Thanks!

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

    (@pputzer)

    There is an open GitHub ticket for multilingual support. The API allows for injecting arbitrary Settings objects since version 4.0.0, but so far no one has taken up the challenge.

    Hm… could be two languages selected at once for hyphenation for a bilingual website?

    Plugin Author pepe

    (@pputzer)

    Not via the GUI. I’m not sure manually setting anthing but the default language via the Settings page is feasible from a UI standpoint. Any suggestions for a good user interface?

    pepe, I suggest to look to select2 (multiple selection with tags), where languages will be tags, from Multiple select boxes with labels example https://select2.github.io/examples.html

    Plugin Author pepe

    (@pputzer)

    Thanks for the suggestion. It might work for the common case, if we find a clever algorithm for mapping WordPress language codes to the pre-selected list of candidate languages. However, there will be edge cases like when you want to have two related languages (e.g. medieval Latin and classical Latin) that can’t be differentiated by their ISO code.

    WPML have option for custom languages mapping, user-created locale. For example, I did not liked zh-TW locale name for Traditional Chinese, since I did not wanted /zh-TW/ language prefix for that version on a client website. I needed cn for /cn/. So I defined it in WPML, works very well.

    Also, when it comes to WPML, it has a handy wpml-config.xml, from which you can read language configuration for website.

    Clever algorithm will have to walk through available languages and offer user-defined locales if needed with full instruction, but this is further future. The closest step with maximum usefulness might be WPML compatibility (checkbox in UI – if checked, wpml-config.xml is read and options taken from it). Its multilingual standard de-facto for WordPress commercial websites, where much content reside.

    Plugin Author pepe

    (@pputzer)

    Reading an XML file on every request is probably not so performant. I think users with custom needs like that should probably add a MU plugin to make the necessary adjustments via filters rather than the GUI.

    Plugin Author pepe

    (@pputzer)

    I’m closing this here. The feature request is noted, but further discussion should happen on GitHub.

    Plugin Author pepe

    (@pputzer)

    A quick update: A first implementation of automatic language handling will be in wp-Typography 5.0. It will provide filter hooks if full customization is desired.

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Adjust language/Polylang’ is closed to new replies.