Regional Configuration

Like most operating systems, CrOS supports user-selectable region settings, including keyboard layouts, languages, and time zones. In order to support an ideal out-of-box experience (OOBE), each device must be shipped with regional configuration suitable for its intended users. These settings are controlled by a value stored in the RO VPD (read-only vital product data) region field, and a database cros-regions.json.

This document describes how regional configurations are managed in the factory SDK.

Regions and region codes

A region is a market in which shipped devices share a particular configuration of keyboard layout, language, and time zone.

Each region is identified with a region code such as us. A region may be any of the following:

  • A single country, such as the United States. The region code is the two-letter ISO 3166-1 alpha-2 code, e.g., us. Note that the alpha-2 code for the UK is gb, not uk.
  • A non-country entity, such as Hong Kong, that has an ISO 3166-1 alpha-2 code assigned. The region code is the two-letter ISO 3166-1 alpha-2 code, e.g., hk.
  • A collection of countries or entities that share a regional configuration, such as Hispanophone Latin American countries (including Mexico, Colombia, Argentina, Peru, etc.) or Nordic countries. The region code is a unique identifier (>3 characters to avoid conflict with ISO alpha codes), e.g., latam-es-419 or nordic.
  • Part of a country or entity that has a specific regional configuration, e.g., Francophone Canada. The region code is one of the region codes described above, plus a period (.), plus an identifier describing the variant. For example, Francophone Canada’s region code is ca.fr.

Note that the concepts of regions and region codes, in the sense they are used in this document, are specific to the factory SDK. There is no single accepted worldwide standard for setting region configurations.

Currently, the region code is used by CrOS to derive regional data, for example locales or Wi-Fi regulatory domain. The regional data can be updated, but the region code itself is locked in VPD RO area.

The cros.factory.test.l10n.regions.Region [1] class encapsulates a single regional configuration.

Available regions

Following is a table of known regions. If you need a new region, please first check the “Unconfirmed regions” section below.

Warning

Concrete VPD values (keyboard, time zone, language, etc.) in this table are provided for reference only; they are not intended to be copied-and-pasted from this table into shop floor servers. Rather, shop floor servers should provide only the region code for the device. See Language codes.

Description Region Code Keyboard Time Zone Lang. Layout Notes

Argentina

ar xkb:latam::spa America/Argentina/Buenos_Aires es-AR ISO  

Australia

au xkb:us::eng Australia/Sydney en-AU ANSI  

Austria

at xkb:de::ger, xkb:de:neo:ger Europe/Vienna de, en-GB ISO  

Belgium

be xkb:be::nld Europe/Brussels en-GB ISO

