SlideShare a Scribd company logo
1 of 129
Download to read offline
Багатомовні
  сайти
Міжнародний
      vs.
багатомовний
Обов’язковий перелік
   Тексти
   Телефонні номери
   Ціни, валюта
   Дати, час
   Зображення
Тексти
Телефонні номери
123-45-67
(495) 123-45-67
+7 495 123-45-67
8 985 123-45-67
+380 44 123-45-67
(044) 123-45-67
Ціни
Валюта
Дати
Час
Логотипи
Зображення
URLs
example.com
en.example.com
example.com
example.com/en
example.ru
example.com
rian.ru
de.rian.ru
fr.rian.ru
ar.rian.ru
pe.rian.ru
sp.rian.ru
rian.ru
de.rian.ru
fr.rian.ru
ar.rian.ru
pe.rian.ru
sp.rian.ru
rusnews.cn
big5.rusnews.cn
en.wikipedia.org
ru.wikipedia.org
de.wikipedia.org
be.wikipedia.org
uk.wikipedia.org
be-x-old.wikipedia.org
google.com
google.ru
google.de
google.it
google.com.ua
google.co.uk
korrespondent.net
korespondent.net
korrespondent.net
ua.korrespondent.net
Зміна мови
HTTP_ACCEPT_LANGUAGE
<?xml
version=quot;1.0quot;
encoding=quot;Windows‐1251quot;?>
<api>




<request>








<search>











<abbr
exact=quot;1quot;>ООО</abbr>








</search>




</request>




<response>








<count>4</count>








<uri>http://sokr.ru/?text=













%CE%CE%CE&amp;exact=on</uri>




</response>
</api>
<?xml
version=quot;1.0quot;
encoding=quot;Windows‐1251quot;?>
<api>




<request>








<search>











<abbr
exact=quot;1quot;>ООО</abbr>








</search>




</request>




<response>








<count>4</count>








<uri>http://sokr.ru/?text=













%CE%CE%CE&amp;exact=on</uri>




</response>
</api>
<?xml
version=quot;1.0quot;
encoding=quot;UTF‐8quot;?>
<api>




<response>








<count>1</count>








<uri>http://ukrskor.info/?text=













%D0%9E%D0%9E%D0%9E</uri>




</response>
</api>
Код
Template::Toolkit
<p>




<t>








<en>Attendees
are
welcome













free
of
charge.</en>








<ru>Участие
в
мероприятии












бесплатное.</ru>




</t>
</p>
                        Template::Multilingual
msgid
quot;User
informationquot;
msgstr
quot;Информация
о
пользователеquot;

msgid
quot;Loginquot;
msgstr
quot;Входquot;

msgid
quot;Namequot;
msgstr
quot;Имяquot;

msgid
quot;Cityquot;
msgstr
quot;Городquot;             GNU gettext
msgid
quot;Countryquot;
msgstr
quot;Странаquot;
Poedit
SQL
insert
into

translations
(



locale,




msgid,




msgstr
)
...
select
name_$lang
from
...
XSLT
Файли ресурсів
  <strings>
  
 <months>
  
 
 <item>січень</item>
  
 
 <item>лютий</item>
  
 
 <item>березень</item>
  
 
 <item>квітень</item>
  
 
 <item>травень</item>
  
 
 <item>червень</item>
  
 
 <item>липень</item>
  
 
 <item>серпень</item>
  
 
 <item>вересень</item>
  
 
 <item>жовтень</item>
  
 
 <item>листопад</item>
  
 
 <item>грудень</item>
  
 </months>
  </strings>
Файли ресурсів

<xsl:value‐of



select=quot;





document('strings.xml')/





strings/months/





item[5]/text()



quot;
/>
Файли ресурсів

<xsl:value‐of



select=quot;





document($lang)/





strings/months/





item[5]/text()



quot;
/>
Файли ресурсів

<xsl:value‐of



select=quot;





$months/item[5]/text()



quot;
/>
<phone
country=quot;7quot;
city=quot;495quot;>1234567</phone>
<phone
country=quot;7quot;
city=quot;495quot;>1234567</phone>

<phone





country=quot;russiaquot;





