Creating a multilingual site with WPML

26
Anthony Hortin @maddisondesigns maddisondesigns.com 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 of Creating a multilingual site with WPML

Page 1: Creating a multilingual site with WPML

Anthony Hortin @maddisondesigns maddisondesigns.com

Creating a multilingual site with WPML

+

Page 2: 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

Page 3: Creating a multilingual site with WPML

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

Page 4: Creating a multilingual site with WPML

Making your Dashboard Multilingual

Page 5: Creating a multilingual site with WPML
Page 6: Creating a multilingual site with WPML

Changing (Dashboard) languages is now even easier

Page 7: Creating a multilingual site with WPML

Making your theme Translatable

The most basic translation function. Returns the text in the correct language.

__( $text, $domain )(two underscores)

$translated = __( ‘Hello World!’, ‘mytextdomain’ );

Page 8: Creating a multilingual site with WPML

The same as __() except it echoes the text instead of returning the value.

_e( $text, $domain )

_e( ‘Some text to translate and display.’, ‘mytextdomain’ );

Page 9: Creating a multilingual site with WPML

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’ );

Page 10: Creating a multilingual site with WPML

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’ );

Page 11: Creating a multilingual site with WPML

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’ );

Page 12: Creating a multilingual site with WPML

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’ );

Page 13: Creating a multilingual site with WPML

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

Page 14: Creating a multilingual site with WPML

After activating, click Configure to step through the setup process

Page 15: Creating a multilingual site with WPML

Select your primary language

Page 16: Creating a multilingual site with WPML

Select the languages your want to provide on your site

Page 17: Creating a multilingual site with WPML

Set the Language Switcher options

Page 18: Creating a multilingual site with WPML

When editing content, you now have a new Language panel

Page 19: Creating a multilingual site with WPML

Add your content for each of your langauges

Page 20: Creating a multilingual site with WPML

Easily view which pages have been translated

Page 21: Creating a multilingual site with WPML

Easily switch views on the front-end with the language switchers

Page 22: Creating a multilingual site with WPML

Voilà, c'est français! C'est bon!

Page 23: Creating a multilingual site with WPML

You can only switch languages on pages that are translated

Page 24: Creating a multilingual site with WPML

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

Page 25: Creating a multilingual site with WPML
Page 26: Creating a multilingual site with WPML

I’m Anthony Hortin You can find me here

!@maddisondesigns

maddisondesigns.com !

@easywpguide easywpguide.com

!!!!

Questions?