Flemish (Belgian Dut...

Flemish (Belgian Dutch) keyboard; British English language for neutrality

Brazil (ABNT)

br.abnt xkb:br::por America/Sao_Paulo pt-BR ISO

Like ABNT2, but lack...

Like ABNT2, but lacking the extra key to the left of the right shift key found in that layout. ABNT2 (the “br” region) is preferred to this layout

Brazil (ABNT2)

br xkb:br::por America/Sao_Paulo pt-BR ABNT2

ABNT2 = ABNT NBR 103...

ABNT2 = ABNT NBR 10346 variant 2. This is the preferred layout for Brazil. ABNT2 is mostly an ISO layout, but it 12 keys between the shift keys; see http://goo.gl/twA5tq

Brazil (US Intl)

br.usintl xkb:us:intl:eng America/Sao_Paulo pt-BR ANSI

Brazil with US Inter...

Brazil with US International keyboard layout. ABNT2 (“br”) and ABNT1 (“br.abnt1 ”) are both preferred to this.

Bulgaria

bg xkb:bg::bul, xkb:bg:phonetic:bul Europe/Sofia bg, tr, en-US ANSI  

Canada (French keyboard)

ca.fr xkb:ca::fra America/Toronto fr-CA ISO

Canadian French (ISO...

Canadian French (ISO) keyboard. The most common configuration for Canadian French SKUs. See http://goto/cros-canada

Canada (US keyboard)

ca.ansi xkb:us::eng America/Toronto en-CA ANSI

Canada with US (ANSI...

Canada with US (ANSI) keyboard. Only allowed if there are separate US English, Canadian English, and French SKUs. Not for en/fr hybrid ANSI keyboards; for that you would want ca.hybridansi. See http://goto/cros-canada

Canada (hybrid ANSI)

ca.hybridansi xkb:ca:eng:eng America/Toronto en-CA ANSI

Canada with hybrid (...

Canada with hybrid (ANSI) xkb:ca:eng:eng + xkb:ca::fra keyboard, defaulting to English language and keyboard. Used only if there needs to be a single SKU for all of Canada. See http://goto/cros-canada

Canada (hybrid ISO)

ca.hybrid xkb:ca:eng:eng America/Toronto en-CA ISO

Canada with hybrid (...

Canada with hybrid (ISO) xkb:ca:eng:eng + xkb:ca::fra keyboard, defaulting to English language and keyboard. Used only if there needs to be a single SKU for all of Canada. See http://goto/cros-canada

Canada (multilingual)

ca.multix xkb:ca:multix:fra America/Toronto fr-CA ISO

Canadian Multilingua...

Canadian Multilingual keyboard; you probably don’t want this. See http://goto/cros-canada

Chile

cl xkb:latam::spa America/Santiago es-419 ANSI  

Czech Republic

cz xkb:cz::cze, xkb:cz:qwerty:cze Europe/Prague cs, en-GB ISO  

Finland

fi xkb:fi::fin Europe/Helsinki fi ISO  

France

fr xkb:fr::fra Europe/Paris fr ISO  

Germany

de xkb:de::ger Europe/Berlin de ISO  

Greece

gr xkb:us::eng, xkb:gr::gre, t13n:el Europe/Athens el, en-GB ANSI  

Gulf Cooperation Council (GCC)

gcc xkb:us::eng, m17n:ar, t13n:ar Asia/Riyadh ar, en-GB ANSI

GCC is a regional in...

GCC is a regional intergovernmental political and economic union consisting of all Arab states of the Persian Gulf except for Iraq. Its member states are the Islamic monarchies of Bahrain, Kuwait, Oman, Qatar, Saudi Arabia, and the United Arab Emirates.

Hispanophone Latin America

latam-es-419 xkb:es::spa America/Mexico_City es-419 ISO

Spanish-speaking cou...

Spanish-speaking countries in Latin America, using the Iberian (Spain) Spanish keyboard, which is increasingly dominant in Latin America. Known to be correct for Chile, Colombia, Mexico, Peru; still unconfirmed for other es-419 countries. The old Latin American layout (xkb:latam::spa) has not been approved; before using that you must seek review through http://goto/vpdsettings. See also http://goo.gl/Iffuqh. Note that 419 is the UN M.49 region code for Latin America

Hong Kong

hk xkb:us::eng, ime:zh-t:cangjie, ime:zh-t:quick, ime:zh-t:array, ime:zh-t:dayi, ime:zh-t:zhuyin, ime:zh-t:pinyin Asia/Hong_Kong zh-TW, en-GB, zh-CN ANSI  

Iceland

is xkb:is::ice Atlantic/Reykjavik is, en-GB ISO  

India

in xkb:us::eng Asia/Calcutta en-US ANSI  

Indonesia

id xkb:us::ind Asia/Jakarta id, en-GB ANSI  

Ireland

ie xkb:gb:extd:eng Europe/Dublin en-GB ISO  

Israel

il xkb:us::eng, xkb:il::heb, t13n:he Asia/Jerusalem he, en-US, ar ANSI  

Italy

it xkb:it::ita Europe/Rome it ISO  

Japan

jp xkb:jp::jpn Asia/Tokyo ja JIS  

Japan with US keyboard

jp.us xkb:us::eng Asia/Tokyo ja ANSI  

Kuwait

kw xkb:us::eng, m17n:ar, t13n:ar Asia/Kuwait ar, en ANSI  

Malaysia

my xkb:us::eng Asia/Kuala_Lumpur ms ANSI  

Mexico

mx xkb:latam::spa America/Mexico_City es-MX ANSI  

Netherlands

nl xkb:us:intl:eng Europe/Amsterdam nl ANSI  

New Zealand

nz xkb:us::eng Pacific/Auckland en-NZ ANSI  

Nigeria

ng xkb:us:intl:eng Africa/Lagos en-GB ANSI  

Nordics

nordic xkb:se::swe Europe/Stockholm en-US ISO

Unified SKU for Swed...

Unified SKU for Sweden, Norway, and Denmark. This defaults to Swedish keyboard layout, but starts with US English language for neutrality. Use if there is a single combined SKU for Nordic countries.

Peru

pe xkb:latam::spa America/Lima es-419 ANSI  

Philippines

ph xkb:us::eng Asia/Manila en-US ANSI  

Poland

pl xkb:pl::pol Europe/Warsaw pl, en-GB ANSI  

Portugal

pt xkb:pt::por Europe/Lisbon pt-PT, en-GB ISO  

Romania

ro xkb:us::eng, xkb:ro::rum Europe/Bucharest ro, hu, de, en-GB ISO  

Russia

ru xkb:us::eng, xkb:ru::rus Europe/Moscow ru ANSI

For R31+ only; R30 a...

For R31+ only; R30 and earlier must use US keyboard for login

Saudi Arabia

sa xkb:us::eng Asia/Riyadh ar, en ANSI  

Singapore

sg xkb:us::eng Asia/Singapore en-GB ANSI  

Slovakia

sk xkb:us::eng, xkb:sk::slo Europe/Bratislava sk, hu, cs, en-GB ISO  

South Africa

za xkb:gb:extd:eng Africa/Johannesburg en-ZA ISO  

South Africa

za.us xkb:us::eng Africa/Johannesburg en-ZA ANSI  

South Korea

kr xkb:us::eng, ime:ko:hangul Asia/Seoul ko, en-US ANSI  

Spain

es xkb:es::spa Europe/Madrid es ISO  

Sweden

se xkb:se::swe Europe/Stockholm sv ISO

Use this if there se...

Use this if there separate SKUs for Nordic countries (Sweden, Norway, and Denmark), or the device is only shipping to Sweden. If there is a single unified SKU, use ‘nordic’ instead.

Switzerland

ch xkb:ch::ger Europe/Zurich de-CH ISO

German keyboard

German keyboard

Switzerland (US Intl)

ch.usintl xkb:us:intl:eng Europe/Zurich en-US ANSI

Switzerland with US ...

Switzerland with US International keyboard layout.

Taiwan

tw xkb:us::eng, ime:zh-t:zhuyin, ime:zh-t:array, ime:zh-t:dayi, ime:zh-t:cangjie, ime:zh-t:quick, ime:zh-t:pinyin Asia/Taipei zh-TW, en-US ANSI  

Thailand

th xkb:us::eng, m17n:th, m17n:th_pattajoti, m17n:th_tis Asia/Bangkok th, en-GB ANSI  

Turkey

tr xkb:tr::tur, xkb:tr:f:tur Europe/Istanbul tr, en-GB ISO  

UAE

ae xkb:us::eng Asia/Dubai ar ANSI  

UK

gb xkb:gb:extd:eng Europe/London en-GB ISO  

UK (US extended keyboard)

gb.usext xkb:us:altgr-intl:eng Europe/London en-GB ISO

GB with US extended ...

GB with US extended keyboard

US (English Intl)

us.intl xkb:us:intl:eng America/Los_Angeles en-US ANSI  

United States

us xkb:us::eng America/Los_Angeles en-US ANSI  

Uruguay

uy xkb:latam::spa America/Montevideo es-419 ANSI  

Vietnam

vn xkb:us::eng, m17n:vi_telex, m17n:vi_vni, m17n:vi_viqr, m17n:vi_tcvn Asia/Ho_Chi_Minh vi, en-GB, en-US, fr, zh-TW ANSI  

Unconfirmed regions

Following is a table of unconfirmed regions (not ready for use in shipping products). If you need to use one of these please see http://goto/vpdsettings and src/platform2/regions/README for how to proceed.

For more information on how to choose field values, see Selecting values for new regions.

Description Region Code Keyboard Time Zone Lang. Layout Notes

Afghanistan

af xkb:af::fas Asia/Kabul fa-AF, ps ANSI  

Aland Islands

ax xkb:ax::swe Europe/Mariehamn sv-AX ANSI  

Albania

al xkb:al::sqi Europe/Tirane sq, el ANSI  

Algeria

dz xkb:dz::ara Africa/Algiers ar ANSI  

American Samoa

as xkb:as::eng Pacific/Pago_Pago en-AS, sm ANSI  

Andorra

ad xkb:ad::cat Europe/Andorra ca ANSI  

Angola

ao xkb:ao::por Africa/Luanda pt-AO ANSI  

Anguilla

ai xkb:ai::eng America/Anguilla en-AI ANSI  

Antigua and Barbuda

ag xkb:ag::eng America/Antigua en-AG ANSI  

Armenia

am xkb:am::hye Asia/Yerevan hy ANSI  

Aruba

aw xkb:aw::nld America/Aruba nl-AW, es, en ANSI  

Azerbaijan

az xkb:az::aze Asia/Baku az, ru, hy ANSI  

Bahamas

bs xkb:bs::eng America/Nassau en-BS ANSI  

Bahrain

bh xkb:bh::ara Asia/Bahrain ar, en, fa, ru ANSI  

Bangladesh

bd xkb:bd::ben Asia/Dhaka bn-BD, en ANSI  

Barbados

bb xkb:bb::eng America/Barbados en-BB ANSI  

Belarus

by xkb:by::bel Europe/Minsk be, ru ANSI  

Belize

bz xkb:bz::eng America/Belize en-BZ, es ANSI  

Benin

bj xkb:bj::fra Africa/Porto-Novo fr-BJ ANSI  

Bermuda

bm xkb:bm::eng Atlantic/Bermuda en-BM, pt ANSI  

Bhutan

bt xkb:bt::dzo Asia/Thimphu dz ANSI  

Bolivia

bo xkb:latam::spa America/La_Paz es-419, qu ANSI  

Bonaire, Saint Eustatius and Saba

bq xkb:bq::nld America/Kralendijk nl, en ANSI  

Bosnia and Herzegovina

ba xkb:ba::bos Europe/Sarajevo bs ANSI  

Botswana

bw xkb:bw::eng Africa/Gaborone en-BW, tn-BW ANSI  

British Indian Ocean Territory

io xkb:io::eng Indian/Chagos en-IO ANSI  

British Virgin Islands

vg xkb:vg::eng America/Tortola en-VG ANSI  

Brunei

bn xkb:bn::msa Asia/Brunei ms-BN, en-BN ANSI  

Burkina Faso

bf xkb:bf::fra Africa/Ouagadougou fr-BF ANSI  

Burundi

bi xkb:bi::fra Africa/Bujumbura fr-BI, rn ANSI  

Cambodia

kh xkb:kh::khm Asia/Phnom_Penh km, fr, en ANSI  

Cameroon

cm xkb:cm::eng Africa/Douala en-CM, fr-CM ANSI  

Cape Verde

cv xkb:cv::por Atlantic/Cape_Verde pt-CV ANSI  

Cayman Islands

ky xkb:ky::eng America/Cayman en-KY ANSI  

Central African Republic

cf xkb:cf::fra Africa/Bangui fr-CF, sg, ln ANSI  

Chad

td xkb:td::fra Africa/Ndjamena fr-TD, ar ANSI  

China

cn xkb:us::eng Asia/Shanghai zh-CN ANSI  

Christmas Island

cx xkb:cx::eng Indian/Christmas en, zh ANSI  

Cocos Islands

cc xkb:cc::msa Indian/Cocos ms-CC, en ANSI  

Colombia

co xkb:latam::spa America/Bogota es-419 ANSI  

Comoros

km xkb:km::ara Indian/Comoro ar, fr-KM ANSI  

Cook Islands

ck xkb:ck::eng Pacific/Rarotonga en-CK, mi ANSI  

Costa Rica

cr xkb:latam::spa America/Costa_Rica es-419 ANSI  

Croatia

hr xkb:hr::scr Europe/Zagreb hr, en-GB ISO  

Cuba

cu xkb:latam::spa America/Havana es-419 ANSI  

Curacao

cw xkb:cw::nld America/Curacao nl ANSI  

Cyprus

cy xkb:cy::ell Asia/Nicosia el-CY, tr-CY ANSI  

Democratic Republic of the Congo

cd xkb:cd::fra Africa/Kinshasa fr-CD, ln, kg ANSI  

Denmark

dk xkb:dk::dan Europe/Copenhagen da-DK, en, fo, de-DK ISO  

Djibouti

dj xkb:dj::fra Africa/Djibouti fr-DJ, ar ANSI  

Dominica

dm xkb:dm::eng America/Dominica en-DM ANSI  

Dominican Republic

do xkb:latam::spa America/Santo_Domingo es-419 ANSI  

East Timor

tl xkb:us::eng Asia/Dili tet, pt-TL, en ANSI  

Ecuador

ec xkb:latam::spa America/Guayaquil es-419 ANSI  

Egypt

eg xkb:eg::ara Africa/Cairo ar, en, fr ANSI  

El Salvador

sv xkb:latam::spa America/El_Salvador es-419 ANSI  

Equatorial Guinea

gq xkb:gq::spa Africa/Malabo es-419, fr ANSI  

Eritrea

er xkb:er::aar Africa/Asmara aa-ER, ar, tig, kun, ti-ER ANSI  

Estonia

ee xkb:ee::est Europe/Tallinn et, ru, en-GB ISO  

Ethiopia

et xkb:et::amh Africa/Addis_Ababa am, en-ET, om-ET, ti-ET ANSI  

Falkland Islands

fk xkb:fk::eng Atlantic/Stanley en-FK ANSI  

Faroe Islands

fo xkb:fo::fao Atlantic/Faroe fo, da-FO ANSI  

Fiji

fj xkb:fj::eng Pacific/Fiji en-FJ, fj ANSI  

French Guiana

gf xkb:gf::fra America/Cayenne fr-GF ANSI  

French Polynesia

pf xkb:pf::fra Pacific/Tahiti fr-PF, ty ANSI  

French Southern Territories

tf xkb:tf::fra Indian/Kerguelen fr ANSI  

Gabon

ga xkb:ga::fra Africa/Libreville fr-GA ANSI  

Gambia

gm xkb:gm::eng Africa/Banjul en-GM, mnk, wof ANSI  

Georgia

ge xkb:ge::geo Asia/Tbilisi ka ANSI  

Ghana

gh xkb:gh::eng Africa/Accra en-GH, ak, ee ANSI  

Gibraltar

gi xkb:gi::eng Europe/Gibraltar en-GI, es ANSI  

Greenland

gl xkb:gl::kal America/Godthab kl, da-GL, en ANSI  

Grenada

gd xkb:gd::eng America/Grenada en-GD ANSI  

Guadeloupe

gp xkb:gp::fra America/Guadeloupe fr-GP ANSI  

Guam

gu xkb:gu::eng Pacific/Guam en-GU, ch-GU ANSI  

Guatemala

gt xkb:latam::spa America/Guatemala es-419 ANSI  

Guernsey

gg xkb:gg::eng Europe/Guernsey en, fr ANSI  

Guinea

gn xkb:gn::fra Africa/Conakry fr-GN ANSI  

Guinea-Bissau

gw xkb:gw::por Africa/Bissau pt-GW, pov ANSI  

Guyana

gy xkb:gy::eng America/Guyana en-GY ANSI  

Haiti

ht xkb:ht::hat America/Port-au-Prince ht ANSI  

Honduras

hn xkb:latam::spa America/Tegucigalpa es-HN ANSI  

Hungary

hu xkb:us::eng, xkb:hu::hun Europe/Budapest hu, en-GB ISO  

Iran

ir xkb:ir::fas Asia/Tehran fa-IR, ku ANSI  

Iraq

iq xkb:iq::ara Asia/Baghdad ar, ku, hy ANSI  

Isle of Man

im xkb:im::eng Europe/Isle_of_Man en, gv ANSI  

Ivory Coast

ci xkb:ci::fra Africa/Abidjan fr-CI ANSI  

Jamaica

jm xkb:jm::eng America/Jamaica en-JM ANSI  

Jersey

je xkb:je::eng Europe/Jersey en, pt ANSI  

Jordan

jo xkb:jo::ara Asia/Amman ar, en ANSI  

Kazakhstan

kz xkb:kz::kaz Asia/Almaty kk, ru ANSI  

Kenya

ke xkb:ke::eng Africa/Nairobi en-KE, sw-KE ANSI  

Kiribati

ki xkb:ki::eng Pacific/Tarawa en-KI, gil ANSI  

Kyrgyzstan

kg xkb:kg::kir Asia/Bishkek ky, uz, ru ANSI  

Laos

la xkb:la::lao Asia/Vientiane lo, fr, en ANSI  

Latvia

lv xkb:lv:apostrophe:lav Europe/Riga lv, lt, ru, en-GB ISO  

Lebanon

lb xkb:lb::ara Asia/Beirut ar, fr-LB, en ANSI  

Lesotho

ls xkb:ls::eng Africa/Maseru en-LS, st, zu ANSI  

Liberia

lr xkb:lr::eng Africa/Monrovia en-LR ANSI  

Libya

ly xkb:ly::ara Africa/Tripoli ar, it, en ANSI  

Liechtenstein

li xkb:ch::ger Europe/Vaduz de, en-GB ISO  

Lithuania

lt xkb:lt::lit Europe/Vilnius lt, ru, pl ISO  

Luxembourg

lu xkb:lu::ltz Europe/Luxembourg lb, de-LU ANSI  

Macao

mo xkb:mo::zho Asia/Macau zh, zh-MO, pt ANSI  

Macedonia

mk xkb:mk::mkd Europe/Skopje mk, sq, tr ANSI  

Madagascar

mg xkb:mg::fra Indian/Antananarivo fr-MG, mg ANSI  

Malawi

mw xkb:mw::nya Africa/Blantyre ny, yao, tum ANSI  

Maldives

mv xkb:mv::div Indian/Maldives dv, en ANSI  

Mali

ml xkb:ml::fra Africa/Bamako fr-ML, bm ANSI  

Malta

mt xkb:us::eng Europe/Malta mt, en-GB ISO  

Marshall Islands

mh xkb:mh::mah Pacific/Majuro mhen-MH ANSI  

Martinique

mq xkb:mq::fra America/Martinique fr-MQ ANSI  

Mauritania

mr xkb:mr::ara Africa/Nouakchott ar, fuc, snk, fr, mey, wo ANSI  

Mauritius

mu xkb:mu::eng Indian/Mauritius en-MU, bho ANSI  

Mayotte

yt xkb:yt::fra Indian/Mayotte fr-YT ANSI  

Micronesia

fm xkb:fm::eng Pacific/Chuuk en-FM, chk, pon, yap, kos, uli, woe, nkr, kpg ANSI  

Moldova

md xkb:md::ron Europe/Chisinau ro, ru, gag ANSI  

Monaco

mc xkb:mc::fra Europe/Monaco fr-MC, en, it ANSI  

Mongolia

mn xkb:mn::mon Asia/Ulaanbaatar mn, ru ANSI  

Montenegro

me xkb:me::srp Europe/Podgorica sr, hu, bs, sq, hr, rom ANSI  

Montserrat

ms xkb:ms::eng America/Montserrat en-MS ANSI  

Morocco

ma xkb:ma::ara Africa/Casablanca ar, fr ANSI  

Mozambique

mz xkb:mz::por Africa/Maputo pt-MZ, vmw ANSI  

Myanmar

mm xkb:mm::mya Asia/Rangoon my ANSI  

Namibia

na xkb:na::eng Africa/Windhoek en-NA, af, de, hz, naq ANSI  

Nauru

nr xkb:nr::nau Pacific/Nauru na, en-NR ANSI  

Nepal

np xkb:np::nep Asia/Kathmandu ne, en ANSI  

New Caledonia

nc xkb:nc::fra Pacific/Noumea fr-NC ANSI  

Nicaragua

ni xkb:latam::spa America/Managua es-419, en ANSI  

Niger

ne xkb:ne::fra Africa/Niamey fr-NE, ha, kr ANSI  

Niue

nu xkb:us::eng Pacific/Niue niu, en-NU ANSI  

Norfolk Island

nf xkb:nf::eng Pacific/Norfolk en-NF ANSI  

North Korea

kp xkb:kp::kor Asia/Pyongyang ko-KP ANSI  

Northern Mariana Islands

mp xkb:us::eng Pacific/Saipan fil, tl, zh, ch-MP, en-MP ANSI  

Norway

no xkb:no::nor Europe/Oslo no, nb, nn, se ISO  

Oman

om xkb:om::ara Asia/Muscat ar, en, bal ANSI  

Pakistan

pk xkb:pk::urd Asia/Karachi ur-PK, en-PK, pa, sd, ps, brh ANSI  

Palau

pw xkb:us::eng Pacific/Palau pau, sov, en-PW, tox, ja, fil, zh ANSI  

Palestinian Territory

ps xkb:ps::ara Asia/Gaza ar ANSI  

Panama

pa xkb:latam::spa America/Panama es-419, en ANSI  

Papua New Guinea

pg xkb:pg::eng Pacific/Port_Moresby en-PG, ho, meu, tpi ANSI  

Paraguay

py xkb:latam::spa America/Asuncion es-419, gn ANSI  

Pitcairn

pn xkb:pn::eng Pacific/Pitcairn en-PN ANSI  

Puerto Rico

pr xkb:pr::eng America/Puerto_Rico en-PR ANSI  

Qatar

qa xkb:qa::ara Asia/Bahrain ar, en ANSI  

Republic of the Congo

cg xkb:cg::fra Africa/Brazzaville fr-CG, kg ANSI  

Reunion

re xkb:re::fra Indian/Reunion fr-RE ANSI  

Rwanda

rw xkb:rw::kin Africa/Kigali rw, en-RW ANSI  

Saint Barthelemy

bl xkb:bl::fra America/St_Barthelemy fr ANSI  

Saint Helena

sh xkb:sh::eng Atlantic/St_Helena en-SH ANSI  

Saint Kitts and Nevis

kn xkb:kn::eng America/St_Kitts en-KN ANSI  

Saint Lucia

lc xkb:lc::eng America/St_Lucia en-LC ANSI  

Saint Martin

mf xkb:mf::fra America/Marigot fr ANSI  

Saint Pierre and Miquelon

pm xkb:pm::fra America/Miquelon fr-PM ANSI  

Saint Vincent and the Grenadines

vc xkb:vc::eng America/St_Vincent en-VC, fr ANSI  

Samoa

ws xkb:ws::smo Pacific/Apia sm, en-WS ANSI  

San Marino

sm xkb:sm::ita Europe/San_Marino it-SM ANSI  

Sao Tome and Principe

st xkb:st::por Africa/Sao_Tome pt-ST ANSI  

Senegal

sn xkb:sn::fra Africa/Dakar fr-SN, wo, fuc ANSI  

Serbia

rs xkb:rs::srp Europe/Belgrade sr, hu, bs ANSI  

Seychelles

sc xkb:sc::eng Indian/Mahe en-SC, fr-SC ANSI  

Sierra Leone

sl xkb:sl::eng Africa/Freetown en-SL, men ANSI  

Sint Maarten

sx xkb:sx::nld America/Lower_Princes nl, en ANSI  

Slovenia

si xkb:si::slv Europe/Ljubljana sl, hu, it, sr, de, hr, en-GB ISO  

Solomon Islands

sb xkb:sb::eng Pacific/Guadalcanal en-SB, tpi ANSI  

Somalia

so xkb:so::som Africa/Mogadishu so-SO, ar ANSI  

South Georgia and the South Sandwich Islands

gs xkb:gs::eng Atlantic/South_Georgia en ANSI  

South Sudan

ss xkb:ss::eng Africa/Juba en ANSI  

Sri Lanka

lk xkb:lk::sin Asia/Colombo si, ta, en ANSI  

Sudan

sd xkb:sd::ara Africa/Khartoum ar, en, fia ANSI  

Suriname

sr xkb:sr::nld America/Paramaribo nl-SR, en, srn, hns, jv ANSI  

Svalbard and Jan Mayen

sj xkb:sj::nor Arctic/Longyearbyen no, ru ANSI  

Swaziland

sz xkb:sz::eng Africa/Mbabane en-SZ, ss-SZ ANSI  

Syria

sy xkb:sy::ara Asia/Damascus ar, ku, hy, arc, fr, en ANSI  

Tajikistan

tj xkb:tj::tgk Asia/Dushanbe tg, ru ANSI  

Tanzania

tz xkb:tz::swa Africa/Dar_es_Salaam sw-TZ, en ANSI  

Togo

tg xkb:tg::fra Africa/Lome fr-TG, ee, hna ANSI  

Tokelau

tk xkb:us::eng Pacific/Fakaofo tkl, en-TK ANSI  

Tonga

to xkb:to::ton Pacific/Tongatapu to, en-TO ANSI  

Trinidad and Tobago

tt xkb:tt::eng America/Port_of_Spain en-TT, hns, fr, es, zh ANSI  

Tunisia

tn xkb:tn::ara Africa/Tunis ar, fr ANSI  

Turkmenistan

tm xkb:tm::tuk Asia/Ashgabat tk, ru, uz ANSI  

Turks and Caicos Islands

tc xkb:tc::eng America/Grand_Turk en-TC ANSI  

Tuvalu

tv xkb:us::eng Pacific/Funafuti tvl, en, sm ANSI  

U.S. Virgin Islands

vi xkb:vi::eng America/St_Thomas en-VI ANSI  

Uganda

ug xkb:ug::eng Africa/Kampala en-UG, lg, ar ANSI  

Ukraine

ua xkb:ua::ukr Europe/Kiev uk, ru-UA, rom, pl, hu ANSI  

United States Minor Outlying Islands

um xkb:um::eng Pacific/Johnston en-UM ANSI  

Uzbekistan

uz xkb:uz::uzb Asia/Samarkand uz, ru, tg ANSI  

Vanuatu

vu xkb:vu::bis Pacific/Efate bi, en-VU ANSI  

Vatican

va xkb:va::lat Europe/Vatican la, it, fr ANSI  

Venezuela

ve xkb:latam::spa America/Caracas es-419 ANSI  

Wallis and Futuna

wf xkb:us::eng Pacific/Wallis wls, fud ANSI  

Western Sahara

eh xkb:eh::ara Africa/El_Aaiun ar, mey ANSI  

Yemen

ye xkb:ye::ara Asia/Aden ar ANSI  

Zambia

zm xkb:zm::eng Africa/Lusaka en-ZM, bem, loz, lun, lue, ny, toi ANSI  

Zimbabwe

zw xkb:zw::eng Africa/Harare en-ZW, sn, nr ANSI  

Selecting values for new regions

When adding a new region, you must choose the appropriate values for each field. This section describes how to choose these values.

Note that two fields (keyboards and language_codes) are lists, while the others are strings. When declaring regions with multiple keyboards or language codes, make sure to use a Python list (e.g., ['en', 'fr']) for those fields and not a comma-separated string (e.g., 'en,fr'). The values are ultimately encoded as a comma-separated string in the VPD, but in the regions database they are represented as Python lists.

The exact set of values supported by CrOS, naturally, depends on the CrOS image that will be installed. For instance, multiple keyboards and language codes are supported only in M34+, and input methods other than xkb:... are supported only in M38+. Always test your region settings to make sure they work as you expect on the CrOS image that will be used (see Testing region settings).

Region code

See Regions and region codes for information about region codes.

This field is stored in the VPD but is not currently used by CrOS.

Keyboard layouts (input methods)

The keyboards field is a list of input method IDs. The first one is the default. In general these should correspond to the languages chosen; when a language is selected, only keyboards that represent a valid choice for that language are shown.

Each identifier must start with either xkb: or m17n: or ime:. As of M38, valid keyboard layout identifiers are:

  • xkb:...: XKB input methods listed in any file in JSON files in the Chromium src/chrome/browser/resources/chromeos/input_method directory. (Look for the id attributes of each input_components list entry.) For example, you will find xkb:us::eng in google_xkb_manifest.json.

  • ime:...: (M38+ only) Any hard-coded strings listed in kEngineIdMigrationMap in Chromium’s input_method_util.cc. Currently this is:

    • ime:zh-t:quick
    • ime:zh-t:pinyin (not yet supported as of this writing, but should be added in M38)
    • ime:ko:hangul
    • ime:ko:hangul_2set
  • m17n:...: (M38+ only) Strings with a prefix in kEngineIdMigrationMap. The prefix is rewritten according to the map, and there must be a corresponding input method ID in some file in the input_method directory. For instance, m17n:ar will be rewritten to vkd_ar according to the map. vkd_ar is present in google_input_tools_manifest.js.

Since a Latin keyboard is required for login, the first entry in this list should be a Latin layout corresponding to the first language in the language_codes field. If that language has a non-Latin keyboard, then xkb:us::eng should be used as the first entry.

See Where regions are defined for information on where to add the new region to the codebase.

Time zone

The time_zone field specifies a single time zone that will be used as the default timezone. M35+ supports automatic time zone detection based on geolocation, but it is still worthwhile to choose a reasonable default time zone default.

This must be a tz database time zone identifier (e.g., America/Los_Angeles). See timezone_settings.cc for supported time zones.

There is no hard-and-fast rule for selecting the time zone, but as a rule of thumb, you can choose the city representing the time zone in the region with the largest population.

Language codes

The language_codes field is a list of language codes. See the kAcceptLanguageList array in l10n_util.cc for supported languages.

Keyboard mechanical layout

This describes the shape of keys. It is used only to display an appropriate keyboard onscreen during the keyboard test; it is not stored in the VPD or used by Chrome OS. This may be one of:

  • ANSI for ANSI (US-like) keyboard layouts with a horizontal Enter key.
  • ISO for ISO (UK-like) keyboard layouts with a vertical Enter key.
  • JIS for the JIS (Japan-specific) keyboard layout.
  • ABNT2 for the Brazilian ABNT2 keyboard layout, which is like the ISO layout but has 12 keys between the shift keys (the ISO layout has 11).

Description

This is simply a brief, human-readable name of the region (e.g., Canada (French keyboard). It is used only in documentation.

Notes

This optional field may contain any notes necessary to describe the region and any rationale for its settings. It is used only in documentation.

Testing region settings

When adding a new region, you should test your chosen values to make sure that the values are valid, and the user experience in OOBE is as you expect.

First, you should run unit tests making sure that your region settings are valid. To test values in the public repo, use py/l10/regions_unittest.py. To test values in a private or board overlay, use make overlay-board && overlay-board/py/l10/regions_unittest.py, where board is either the name of your board or the string private.

To check the OOBE user experience, you can use the py/experimental/oobe/region/run_region_oobe.py script. This script ssh’es into a CrOS device, sets its VPD fields according to a region specified on the command line, and runs the OOBE flow. The device should be running a test image, and the factory toolkit should not be enabled.

Note that region configurations from your local client are used.

For example, to ssh into a device called crosdev and test a new region named xx that you have added to the public overlay:

cd ~/trunk/src/platform/factory
py/experimental/oobe/region/run_region_oobe.py crosdev xx

Or if the region is in the private overlay:

cd ~/trunk/src/platform/factory
make overlay-private
overlay-private/py/experimental/oobe/region/run_region_oobe.py crosdev xx

How regions are set in the factory flow

In general, the test list should contain an invocation of the shopfloor_service test with the GetDeviceInfo method to obtain the device-specific data, including region code in VPD. For instance:

{
  "pytest_name": "shopfloor_service",
  "args": {
    "method": "GetDeviceInfo"
  }
}

The returned data from remote Shopfloor Service should return a dictionary to be stored in factory state data shelve (DeviceData) with region for VPD as:

{'ro.vpd.region': 'us'}

The write_device_data_to_vpd test can then be used to read the ro.vpd.region entry from the device data dictionary and provision into firmware VPD RO region.

For example:

{
  "pytest_name": "write_device_data_to_vpd"
}

Region API

class cros.factory.test.l10n.regions.Region(region_code, keyboards, time_zone, language_codes, keyboard_mechanical_layout, description=None, notes=None)

Comprehensive, standard locale configuration per country/region.

See Selecting values for new regions for detailed information on how to set these values.

FIELDS = ['region_code', 'keyboards', 'time_zone', 'language_codes', 'keyboard_mechanical_layout']

Names of fields that define the region.

region_code = None

A unique identifier for the region. This may be a lower-case ISO 3166-1 alpha-2 code (e.g., us), a variant within an alpha-2 entity (e.g., ca.fr), or an identifier for a collection of countries or entities (e.g., latam-es-419 or nordic). See Regions and region codes.

Note that uk is not a valid identifier; gb is used as it is the real alpha-2 code for the UK.

keyboards = None

A list of logical keyboard layout identifiers (e.g., xkb:us:intl:eng or m17n:ar).

This was used for legacy VPD keyboard_layouts value.

time_zone = None

A tz database time zone identifier (e.g., America/Los_Angeles). See timezone_settings.cc for supported time zones.

This was used for legacy VPD initial_timezone value.

language_codes = None

A list of default language codes (e.g., en-US); see l10n_util.cc for supported languages.

This was used for legacy VPD initial_locale value.

keyboard_mechanical_layout = None

The keyboard’s mechanical layout (ANSI [US-like], ISO [UK-like], JIS [Japanese], ABNT2 [Brazilian] or KS [Korean]).

description = None

A human-readable description of the region. This defaults to region_code if not set.

notes = None

Notes about the region. This may be None.

GetFieldsDict()

Returns a dict of all substantive fields.

notes and description are excluded.

The cros.factory.test.l10n.regions.BuildRegionsDict() method is used to obtain a list of all confirmed regions. In general, code should not invoke this directly but rather use cros.factory.test.l10n.regions.REGIONS.

cros.factory.test.l10n.regions.BuildRegionsDict(include_all=False)

Builds a dictionary mapping region code to py.l10n.regions.Region object.

The regions include:

  • cros.factory.l10n.regions.REGIONS_LIST
  • Only if include_all is true:
    • cros.factory.l10n.regions.UNCONFIRMED_REGIONS_LIST

A region may only appear in one of the above lists, or this function will (deliberately) fail.

Where regions are defined

The complete set of confirmed regions (regions available for use in shipping products) is specified by cros.factory.test.l10n.regions.REGIONS_LIST.

In addition, there is a module-level attributes used to accumulate region configuration settings that are thought to be correct but have not been completely verified yet: cros.factory.test.l10n.regions.REGIONS_LIST.

If you cannot add a region to the public factory repository, you may add it to the private repository that overrides the REGION_LIST.

There is a reference list of “private” regions, shared by private board overlays, in the chromeos-partner-overlay repository.

Footnotes

[1]“l10n” is a common abbreviation for “localization”: “l”, plus 10 letters “ocalizatio”, plus “n”.)