Editing
Multilingual WordPress Sites
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Overview== Information about setting up multilingual support for WordPress sites. ==WPML WordPress plugin== [http://wpml.org/|The WordPress Multilingual Plugin] ===Installation=== ====WordPress "Installer" plugin==== There is a page on the site that describes using the "Installer" WP plugin to install WPML components. The Installer plugin allows you to install paid plugins, as they cannot be hosted by WordPress.org. The Installer plugin did not work when installed on my development server. It needs to search "repositories" which should be loaded by default. Even when I manually entered the WPML repository it did not load. ====Installing on local development server==== It's also possible to download the WPML components as zip files from the WPML website. Each component gets unzipped into the WP plugins directory. After the files are installed, return to the WP admin, click on "Plugins" and activate the component. ===Settings=== * WordPress Dashboard > WPML (left column) > Languages ** "Add/Remove languages" button to add the necessary languages ** Language URL format:<br />Different languages in directories (e.g. http://thousandoaks.dbarchowsky.com/es/) ** Blog posts to display: All posts (display translation if it exists or posts in default language otherwise) ===Translating posts and pages=== Once the WPML CMS component is installed, activated, and configured, a column is added to the Posts and Pages listings pages. If the page has not been translated then a "plus" sign will appear in the column. Clicking on the plus sign will lead to a page where a translated version of the page can be entered. There is an option in the WPML settings that controls what happens if a page has not been translated. The two options boil down to either throw a 404 error or show the post in the default language. If a page should remain untranslated even when viewed via the non-default language:<br />(E.g. the "Calendar and Events" page on the Thousand Oaks site.) * WordPress Dashboard > Pages > The Page > Click the "translate" icon * In the "Language" module click the "Copy content from English" button. * Click "Publish". * After the page reloads, click the "Overwrite with English content" button in the Language module.<br />This will keep the content of the page on the non-default language in sync with any edits made to the page in its default language. ===Translating themes=== See [http://wpml.org/2009/05/wordpress-theme-localization/|WordPress theme localization] ====Thousand Oaks==== Existing set of theme files edited to support the two languages. Spot edits to existing files to check the current language, inserting language-appropriate paths and links. <syntaxhighlight lang="php"> <%php if (ICL_LANGUAGE_CODE=="en"): %> <li><a href="http://mysite.com/">English link</a></li> <%php if (ICL_LANGUAGE_CODE=="es"): %> <li><a href="http://mysite.com/es/">Spanish link</a></li> <%php else: %> <li>I don't know what language it is!</li> <%php endif; %> </syntaxhighlight> ==Examples== * [http://thousandoaks.dbarchowsky.com/_cms/wp-admin/|Thousand Oaks staging server (dashboard)] * [http://thousandoaks.dbarchowsky.com/|Thousand Oaks staging server (front-end)] [[Category:WordPress]][[Category: Web_Development]]
Summary:
Please note that all contributions to Littledamien Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Littledamien Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information