Wordpress - Multi-lang WPML
Outlast Framework support multiple languages in its WordPress plugin using WPML.
Setting up multiple languages
To set up multiple languages for your site, you first need to:
- Enable the WPML plugin
- Select the default language for the current content
- Select all the alternate languages you wish to add
- Don’t forget to also add all supported locales to
site/index.php
- Add a language selection logic to your default controller’s __load() method
Then for each language you need to:
- Add the locale to WPML and to
site/index.php
- Select the language at the top of the WordPress admin interface (using the flags)
- Create a home page
- Set the template of the home page
- Localize the menu
- Set up the page in
Settings / Reading / Front page
displays feature to select the home page
Mapping languages to URLs
Two modes of language switching is supported in OFW’s WordPress plugin. You can choose to use a http://customdomain.hu
for each language or you can set up WPML to display languages by query string such as http://mydomain.hu?lang=en
.
Language selection by query string is not currently supported by OFW.
To set this up, choose the proper option in WPML / Languages / Language URL format
.
Setting the WPML language
WPML language is set automatically when you use the $this->zajlib->lang->set()
method. Refer to the documentation on setting and getting the current locale.