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

Preview:

DESCRIPTION

 

Citation preview

Багатомовнісайти

Міжнародний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.comen.example.com

example.comexample.com/en

example.ruexample.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

<?xmlversion="1.0"encoding="Windows‐1251"?><api><request><search><abbrexact="1">ООО</abbr></search></request><response><count>4</count><uri>http://sokr.ru/?text=%CE%CE%CE&amp;exact=on</uri></response></api>

<?xmlversion="1.0"encoding="Windows‐1251"?><api><request><search><abbrexact="1">ООО</abbr></search></request><response><count>4</count><uri>http://sokr.ru/?text=%CE%CE%CE&amp;exact=on</uri></response></api>

Код

Template::Toolkit

<p><t><en>Attendeesarewelcomefreeofcharge.</en><ru>Участиевмероприятиибесплатное.</ru></t></p>

Template::Multilingual

msgid"Userinformation"msgstr"Информацияопользователе"

msgid"Login"msgstr"Вход"

msgid"Name"msgstr"Имя"

msgid"City"msgstr"Город"

msgid"Country"msgstr"Страна"

GNU gettext

Poedit

SQL

insertintotranslations(locale,msgid,

msgstr)...

selectname_$langfrom...

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‐ofselect="document('strings.xml')/

strings/months/item[5]/text()

"/>

Файли ресурсів

<xsl:value‐ofselect="document($lang)/

strings/months/item[5]/text()

"/>

Файли ресурсів

<xsl:value‐ofselect="$months/item[5]/text()

"/>

<phonecountry="7"city="495">1234567</phone>

<phonecountry="7"city="495">1234567</phone>

<phonecountry="russia"city="moscow">1234567</phone>

<phonecountry="7"city="495">1234567</phone>

<phonecountry="russia"city="moscow">1234567</phone>

<phonecountry="7"city="495"><item>1234567</item><item>8901234</item><item>5678901</item></phone>

XML

XPath

HTML

CSS

xml:lang

lang()

lang

:lang(),[lang=]

Мова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-LatnSerbian written using the Latin script

sr-Latn-CSSerbian written using the Latin script as used

in Serbia and Montenegro

ISO 639-2

Language Code

ukr

ISO 639-1

Language Code

uk

ISO 3166

Country code

English country name

UKRAINE

Code element

UA

IANA Language Subtag Registryhttp://www.iana.org/assignments/language-subtag-registry

%%

Type: language

Subtag: uk

Description: Ukrainian

Added: 2005-10-16

Suppress-Script: Cyrl

%%

%%

Type: region

Subtag: UA

Description: Ukraine

Added: 2005-10-16

%%

IANA Language Subtag Registryhttp://www.iana.org/assignments/language-subtag-registry

%%

Type: language

Subtag: uk

Description: Ukrainian

Added: 2005-10-16

Suppress-Script: Cyrl

%%

%%

Type: region

Subtag: UA

Description: Ukraine

Added: 2005-10-16

%%

IANA Language Subtag Registryhttp://www.iana.org/assignments/language-subtag-registry

%%

Type: language

Subtag: sh

Description: Serbo-Croatian

Added: 2005-10-16

Deprecated: 2000-02-18

%%

<pxml:lang="en‐GB">Whatcolourisit?</p>

<pxml:lang="en‐US">Whatcolorisit?</p>

http://www.w3.org/TR/REC-xml/

<styletype="text/css">p:lang(en){color:red;}p[lang|="en"]{color:green;}p[lang="en"]{color:blue;}</style>

Занадтобагатомовнісайти

Строковые ресурсы в 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/

Крім того

ТипографікаКапчиДизайнОдиниці вимірювання

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

UA Web 2008