Jump to content

Retrofitting a running Processwire Website to Multi-Language


Recommended Posts

I built a ProcessWire website with the beginner's profile a couple of months ago.

At that point a multi-language version was not required.

Client requirements changed and they now want to retrofit the running site with all content to support multiple languages.

We are talking about 17 existing pages.

What would be the best way to handle this?  

Link to comment
Share on other sites

If you have most of the content in the templates, and not harcoded in the template files, it's not that difficult. Roughly, this is what you should do. Install the language modules that are present at the core and convert the text and textarea fields to the correspondent multilanguage fieldtypes. Create the new languages, and edit the homepage urls to reflect this change (in the settings tab). If all goes well, in the template files you'll just need to create the language switcher. If you have some hardcoded content on the PHP you can either create fields to accomodate it and distribute by the templates where it makes sense, or you can create a dedicated page for them, or you can even take advantage of internationalisation by using the function __(), like this: echo __("Something"). This will allow you to translate it in the admin, on the languages pages.

For all this, go through the language docs https://processwire.com/api/multi-language-support/

  • Like 2
Link to comment
Share on other sites

Thanks for your detailed answer, diogo.

I mainly wrote functions for each content section organized in an external php-file for each template.

I then call the required function within the respective template location. 

There might be a couple of hardcoded titles and headings, but the majority of content is dynamic.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...