Support » Plugin: Sublanguage » Newbie using Sublanguage

  • Resolved ecabral

    (@ecabral)


    [DISCLAIMER: I’m not a developer, just a common WP user with basic coding skills.]

    Hi,

    I’ve been playing around with Sublanguage and am wondering whether I got this tool right.

    This is what I need:

    – the ability to translate a few of my custom post types –> DONE!
    – the ability to make the theme switch to the language of the translated custom post –> how do I get this to work??
    – to provide the user the option to switch language on the front end (this would be a nice to have feature) –> how do I get this to work??

    Can I do this out-of-the box with Sublanguage or is this tool meant for developers to build on it?

    I haven’t been able to get Sublanguage to work for me. I manage to translate the posts + the permalinks, but then I get a 404 when opening the translated URLs. I never get to see the translated content.

    And, how do menus really work? What custom URL do I need to add to each language item added to the menu?

    If you can point me to any documentation that covers this that would be appreciated!

    Thanks!

    Eva

Viewing 10 replies - 1 through 10 (of 10 total)
  • Can I do this out-of-the box with Sublanguage or is this tool meant for developers to build on it?

    Let’s face it: Sublanguage was created especially for developers to build custom things with it, because plugins like WPML have a lot of frustrating things for developers when integratnig. So if you’re using a commercial theme with a lot of plugins and you don’t want to put your hands dirty into code, you’d probably better pick WPML or a popular multi-language plugin. The reason why you would pick Sublanguage is you want a better control over things and you’re not afraid of extra work.

    – the ability to make the theme switch to the language of the translated custom post –> how do I get this to work??

    You mean you want to integrate a language switch into your theme? Check right below…

    – to provide the user the option to switch language on the front end (this would be a nice to have feature) –> how do I get this to work??

    The easiest way is to go into appearance>menu (or customizer), select the menu where you want to put language links into, and create a custom link and name it “language” (and just set anything for url), and repeat for every language. Sublanguage will automatically substitute the “language” links with relevant languages links based on configured languages.

    I haven’t been able to get Sublanguage to work for me. I manage to translate the posts + the permalinks, but then I get a 404 when opening the translated URLs. I never get to see the translated content.

    Sounds like a problem with permalinks: just go into settings>permalink a click “save” button without changing anything (it will regenerate permlinks).

    Hope it helps.

    Hi @max345,

    Thanks for your reply!

    Sounds like a problem with permalinks: just go into settings>permalink a click “save” button without changing anything (it will regenerate permlinks).

    I spent the last 30 minutes doing just this, saving permalinks, then going back to the content, saving, refreshing, saving permalinks again, and this is not working. I managed once to make one of the translated articles/permalinks show (no clue how as I didn’t do anything different!), but that one is not even showing anymore. Out of 4 languages, I can only view the permalink/web page of the original article, not of the translated ones (404, page not found). :-((

    • This reply was modified 1 year, 2 months ago by ecabral.

    Ok maybe there is a conflict with theme or plugin. What theme and what plugins are you using?

    On the translated pages when you have a 404 error, does the url look ok? It should be yoursite.com/xx/custom-post-type-name/translated-page-name (where xx is the language slug).

    Theme – http://eris-shop.tkdemos.com/

    Plugins – I disabled all but the following, or else the content wouldn’t show up as I’m using custom post types (portfolio):

    – Eris Shop Custom Post Types
    – Sublanguage
    – WP Staging Pro (this is a staging site)

    With all other plugins disabled I still get a 404 with the translated permalinks. The structure of the URLs looks good, e.g.:

    mysite.com/staging/en/portfolio/portfolio-item-english-title
    mysite.com/staging/fr/portfolio/portfolio-item-french-title

    Thanks for the help!

    Since both plugins and theme aren’t free, I can’t do much… I think you should rather ask their authors for support, especially if you have pro account. Since Sublanguage is free they can easily download it and check if it isn’t compatible with their stuff and why. I’d start with WP Staging Pro.

    I did some more testing: this time I disabled Eris Shop Custom Post Types and WP Staging Pro too (as well as all other plugins), created an Article (not a custom post type), translated it, edited the URLs and all works here as intended. Meaning, I can both view the content and the live URLs.

    After enabling Eris Shop Custom Post Types I cannot view the translated Article URLs anymore (404).

    I then disabled Eris Shop Custom Post Types plugin only and I can view the URLs again.

    So, the issue seems to be with Eris Shop Custom Post Types. I’ll contact the plugin author.

    Thanks a lot, @max345!

    • This reply was modified 1 year, 2 months ago by ecabral.

    A possible culprit may be that the url rewrite rules generation process (aka “flushing”) happens on front-end. Sublanguage’s rules will never regenerate on front-end, because it’s a very expensive process (especially with multi-languages). Thus pushing this process on front-end is expected to cause the problems you’re experiencing.

    Hi @max345,

    how can the dev of Eris Shop Custom Post Types contact you?

    He can contact me by email: support@sublanguage-plugin.com
    or of course directly on this forum

    Thank you!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Newbie using Sublanguage’ is closed to new replies.