• Resolved RogerRogers

    (@rogerrogers)


    Just started working with Polylang, nice plugin!

    One feature that is pretty common for site localization is the ability to have the language code included in all URLs (e.g. /en/page-name). For Polylang this approach is only used where there is a potential canonical naming conflict, such as the Archives section. For posts and pages Polylang requires the post/page permalink to be unique, thus enforcing a canonical site.

    The problem is that even though post/page URLs are unique, they do not show the language in the URL, which is sometimes a desirable feature.

    A few questions:
    – Is this a feature that could be easily achieved by creating a Custom Structure permalink?
    – If not, is this a feature that is planned for Polylang?

    Thanks!

    RogR

    http://wordpress.org/extend/plugins/polylang/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Chouby

    (@chouby)

    I don’t believe there is a simple way to do this without writing a plugin. It is in fact necessary to modify WordPress rewrite rules and filter links. This is what I do for archives.

    Except when migrating from another plugin which is working this way (such as WPML as discussed here), I wonder why it would be a needed feature.

    In my opinion, there is a huge drawback. If, for some reason, the plugin is deactivated, almost all urls would be broken. (Note that it’s already the case for archives but there is no other choice and this is not as important as for posts or pages).

    Unlike some other plugins, if you deactivate Polylang, your blog will go on working as smoothly as possible.

    It was one of the most important requirement I imposed to myself when starting to write this plugin.

    Thread Starter RogerRogers

    (@rogerrogers)

    I agree that there would be some issues with hard coded URLs breaking if the plug-in is deactivated. I imagine some of this could be resolved by nofollow rules and maintaining both URLs. The issue is that the language indicator in the URL is often useful.

    Regardless, your plugin is really nice and I appreciate your reply!

    RogR

    Plugin Author Chouby

    (@chouby)

    Although I still do not recommend it when setting up a new site, Polylang 0.7 now includes the feature ! Hope it helps.

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

The topic ‘[Plugin: Polylang] Keep language code in all URLs’ is closed to new replies.