city=quot;moscowquot;>1234567</phone>
<phone
country=quot;7quot;
city=quot;495quot;>1234567</phone>

<phone





country=quot;russiaquot;





city=quot;moscowquot;>1234567</phone>

<phone
country=quot;7quot;
city=quot;495quot;>








<item>1234567</item>








<item>8901234</item>








<item>5678901</item>
</phone>
XML     xml:lang

XPath   lang()

HTML    lang

CSS     :lang(),
[lang=]
http://www.w3.org/International/articles/css3-text/images/Slide0130.gif
Мова
  vs.
країна
RFC 4646
Tags for the Identification of Languages


ISO 3166
Codes for Country Names
IANA
Language Subtag Registry


RFC 4647
Matching of Language Tags
RFC 4646


language-script-region-variant-extension-privateuse
sr‐Cyrl
Serbian written using the Cyrillic script


sr-Latn
Serbian written using the Latin script


sr-Latn-CS
Serbian written using the Latin script as used
in Serbia and Montenegro
ISO 639-2       ISO 3166
Language Code   Country code
ukr
                English country name
                UKRAINE
ISO 639-1
Language Code   Code element
uk              UA
IANA Language Subtag Registry
http://www.iana.org/assignments/language-subtag-registry



%%                                                         %%
Type: language                                             Type: region
Subtag: uk                                                 Subtag: UA
Description: Ukrainian                                     Description: Ukraine
Added: 2005-10-16                                          Added: 2005-10-16
Suppress-Script: Cyrl                                      %%
%%
IANA Language Subtag Registry
http://www.iana.org/assignments/language-subtag-registry



%%                                                         %%
Type: language                                             Type: region
Subtag: uk                                                 Subtag: UA
Description: Ukrainian                                     Description: Ukraine
Added: 2005-10-16                                          Added: 2005-10-16
Suppress-Script: Cyrl                                      %%
%%
IANA Language Subtag Registry
http://www.iana.org/assignments/language-subtag-registry



%%
Type: language
Subtag: sh
Description: Serbo-Croatian
Added: 2005-10-16
Deprecated: 2000-02-18
%%
<p
xml:lang=quot;en‐GBquot;>



What
colour
is
it?
</p>

<p
xml:lang=quot;en‐USquot;>



What
color
is
it?
</p>


http://www.w3.org/TR/REC-xml/
<style
type=quot;text/cssquot;>




p:lang(en)
{








color:
red;




}




p[lang
|=
quot;enquot;]
{








color:
green;




}




p[lang
=
quot;enquot;]
{








color:
blue;




}
</style>
http://www.w3.org/International/tests/results/css-lang
Занадто
багатомовні
сайти
Строковые ресурсы в XSLT-шаблонах
http://www.artlebedev.ru/tools/technogrette/xslt/strings/


Локализация
http://www.artlebedev.ru/tools/technogrette/xslt/localizing/


Телефонные номера
http://www.artlebedev.ru/tools/technogrette/xslt/phone-numbers/



Еще раз о многоязычном сайте
http://www.artlebedev.ru/tools/technogrette/xslt/multilang/
CSS3 and International Text
http://www.w3.org/International/articles/language-tags/


Language tags in HTML and XML
http://www.w3.org/International/articles/language-tags/


Understanding the New Language Tags
http://www.w3.org/International/articles/bcp47/



Internationalization Best Practices
http://www.w3.org/TR/i18n-html-tech-lang/


Planet I18n
http://www.w3.org/International/planet/
Крім того
   Типографіка
   Капчи
   Дизайн
   Одиниці вимірювання
UA Web 2008




Андрей Шитов
andy@shitov.ru

More Related Content

Viewers also liked

A Suspeita
A SuspeitaA Suspeita
A Suspeitaju07
 
Spectacular View Of New York
Spectacular View Of New YorkSpectacular View Of New York
Spectacular View Of New Yorkalex
 
What You Need To Know About Max Gxl
What You Need To Know About Max GxlWhat You Need To Know About Max Gxl
What You Need To Know About Max GxlWilliam Hultquist
 
108 funtioneel verifieren asfaltverhardingen
108 funtioneel verifieren asfaltverhardingen108 funtioneel verifieren asfaltverhardingen
108 funtioneel verifieren asfaltverhardingenCROW
 
