S                 INTERNATIONALIZING                  YOUR APPLICATION                          by Renan GonçalvesSunday, ...
WHO IS THIS GUY?                   Software Engineer                          TrueServer B.V.                   CakePHP si...
LOCALIZATION                   Adapting or converting the application to be used on                   a particular locale ...
LOCALE                          language[_territory][.charset][@modifier]                   en                   en_US     ...
LOCALE                          en_GB     en_GB@oed                en_CA                   en_US                      anal...
INTERNATIONALIZATION                   Supporting international data                          Text Content                ...
LANGUAGE                   Different systems of numerals                          decimal (10), vigesimal (20), octogesima...
WRITING CONVENTIONS                   Date/time format                          Different calendars                   Time...
CULTURESunday, September 4, 11
CULTURE                   Images and colors                   Telephone numbers                   Currency                ...
OTHERS                   National variants of languages                   Local content                   Order of sorting...
WHY CARE?             World, 7 billion.             China, 1.3 billion. US, 312 million. Brazil, 190 million. UK, 62 milli...
OKAY, LETS RULE THE WORLD                SUPPORT ALL LOCALES!Sunday, September 4, 11
NOT THAT EASY!                   Countries in the world (249)                   Languages in the world (6,309)            ...
FEEL AT HOME                   Small changes, big impactSunday, September 4, 11
PERSONAL NAMES                          AROUND THE WORLD                   Björk Guðmundsdóttir (Icelandic)               ...
PERSONAL NAMES                          AROUND THE WORLD               First name        Middle name                      ...
PERSONAL NAMES                          AROUND THE WORLD                Full name                Renan Gonçalves Cardoso d...
PERSONAL NAMES                          AROUND THE WORLD                   Björk Guðmundsdóttir (Icelandic)               ...
HOW?Sunday, September 4, 11
PROBLEMS                   The context can change                   Hard to find exactly what you want                   Ha...
PLURAL                            https://developer.mozilla.org/en/Localization_and_PluralsSunday, September 4, 11
CAKEPHP WAY                   Using i18n and L10n libraries                   Using Translate BehaviorSunday, September 4,...
I18N                          Others functions: __d(), __dn(), __dc(), __dcn(), __c()                                     ...
I18N                   $ cake i18n extract                          Locale/default.pot                               #: Fi...
POEDITSunday, September 4, 11
I18NSunday, September 4, 11
TRANSLATE BEHAVIORSunday, September 4, 11
TRANSLATE BEHAVIORSunday, September 4, 11
L10N                   Manage the locales                   Identify the localeSunday, September 4, 11
L10N                   Request                          HTTP_ACCEPT_LANGUAGE                          IP to country (GeoIP...
GOODIES                   Localized plugin                          Localized validation                   https://github....
TROUBLESHOOTING                   Right encoding                          unicode                          html metatag   ...
QUESTIONS?Sunday, September 4, 11
THANK YOU!                   renan.saddam@cakephp.org                   @renan_saddam on twitter and #cakephp             ...
Upcoming SlideShare
Loading in …5
×

Internationalizing your application

2,203 views
2,137 views

Published on

Talk presented at CakeFest 2011, in Manchester-UK.

Published in: Technology, Business
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,203
On SlideShare
0
From Embeds
0
Number of Embeds
6
Actions
Shares
0
Downloads
13
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Also know as L10n (L+10 letters+n)\nAlso defines any particular preferences (ie. region, monetary values, etc)\n
  • Also know as L10n (L+10 letters+n)\nAlso defines any particular preferences (ie. region, monetary values, etc)\n
  • Also know as L10n (L+10 letters+n)\nAlso defines any particular preferences (ie. region, monetary values, etc)\n
  • Also know as L10n (L+10 letters+n)\nAlso defines any particular preferences (ie. region, monetary values, etc)\n
  • CE stands for Ceara\n- an state in brazil\n- slangs\n
  • OED stands for Oxford English Dictionary spelling\n
  • \n
  • Vigesimal: French (from Celtic), Danish\nOctogesimal: Supyire (spoken in Mali, Africa)\nRight to left: Persian, Hebrew, etc\n
  • Vigesimal: French (from Celtic), Danish\nOctogesimal: Supyire (spoken in Mali, Africa)\nRight to left: Persian, Hebrew, etc\n
  • Vigesimal: French (from Celtic), Danish\nOctogesimal: Supyire (spoken in Mali, Africa)\nRight to left: Persian, Hebrew, etc\n
  • Vigesimal: French (from Celtic), Danish\nOctogesimal: Supyire (spoken in Mali, Africa)\nRight to left: Persian, Hebrew, etc\n
  • Vigesimal: French (from Celtic), Danish\nOctogesimal: Supyire (spoken in Mali, Africa)\nRight to left: Persian, Hebrew, etc\n
  • Vigesimal: French (from Celtic), Danish\nOctogesimal: Supyire (spoken in Mali, Africa)\nRight to left: Persian, Hebrew, etc\n
  • Date format: Day/Month/Year, Month/Day/Year\nDifferent calendars: Chinese calendar, starts late January or early February\nDifference in symbols: “ (double-quotes) for English, « (guillemets) in French\n
  • Date format: Day/Month/Year, Month/Day/Year\nDifferent calendars: Chinese calendar, starts late January or early February\nDifference in symbols: “ (double-quotes) for English, « (guillemets) in French\n
  • Date format: Day/Month/Year, Month/Day/Year\nDifferent calendars: Chinese calendar, starts late January or early February\nDifference in symbols: “ (double-quotes) for English, « (guillemets) in French\n
  • Date format: Day/Month/Year, Month/Day/Year\nDifferent calendars: Chinese calendar, starts late January or early February\nDifference in symbols: “ (double-quotes) for English, « (guillemets) in French\n
  • Date format: Day/Month/Year, Month/Day/Year\nDifferent calendars: Chinese calendar, starts late January or early February\nDifference in symbols: “ (double-quotes) for English, « (guillemets) in French\n
  • \n
  • Government assigned numbers: Social Security number (US), National Insurance number (UK), etc\n
  • Government assigned numbers: Social Security number (US), National Insurance number (UK), etc\n
  • Government assigned numbers: Social Security number (US), National Insurance number (UK), etc\n
  • Government assigned numbers: Social Security number (US), National Insurance number (UK), etc\n
  • Government assigned numbers: Social Security number (US), National Insurance number (UK), etc\n
  • Government assigned numbers: Social Security number (US), National Insurance number (UK), etc\n
  • Local content: relevant news to your region\n
  • Local content: relevant news to your region\n
  • Local content: relevant news to your region\n
  • World is larger than US or UK - China (19%), Brazil (3%), UK (0.9%), NL (0.24%)\nCompare English speaker population to world population\nCompare Dutch speaker population to world and English population\n
  • \n
  • Impossible.\nChoose your target.\n
  • Impossible.\nChoose your target.\n
  • Impossible.\nChoose your target.\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Context: maybe a message is one section needs to be different than in other section, so you end up with welcome2\nFind: does the string exist in the array?\nMeans: what does welcome contains?\n
  • Context: maybe a message is one section needs to be different than in other section, so you end up with welcome2\nFind: does the string exist in the array?\nMeans: what does welcome contains?\n
  • Context: maybe a message is one section needs to be different than in other section, so you end up with welcome2\nFind: does the string exist in the array?\nMeans: what does welcome contains?\n
  • Brazil: 0 item instead of 0 items\nAsian (Chinese, Japanese, Korean, Vietnamese): 1 form of plural\nPolish: 3 forms of plural\nArabic: 6 forms of plural\nOthers: 4 and 5 forms of plural\n
  • \n
  • Fallback: uses the given text if there is not any other\nCategories: Monetary, numeric, time, etc\n
  • \n
  • \n
  • Not need to do in __construct or something\n
  • \n
  • No extra code, that is it\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Configure your editor to write in unicode\n
  • Configure your editor to write in unicode\n
  • \n
  • \n
  • Internationalizing your application

    1. 1. S INTERNATIONALIZING YOUR APPLICATION by Renan GonçalvesSunday, September 4, 11
    2. 2. WHO IS THIS GUY? Software Engineer TrueServer B.V. CakePHP since 2007 Contributing since 2008 BrazilianSunday, September 4, 11
    3. 3. LOCALIZATION Adapting or converting the application to be used on a particular locale Locale defines: User’s language CountrySunday, September 4, 11
    4. 4. LOCALE language[_territory][.charset][@modifier] en en_US cs_CZ.UTF-8 pt_BR@CESunday, September 4, 11
    5. 5. LOCALE en_GB en_GB@oed en_CA en_US analyse analyse analy[sz]e analyze behaviour behaviour behaviour behavior centre centre centre center defence defence defence defense globalisation globalization globalization globalization realise realize realize realize http://en.wikipedia.org/wiki/En-GB-oed#Language_tag_comparisonSunday, September 4, 11
    6. 6. INTERNATIONALIZATION Supporting international data Text Content Numbers Currencies Dates / Times CalendarsSunday, September 4, 11
    7. 7. LANGUAGE Different systems of numerals decimal (10), vigesimal (20), octogesimal (80), etc Writing direction left to right and right to left Graphical representation of texts AudioSunday, September 4, 11
    8. 8. WRITING CONVENTIONS Date/time format Different calendars Time zones Number formatting Difference in symbolsSunday, September 4, 11
    9. 9. CULTURESunday, September 4, 11
    10. 10. CULTURE Images and colors Telephone numbers Currency Symbols, format Weights and measures Government assigned numbersSunday, September 4, 11
    11. 11. OTHERS National variants of languages Local content Order of sorting (collation)Sunday, September 4, 11
    12. 12. WHY CARE? World, 7 billion. China, 1.3 billion. US, 312 million. Brazil, 190 million. UK, 62 million. Netherlands, 17 million.Sunday, September 4, 11
    13. 13. OKAY, LETS RULE THE WORLD SUPPORT ALL LOCALES!Sunday, September 4, 11
    14. 14. NOT THAT EASY! Countries in the world (249) Languages in the world (6,309) + variants http://en.wikipedia.org/wiki/Lists_of_countries_and_territories http://en.wikipedia.org/wiki/Lists_of_languagesSunday, September 4, 11
    15. 15. FEEL AT HOME Small changes, big impactSunday, September 4, 11
    16. 16. PERSONAL NAMES AROUND THE WORLD Björk Guðmundsdóttir (Icelandic) Isa bin Osman (Malay) John Quincy AdamsSunday, September 4, 11
    17. 17. PERSONAL NAMES AROUND THE WORLD First name Middle name Last name Renan Gonçalves Cardoso de Lima First name Last name Renan Gonçalves Cardoso de Lima Initials Between names Last name R. G. C. de Lima http://www.w3.org/International/questions/qa-personal-namesSunday, September 4, 11
    18. 18. PERSONAL NAMES AROUND THE WORLD Full name Renan Gonçalves Cardoso de Lima What should we call you? RenanSunday, September 4, 11
    19. 19. PERSONAL NAMES AROUND THE WORLD Björk Guðmundsdóttir (Icelandic) Ms. Björk or Ms. Björk Guðmundsdóttir Isa bin Osman (Malay) Mr. Isa John Quincy Adams Mr. AdamsSunday, September 4, 11
    20. 20. HOW?Sunday, September 4, 11
    21. 21. PROBLEMS The context can change Hard to find exactly what you want Hard to know what it meansSunday, September 4, 11
    22. 22. PLURAL https://developer.mozilla.org/en/Localization_and_PluralsSunday, September 4, 11
    23. 23. CAKEPHP WAY Using i18n and L10n libraries Using Translate BehaviorSunday, September 4, 11
    24. 24. I18N Others functions: __d(), __dn(), __dc(), __dcn(), __c() http://book.cakephp.org/view/1229/Internationalizing-Your-ApplicationSunday, September 4, 11
    25. 25. I18N $ cake i18n extract Locale/default.pot #: FileName.php:lineNumber msgid "Welcome to our application!" msgstr "" #: FileName.php:lineNumber msgid "You have %d item in your basket." msgid_plural "You have %d items in your basket." msgstr[0] "" msgstr[1] ""Sunday, September 4, 11
    26. 26. POEDITSunday, September 4, 11
    27. 27. I18NSunday, September 4, 11
    28. 28. TRANSLATE BEHAVIORSunday, September 4, 11
    29. 29. TRANSLATE BEHAVIORSunday, September 4, 11
    30. 30. L10N Manage the locales Identify the localeSunday, September 4, 11
    31. 31. L10N Request HTTP_ACCEPT_LANGUAGE IP to country (GeoIP Lite) URL parameter book.cakephp.org/pt URL book.cakephp.jpSunday, September 4, 11
    32. 32. GOODIES Localized plugin Localized validation https://github.com/cakephp/localizedSunday, September 4, 11
    33. 33. TROUBLESHOOTING Right encoding unicode html metatag database charset file charset Configure::write(‘App.encoding’, ‘UTF-8’);Sunday, September 4, 11
    34. 34. QUESTIONS?Sunday, September 4, 11
    35. 35. THANK YOU! renan.saddam@cakephp.org @renan_saddam on twitter and #cakephp http://github.com/renansaddamSunday, September 4, 11

    ×