Ce diaporama a bien été signalé.
Nous utilisons votre profil LinkedIn et vos données d’activité pour vous proposer des publicités personnalisées et pertinentes. Vous pouvez changer vos préférences de publicités à tout moment.
A11Y? I18N? L10N? UTF8?
WTF?
Understanding the
connections between:
accessibility,
internationalization,
localization,
and...
About me…
Solving the
Unicode
Puzzle:
PHP
Architect,
May 2005
Accessibility ≠ Disability
WCAG Accessibility (A11Y)
Guidelines
1. Perceivable
<img src="smiley.gif" alt="Smiley face">
2. Operable
<input accesskey=...
WCAG Accessibility (A11Y)
Guidelines
1. Perceivable
2. Operable
3. Understandable and Predictable
❖ Guideline 3.1.1 Langua...
The lang attribute
❖ Declare the language of a WordPress theme in
header.php:
<html <?php language_attributes(); ?>>
For a...
Uses of the lang attribute
❖ Improves search engine results
❖ Helps support server content negotiation
❖ Supports spelling...
Language appropriate fonts
Unicode?
Klingon for
Unicode
Before there was Unicode…
Lower ASCII
Before there was Unicode…
Upper ASCII: ISO 8859-1 (aka Latin
1)
Before there was Unicode…
Upper ASCII: ISO 8859-
2
The Unicode slogan
“Unicode provides a unique number for every
character, no matter what the platform, no
matter what the ...
So what is UTF-8?
WordPress supports UTF-8
Learning everyday Japanese with Mangajin
Localization (L10N) and
Internationalization (I18N)
Localization
“Localization refers to the adaptation of a
product, application or document content
to meet the language, cu...
Internationalization
“Internationalization is the design and
development of a product, application or
document content tha...
WordPress provides internationalization
features so you can localize your themes
and plugins
Step 1: use WordPress’ I18N
functions
❖ Wrap all your text in WordPress’ I18N functions, using a
custom “text domain”. Min...
Step 2: generate a POT file
Step 3: load your text domain
❖ For plugins:
load_plugin_textdomain(
'shashin',
false,
dirname(plugin_basename(__FILE__)) ...
Step 3: load your text domain
❖ For themes:
function custom_theme_setup() {
load_theme_textdomain(
'my_theme',
get_templat...
Step 4: include translation
files
Questions?
Further reading
❖ W3C
❖ How to meet WCAG 2.0: quick reference
❖ Why use the language attribute?
❖ Localization vs. Interna...
WordCamp Lancaster 2014: A11Y? I18N? L10N? UTF8? WTF?
Prochain SlideShare
Chargement dans…5
×

WordCamp Lancaster 2014: A11Y? I18N? L10N? UTF8? WTF?

Understanding the connections between accessibility, internationalization, localization, and character sets. Presented at WordCamp Lanaster 2014

  • Identifiez-vous pour voir les commentaires

WordCamp Lancaster 2014: A11Y? I18N? L10N? UTF8? WTF?

  1. 1. A11Y? I18N? L10N? UTF8? WTF? Understanding the connections between: accessibility, internationalization, localization, and character sets Michael Toppa @mtoppa WordCamp Lancaster March 1, 2014
  2. 2. About me…
  3. 3. Solving the Unicode Puzzle: PHP Architect, May 2005
  4. 4. Accessibility ≠ Disability
  5. 5. WCAG Accessibility (A11Y) Guidelines 1. Perceivable <img src="smiley.gif" alt="Smiley face"> 2. Operable <input accesskey="S" type="submit" value="Submit"> 3. Understandable and Predictable <a href="new.html" target="_blank">opens new window</a> 4. Robust and Compatible <label for="first_name">First Name</label>
  6. 6. WCAG Accessibility (A11Y) Guidelines 1. Perceivable 2. Operable 3. Understandable and Predictable ❖ Guideline 3.1.1 Language of Page: ❖ The default human language of each Web page can be programmatically determined. 4. Robust and Compatible
  7. 7. The lang attribute ❖ Declare the language of a WordPress theme in header.php: <html <?php language_attributes(); ?>> For a US English site, this renders as: <html lang="en-US"> ❖ In HTML 5, declare the language of part of a document <div lang="fr">
  8. 8. Uses of the lang attribute ❖ Improves search engine results ❖ Helps support server content negotiation ❖ Supports spelling and grammar checkers ❖ Supports speech synthesizers and automated translators ❖ Allows user-agents to select language appropriate fonts
  9. 9. Language appropriate fonts
  10. 10. Unicode?
  11. 11. Klingon for Unicode
  12. 12. Before there was Unicode… Lower ASCII
  13. 13. Before there was Unicode… Upper ASCII: ISO 8859-1 (aka Latin 1)
  14. 14. Before there was Unicode… Upper ASCII: ISO 8859- 2
  15. 15. The Unicode slogan “Unicode provides a unique number for every character, no matter what the platform, no matter what the program, no matter what the language.”
  16. 16. So what is UTF-8?
  17. 17. WordPress supports UTF-8
  18. 18. Learning everyday Japanese with Mangajin
  19. 19. Localization (L10N) and Internationalization (I18N)
  20. 20. Localization “Localization refers to the adaptation of a product, application or document content to meet the language, cultural and other requirements of a specific target market (a locale).” This often involves more than just translation
  21. 21. Internationalization “Internationalization is the design and development of a product, application or document content that enables easy localization for target audiences that vary in culture, region, or language.”
  22. 22. WordPress provides internationalization features so you can localize your themes and plugins
  23. 23. Step 1: use WordPress’ I18N functions ❖ Wrap all your text in WordPress’ I18N functions, using a custom “text domain”. Mine is “shashin” ❖ $greeting = __( 'Howdy', 'shashin' ); ❖ <li><?php _e( 'Howdy', 'shashin' ); ?></li> ❖ $string = _x( 'Buffalo', 'an animal', 'shashin' ); ❖ $string = _x( 'Buffalo', 'a city in New York', 'shashin' ); ❖ And others…
  24. 24. Step 2: generate a POT file
  25. 25. Step 3: load your text domain ❖ For plugins: load_plugin_textdomain( 'shashin', false, dirname(plugin_basename(__FILE__)) . '/languages/' );
  26. 26. Step 3: load your text domain ❖ For themes: function custom_theme_setup() { load_theme_textdomain( 'my_theme', get_template_directory() . '/languages') ); } add_action('after_setup_theme', 'custom_theme_setup');
  27. 27. Step 4: include translation files
  28. 28. Questions?
  29. 29. Further reading ❖ W3C ❖ How to meet WCAG 2.0: quick reference ❖ Why use the language attribute? ❖ Localization vs. Internationalization ❖ WordPress ❖ How To Localize WordPress Themes and Plugins ❖ I18n for WordPress Developers ❖ Internationalization: You’re probably doing it wrong ❖ Solving the Unicode Puzzle

×