How to Find a Six Figure Mentor
How to Find a Six Figure MentorHow to Find a Six Figure Mentor
How to Find a Six Figure MentorRobert Murray
 
Ewrt 1 c class 32 online
Ewrt 1 c class 32  onlineEwrt 1 c class 32  online
Ewrt 1 c class 32 onlinejordanlachance
 
Mi diagrama de mi red profesional
Mi diagrama de mi red profesionalMi diagrama de mi red profesional
Mi diagrama de mi red profesionallinacalicanto
 
harpeth history 1999 through flood recovery
harpeth history 1999 through flood recoveryharpeth history 1999 through flood recovery
harpeth history 1999 through flood recoveryDavid Jones
 
муззал
муззалмуззал
муззалFintfin
 
Boeing 314b-camerafan
Boeing 314b-camerafanBoeing 314b-camerafan
Boeing 314b-camerafanGeorge Martin
 
Atributos de un buen lider trabajo final
Atributos de un buen lider trabajo finalAtributos de un buen lider trabajo final
Atributos de un buen lider trabajo finalYVANBARRIOS
 
Aircraft structural screws
Aircraft structural screwsAircraft structural screws
Aircraft structural screwsjohnschwaner
 

Viewers also liked (18)

Trabalho
TrabalhoTrabalho
Trabalho
 
Alemania
AlemaniaAlemania
Alemania
 
A Suspeita
A SuspeitaA Suspeita
A Suspeita
 
Spectacular View Of New York
Spectacular View Of New YorkSpectacular View Of New York
Spectacular View Of New York
 
What You Need To Know About Max Gxl
What You Need To Know About Max GxlWhat You Need To Know About Max Gxl
What You Need To Know About Max Gxl
 
108 funtioneel verifieren asfaltverhardingen
108 funtioneel verifieren asfaltverhardingen108 funtioneel verifieren asfaltverhardingen
108 funtioneel verifieren asfaltverhardingen
 
Andrea
AndreaAndrea
Andrea
 
How to Find a Six Figure Mentor
How to Find a Six Figure MentorHow to Find a Six Figure Mentor
How to Find a Six Figure Mentor
 
Ewrt 1 c class 32 online
Ewrt 1 c class 32  onlineEwrt 1 c class 32  online
Ewrt 1 c class 32 online
 
Newsletter 6 ro
Newsletter 6 roNewsletter 6 ro
Newsletter 6 ro
 
Mi diagrama de mi red profesional
Mi diagrama de mi red profesionalMi diagrama de mi red profesional
Mi diagrama de mi red profesional
 
Enlace Ciudadano Nro 315 tema: caretucada diario el universo
Enlace Ciudadano Nro 315 tema: caretucada diario el universoEnlace Ciudadano Nro 315 tema: caretucada diario el universo
Enlace Ciudadano Nro 315 tema: caretucada diario el universo
 
harpeth history 1999 through flood recovery
harpeth history 1999 through flood recoveryharpeth history 1999 through flood recovery
harpeth history 1999 through flood recovery
 
Trematoda usus
Trematoda ususTrematoda usus
Trematoda usus
 
муззал
муззалмуззал
муззал
 
Boeing 314b-camerafan
Boeing 314b-camerafanBoeing 314b-camerafan
Boeing 314b-camerafan
 
Atributos de un buen lider trabajo final
Atributos de un buen lider trabajo finalAtributos de un buen lider trabajo final
Atributos de un buen lider trabajo final
 
Aircraft structural screws
Aircraft structural screwsAircraft structural screws
Aircraft structural screws
 

More from Andrew Shitov

Creating a compiler in Perl 6
Creating a compiler in Perl 6Creating a compiler in Perl 6
Creating a compiler in Perl 6Andrew Shitov
 
Fun with Raspberry PI (and Perl)
Fun with Raspberry PI (and Perl)Fun with Raspberry PI (and Perl)
Fun with Raspberry PI (and Perl)Andrew Shitov
 
Параллельные вычисления в Perl 6
Параллельные вычисления в Perl 6Параллельные вычисления в Perl 6
Параллельные вычисления в Perl 6Andrew Shitov
 
