Irrelon / jquery-lang-js

i18n Allow instant language switching on HTML pages without reloading the page.
https://www.irrelon.com
362 stars 132 forks source link

Is there any way to use it alongside wordpress? #131

Closed tomasts248 closed 3 years ago

tomasts248 commented 3 years ago

Most likely not but just in case I wonder: the use case in which the client needs the ability to publish content... There are wordpress plugins that add translation, but ideally there could be set dinamically (like wordpress plugins do) but also with static non- changing content as Jquery Lang does

Irrelon commented 3 years ago

Hey again 👍

There are currently no wordpress plugins that I know of to help define and manage the tokens and JSON for each translation.

tomasts248 commented 3 years ago

May I ask if there's a way to use Lang-js with Bogo Wordpress plugin which I am currently testing for translating content with Wordpress. Here's the link : https://wordpress.org/plugins/bogo/ This plugin uses this url format for non default languages: www.website.com/en/page-name/ while hiding the url lang parameter for default language. Also a minor unrelated question, cheked the html example: I do have to create one page per language right?

Irrelon commented 3 years ago

You could write a custom bit of JS to read the current url, extract the two-letter language code and then tell lang-js to switch to that language... but it would sort-of defeat the point of lang-js because the idea is that you can switch languages instantly rather than based on url changes.

I'm not familiar with bogo. Does it let you define tokens and values in a format you could transform to lang-js expected JSON format?