10 common mistakes wordpress developers make when building multilingual sites

25
10 common mistakes WordPress developers make when building multilingual sites

Upload: agnes-bury

Post on 13-Dec-2014

1.028 views

Category:

Software


1 download

DESCRIPTION

most common mistakes done in multilingual sites created with WordPress, examples and good practices included

TRANSCRIPT

Page 1: 10 common mistakes WordPress developers make when building multilingual sites

10 common mistakes WordPress developers makewhen building multilingual sites

Page 2: 10 common mistakes WordPress developers make when building multilingual sites

Agnes Bury

present● community specialist at

OnTheGoSystems

● responsible for WPML showcase

● WordPress blogger

past● WordPress freelancer

Page 3: 10 common mistakes WordPress developers make when building multilingual sites

Agenda

1. Common mistakesa. description, real life

examplesb. disadvantagesc. how to do it right and

how you benefit2. Experience exchange3. Prizes for winners

Prizes for active attendees● one WPML license

WordPress Multilingual Plugin

● two Toolset licenses

Toolset Plugins Let You Develop WordPress Sites Without PHP

more at wp-types.com

Page 4: 10 common mistakes WordPress developers make when building multilingual sites

Is this site multilingual?

Source: niromusic.com

Page 5: 10 common mistakes WordPress developers make when building multilingual sites

1. Not inserting a language switcher

Possible reasons1. Oops. I did

forgot. 2. There is a

language switcher, you just didn’t notice it.

3. I don’t need a language switcher

source: http://foto-factory.com/

Page 6: 10 common mistakes WordPress developers make when building multilingual sites

Browser language based redirection

If you rely on redirection instead of using a language switcher● your site might not get

indexed● you may irritate your users● if not all pages have

translations, users might feel lost

● users might not realise that the site in available in other languages

Page 7: 10 common mistakes WordPress developers make when building multilingual sites

How to do it right?

● Insert your language switcher for each page

● Make sure it stands out● Cross link all your pages● If you want to redirect

your visitors, do it right:○ use js and cookies

approach○ do it only if a

translation exists

source: destibationvarsovie.com

Page 8: 10 common mistakes WordPress developers make when building multilingual sites

Redirections done right

Page 9: 10 common mistakes WordPress developers make when building multilingual sites

2. Using automated translations

Why people use automated translations1. This the easiest way (not

recommended!)2. They don’t think about

search engines3. They don’t know how to

find professional translators

source: jamespaulphotography.co.uk

Page 10: 10 common mistakes WordPress developers make when building multilingual sites

2. Using automated translations

Disadvantages● poor quality content● translations might not

get indexed

How to do it right● keep each page

translated on a separate URL

● always provide good quality translations made by a human

Source: http://googlewebmastercentral.blogspot.com/2010/03/working-with-multilingual-websites.html

Page 11: 10 common mistakes WordPress developers make when building multilingual sites

3. Mixing languages on the same page

The reasons users mix languages1. they don’t know how to

translate specific elements

2. their multilingual plugin does not support translation of all elements

3. they don’t think about search engines

source:http://kjjdentaloffice.co.il/

Page 12: 10 common mistakes WordPress developers make when building multilingual sites

4. Not translating media

Common mistakes● ignoring titles

and alts● all media titles

and alts in the site main language

● uploading the same image for each language

source: http://oneferro.com source: http://ricette.donnaecasa.com

Page 13: 10 common mistakes WordPress developers make when building multilingual sites

4. Media translation: how to do it right

● upload your image once

● provide its alternative text and title for each language

Page 14: 10 common mistakes WordPress developers make when building multilingual sites

5. Not translating widgets

Common mistakes● all sidebar strings in site

main language● language “mix” in titles● side by side translation

source: fotomarathon.desource: oneferro.com

Page 15: 10 common mistakes WordPress developers make when building multilingual sites

5. Not translating widgets

Make your widgets translation ready● WordPress default

widgets will appear in WPML String translation

● custom widgets coded correctly (apply_filters for widget_title and widget_text) will appear in String translation

● use Widget Logic plugin for all other cases

using Widget Logic plugin

using WPML panel

Page 16: 10 common mistakes WordPress developers make when building multilingual sites

6. Not translating theme dependant stringsFrequently skipped strings● ‘posted in’● ‘category’● ‘Error 404 - page not

found’● ‘no comments’● ‘read more’● strings coming from

your theme options

Source: http://www.eliplay.eu/nl/blog/

Page 17: 10 common mistakes WordPress developers make when building multilingual sites

How to translate theme strings● using .po/.mo files and

GetText editors● from the WPML panel

Page 18: 10 common mistakes WordPress developers make when building multilingual sites

How to translate theme options● use wp_options and

wpml-config.xml● check your theme in our

Compatibility program

Page 19: 10 common mistakes WordPress developers make when building multilingual sites

7. Hard coding language dependent strings● Bad<?php echo ‘Error 404: Page not found’; ?>

<input type=”button” name=”buy-button” value=”Buy now!” />

● Good<?php _e(‘Error 404: Page not found’, ‘my-textdomain’) ?>

<input type=”button” name=”buy-button” value=”<?php esc_attr_e(‘Buy now!’, ‘my-textdomain’) ?>” />

source: www.studying-in-england.org

Page 20: 10 common mistakes WordPress developers make when building multilingual sites

i18n and what to internationalize ● Basic strings _e, __● Variables printf(__( 'Your

city is %s.', 'my-theme' ),$city);

● Plurals _n, _n_noop● Context _x● Handling JavaScript files

wp_localize_script()● Escaping strings

esc_html_e() esc_attr_e()● Date and number functions

number_format_i18n(), date_i18n()

Source: https://make.wordpress.org/docs/plugin-developer-handbook/15-internationalization/

Page 21: 10 common mistakes WordPress developers make when building multilingual sites

8. Ignoring non-techie users’ needs● can you copy from the

original?● can you change your

admin language?● how about menu

synchronization?● how easy will you add

another language?● turn ordinary users into

translators

Page 22: 10 common mistakes WordPress developers make when building multilingual sites

9. Ignoring eCommerce trends

source: http://trends.builtwith.com/shop/

Page 23: 10 common mistakes WordPress developers make when building multilingual sites

WooCommerce Multilingual plugin● The number of WP

eCommerce shops is rapidly growing

● check ahead if your multilingual plugin supports eCommerce

● don’t discourage your customers with an untranslated checkout process

Page 24: 10 common mistakes WordPress developers make when building multilingual sites

10. Ignoring WordPress compatibility● Don’t let new

WordPress releases be a surprise for your multilingual site

● Make sure your multilingual plugin is kept up to date with WordPress releases

Page 25: 10 common mistakes WordPress developers make when building multilingual sites

What would you add? Discussion