Perl 6 for Concurrency and Parallel Computing
Perl 6 for Concurrency and Parallel ComputingPerl 6 for Concurrency and Parallel Computing
Perl 6 for Concurrency and Parallel ComputingAndrew Shitov
 
The Joy of Smartmatch
The Joy of SmartmatchThe Joy of Smartmatch
The Joy of SmartmatchAndrew Shitov
 
Perl 7, the story of
Perl 7, the story ofPerl 7, the story of
Perl 7, the story ofAndrew Shitov
 
Язык программирования Go для Perl-программистов
Язык программирования Go для Perl-программистовЯзык программирования Go для Perl-программистов
Язык программирования Go для Perl-программистовAndrew Shitov
 
Как очистить массив
Как очистить массивКак очистить массив
Как очистить массивAndrew Shitov
 
What's new in Perl 5.14
What's new in Perl 5.14What's new in Perl 5.14
What's new in Perl 5.14Andrew Shitov
 
Что нового в Perl 5.14
Что нового в Perl 5.14Что нового в Perl 5.14
Что нового в Perl 5.14Andrew Shitov
 
Text in search queries with examples in Perl 6
Text in search queries with examples in Perl 6Text in search queries with examples in Perl 6
Text in search queries with examples in Perl 6Andrew Shitov
 
There's more than one way to empty it
There's more than one way to empty itThere's more than one way to empty it
There's more than one way to empty itAndrew Shitov
 
How to clean an array
How to clean an arrayHow to clean an array
How to clean an arrayAndrew Shitov
 

More from Andrew Shitov (20)

Perl6 one-liners
Perl6 one-linersPerl6 one-liners
Perl6 one-liners
 
Creating a compiler in Perl 6
Creating a compiler in Perl 6Creating a compiler in Perl 6
Creating a compiler in Perl 6
 
Fun with Raspberry PI (and Perl)
Fun with Raspberry PI (and Perl)Fun with Raspberry PI (and Perl)
Fun with Raspberry PI (and Perl)
 
Perl6 in-production
Perl6 in-productionPerl6 in-production
Perl6 in-production
 
Параллельные вычисления в Perl 6
Параллельные вычисления в Perl 6Параллельные вычисления в Perl 6
Параллельные вычисления в Perl 6
 
AllPerlBooks.com
AllPerlBooks.comAllPerlBooks.com
AllPerlBooks.com
 
Perl 6 for Concurrency and Parallel Computing
Perl 6 for Concurrency and Parallel ComputingPerl 6 for Concurrency and Parallel Computing
Perl 6 for Concurrency and Parallel Computing
 
The Joy of Smartmatch
The Joy of SmartmatchThe Joy of Smartmatch
The Joy of Smartmatch
 
YAPC::Europe 2013
YAPC::Europe 2013YAPC::Europe 2013
YAPC::Europe 2013
 
Perl 7, the story of
Perl 7, the story ofPerl 7, the story of
Perl 7, the story of
 
Язык программирования Go для Perl-программистов
Язык программирования Go для Perl-программистовЯзык программирования Go для Perl-программистов
Язык программирования Go для Perl-программистов
 
Как очистить массив
Как очистить массивКак очистить массив
Как очистить массив
 
What's new in Perl 5.14
What's new in Perl 5.14What's new in Perl 5.14
What's new in Perl 5.14
 
Что нового в Perl 5.14
Что нового в Perl 5.14Что нового в Perl 5.14
Что нового в Perl 5.14
 
Perl6 grammars
Perl6 grammarsPerl6 grammars
Perl6 grammars
 
Text in search queries with examples in Perl 6
Text in search queries with examples in Perl 6Text in search queries with examples in Perl 6
Text in search queries with examples in Perl 6
 
There's more than one way to empty it
There's more than one way to empty itThere's more than one way to empty it
There's more than one way to empty it
 
Perl 6 by example
Perl 6 by examplePerl 6 by example
Perl 6 by example
 
How to clean an array
How to clean an arrayHow to clean an array
How to clean an array
 
Perl 5.10 и 5.12
Perl 5.10 и 5.12Perl 5.10 и 5.12
Perl 5.10 и 5.12
 

Многоязычные сайты