creating a multilingual site with wpml
DESCRIPTION
In the presentation I show you how you can make your theme translatable, whilst developing it. I also show you how to create a multilingual WordPress site using the WPML Multilingual plugin, once you've got your site up and running. This was presented at our recent WP Melbourne WordPress Meetup:- http://www.meetup.com/WordPress-Melbourne/TRANSCRIPT
Anthony Hortin @maddisondesigns maddisondesigns.com
Creating a multilingual site with WPML
+
About meDesigner/Developer @ Maddison Designs !WordPress Theme & Plugin Developer !WordPress Theme & Plugin Directory contributor !Provides support on official WordPress Support Forum !Created Easy WP Guide (over 100K downloads) !Co-Organiser Melbourne WordPress WordCamp 2013 !Co-Organiser for monthly WP Melbourne WordPress Meetups
Last month [May 2014], for the first time in history, the non-English downloads of WordPress passed the English downloads. In the future, if we do our job right, the usage of WordPress will democratise publishing. It will resemble every language in the world.
“— Matt Mullenweg
Making your Dashboard Multilingual
Changing (Dashboard) languages is now even easier
Making your theme Translatable
The most basic translation function. Returns the text in the correct language.
__( $text, $domain )(two underscores)
$translated = __( ‘Hello World!’, ‘mytextdomain’ );
The same as __() except it echoes the text instead of returning the value.
_e( $text, $domain )
_e( ‘Some text to translate and display.’, ‘mytextdomain’ );
Return the plural or single form based on the $number
_n( $single, $plural, $number, $domain )
_n( ‘There is a comment’, ‘There are comments’, get_comments_number(), ‘mytextdomain’ );
Used when there’s the chance the text could be found in more than two places, but with different context. Allows you to provide a short description to clarify the text being translated.
_x( $text, $context, $domain )
_x( ‘post link’, ‘A link to the post’, ‘mytextdomain’ ); _x( ‘post link’, ‘Submit a link’, ‘mytextdomain’ );
The same as _x() except it echoes the text instead of returning the value.
_ex( $text, $context, $domain )
_ex( ‘post link’, ‘A link to the post’, ‘mytextdomain’ ); _ex( ‘post link’, ‘Submit a link’, ‘mytextdomain’ );
A hybrid of _n() and _x(). It supports contexts and plurals.
_nx( $single, $plural, $number, $context, $domain )
_nx( ‘A comment!’, ‘Yay! Multiple comments!’, $number, ‘Comments title’, ‘mytextdomain’ );
Making your Content TranslatableWith the WPML plugins, you can… !- provide your content in over 40 languages !- give your site visitors handy tools like ‘language switchers’ !- access powerful translation management tools !- get easy access to professional translators (for a cost) !- make your WooCommerce store multilingual !- translate theme & plugin texts
After activating, click Configure to step through the setup process
Select your primary language
Select the languages your want to provide on your site
Set the Language Switcher options
When editing content, you now have a new Language panel
Add your content for each of your langauges
Easily view which pages have been translated
Easily switch views on the front-end with the language switchers
Voilà, c'est français! C'est bon!
You can only switch languages on pages that are translated
Translating WordPress http://codex.wordpress.org/Translating_WordPress !Official WordPress Translators Team Blog http://make.wordpress.org/polyglots WPML http://wpml.org !WPML Getting Started Guide http://wpml.org/documentation/getting-started-guide !Translating your Theme http://code.tutsplus.com/tutorials/translating-your-theme--wp-25014
Where to Go for Help
I’m Anthony Hortin You can find me here
!@maddisondesigns
maddisondesigns.com !
@easywpguide easywpguide.com
!!!!
Questions?