Localization

Learn how to add localization to your Cosmic content.

For a reference on how to add localization to your Object types in your Bucket dashboard, see the dashboard documentation on localization.


GET/v3/buckets/:bucket_slug/objects

Get localized Objects

This endpoint enables you to retrieve a list of your Objects by locale by indicating the Objects type and locale in the query parameter.

Required parameters

See the Objects API reference for more querying references.

Request

GET
/v3/buckets/:bucket_slug/objects
import { createBucketClient } from '@cosmicjs/sdk'

const cosmic = createBucketClient({
  bucketSlug: 'BUCKET_SLUG',
  readKey: 'BUCKET_READ_KEY'
})

await cosmic.objects.find({
  type: 'posts',
  locale: 'es' // Get all posts in Spanish
}).props([
  'slug',
  'title',
  'metadata.content',
])

Response

{
  "objects": [
    {
      "slug": "aprendiendo",
      "title": "Aprendiendo",
      "metadata": {
        "content": "<p>¡Es divertido aprender!</p>"
      }
    }
  ],
  "total": 6,
  "limit": 1
}

Available locales

The following are the available locales that can be used to localize your Objects.

CodeTitle
af-NAAfrikaans (Namibia)
af-ZAAfrikaans (South Africa)
afAfrikaans
ak-GHAkan (Ghana)
akAkan
sq-ALAlbanian (Albania)
sqAlbanian
am-ETAmharic (Ethiopia)
amAmharic
ar-DZArabic (Algeria)
ar-BHArabic (Bahrain)
ar-EGArabic (Egypt)
ar-IQArabic (Iraq)
ar-JOArabic (Jordan)
ar-KWArabic (Kuwait)
ar-LBArabic (Lebanon)
ar-LYArabic (Libya)
ar-MAArabic (Morocco)
ar-OMArabic (Oman)
ar-QAArabic (Qatar)
ar-SAArabic (Saudi Arabia)
ar-SDArabic (Sudan)
ar-SYArabic (Syria)
ar-TNArabic (Tunisia)
ar-AEArabic (United Arab Emirates)
ar-YEArabic (Yemen)
arArabic
hy-AMArmenian (Armenia)
hyArmenian
as-INAssamese (India)
asAssamese
asa-TZAsu (Tanzania)
asaAsu
az-CyrlAzerbaijani (Cyrillic)
az-Cyrl-AZAzerbaijani (Cyrillic, Azerbaijan)
az-LatnAzerbaijani (Latin)
az-Latn-AZAzerbaijani (Latin, Azerbaijan)
azAzerbaijani
bm-MLBambara (Mali)
bmBambara
eu-ESBasque (Spain)
euBasque
be-BYBelarusian (Belarus)
beBelarusian
bem-ZMBemba (Zambia)
bemBemba
bez-TZBena (Tanzania)
bezBena
bn-BDBengali (Bangladesh)
bn-INBengali (India)
bnBengali
bs-BABosnian (Bosnia and Herzegovina)
bsBosnian
bg-BGBulgarian (Bulgaria)
bgBulgarian
my-MMBurmese (Myanmar [Burma])
myBurmese
ca-ESCatalan (Spain)
caCatalan
tzm-LatnCentral Morocco Tamazight (Latin)
tzm-Latn-MACentral Morocco Tamazight (Latin, Morocco)
tzmCentral Morocco Tamazight
chr-USCherokee (United States)
chrCherokee
cgg-UGChiga (Uganda)
cggChiga
zh-HansChinese (Simplified Han)
zh-Hans-CNChinese (Simplified Han, China)
zh-Hans-HKChinese (Simplified Han, Hong Kong SAR China)
zh-Hans-MOChinese (Simplified Han, Macau SAR China)
zh-Hans-SGChinese (Simplified Han, Singapore)
zh-HantChinese (Traditional Han)
zh-Hant-HKChinese (Traditional Han, Hong Kong SAR China)
zh-Hant-MOChinese (Traditional Han, Macau SAR China)
zh-Hant-TWChinese (Traditional Han, Taiwan)
zhChinese
kw-GBCornish (United Kingdom)
kwCornish
hr-HRCroatian (Croatia)
hrCroatian
cs-CZCzech (Czech Republic)
csCzech
da-DKDanish (Denmark)
daDanish
nl-BEDutch (Belgium)
nl-NLDutch (Netherlands)
nlDutch
ebu-KEEmbu (Kenya)
ebuEmbu
en-ASEnglish (American Samoa)
en-AUEnglish (Australia)
en-BEEnglish (Belgium)
en-BZEnglish (Belize)
en-BWEnglish (Botswana)
en-CAEnglish (Canada)
en-GUEnglish (Guam)
en-HKEnglish (Hong Kong SAR China)
en-INEnglish (India)
en-IEEnglish (Ireland)
en-JMEnglish (Jamaica)
en-MTEnglish (Malta)
en-MHEnglish (Marshall Islands)
en-MUEnglish (Mauritius)
en-NAEnglish (Namibia)
en-NZEnglish (New Zealand)
en-MPEnglish (Northern Mariana Islands)
en-PKEnglish (Pakistan)
en-PHEnglish (Philippines)
en-SGEnglish (Singapore)
en-ZAEnglish (South Africa)
en-TTEnglish (Trinidad and Tobago)
en-UMEnglish (U.S. Minor Outlying Islands)
en-VIEnglish (U.S. Virgin Islands)
en-GBEnglish (United Kingdom)
en-USEnglish (United States)
en-ZWEnglish (Zimbabwe)
enEnglish
eoEsperanto
et-EEEstonian (Estonia)
etEstonian
ee-GHEwe (Ghana)
ee-TGEwe (Togo)
eeEwe
fo-FOFaroese (Faroe Islands)
foFaroese
fil-PHFilipino (Philippines)
filFilipino
fi-FIFinnish (Finland)
fiFinnish
fr-BEFrench (Belgium)
fr-BJFrench (Benin)
fr-BFFrench (Burkina Faso)
fr-BIFrench (Burundi)
fr-CMFrench (Cameroon)
fr-CAFrench (Canada)
fr-CFFrench (Central African Republic)
fr-TDFrench (Chad)
fr-KMFrench (Comoros)
fr-CGFrench (Congo - Brazzaville)
fr-CDFrench (Congo - Kinshasa)
fr-CIFrench (Côte d’Ivoire)
fr-DJFrench (Djibouti)
fr-GQFrench (Equatorial Guinea)
fr-FRFrench (France)
fr-GAFrench (Gabon)
fr-GPFrench (Guadeloupe)
fr-GNFrench (Guinea)
fr-LUFrench (Luxembourg)
fr-MGFrench (Madagascar)
fr-MLFrench (Mali)
fr-MQFrench (Martinique)
fr-MCFrench (Monaco)
fr-NEFrench (Niger)
fr-RWFrench (Rwanda)
fr-REFrench (Réunion)
fr-BLFrench (Saint Barthélemy)
fr-MFFrench (Saint Martin)
fr-SNFrench (Senegal)
fr-CHFrench (Switzerland)
fr-TGFrench (Togo)
frFrench
ff-SNFulah (Senegal)
ffFulah
gl-ESGalician (Spain)
glGalician
lg-UGGanda (Uganda)
lgGanda
ka-GEGeorgian (Georgia)
kaGeorgian
de-ATGerman (Austria)
de-BEGerman (Belgium)
de-DEGerman (Germany)
de-LIGerman (Liechtenstein)
de-LUGerman (Luxembourg)
de-CHGerman (Switzerland)
deGerman
el-CYGreek (Cyprus)
el-GRGreek (Greece)
elGreek
gu-INGujarati (India)
guGujarati
guz-KEGusii (Kenya)
guzGusii
ha-LatnHausa (Latin)
ha-Latn-GHHausa (Latin, Ghana)
ha-Latn-NEHausa (Latin, Niger)
ha-Latn-NGHausa (Latin, Nigeria)
haHausa
haw-USHawaiian (United States)
hawHawaiian
he-ILHebrew (Israel)
heHebrew
hi-INHindi (India)
hiHindi
hu-HUHungarian (Hungary)
huHungarian
is-ISIcelandic (Iceland)
isIcelandic
ig-NGIgbo (Nigeria)
igIgbo
id-IDIndonesian (Indonesia)
idIndonesian
ga-IEIrish (Ireland)
gaIrish
it-ITItalian (Italy)
it-CHItalian (Switzerland)
itItalian
ja-JPJapanese (Japan)
jaJapanese
kea-CVKabuverdianu (Cape Verde)
keaKabuverdianu
kab-DZKabyle (Algeria)
kabKabyle
kl-GLKalaallisut (Greenland)
klKalaallisut
kln-KEKalenjin (Kenya)
klnKalenjin
kam-KEKamba (Kenya)
kamKamba
kn-INKannada (India)
knKannada
kk-CyrlKazakh (Cyrillic)
kk-Cyrl-KZKazakh (Cyrillic, Kazakhstan)
kkKazakh
km-KHKhmer (Cambodia)
kmKhmer
ki-KEKikuyu (Kenya)
kiKikuyu
rw-RWKinyarwanda (Rwanda)
rwKinyarwanda
kok-INKonkani (India)
kokKonkani
ko-KRKorean (South Korea)
koKorean
khq-MLKoyra Chiini (Mali)
khqKoyra Chiini
ses-MLKoyraboro Senni (Mali)
sesKoyraboro Senni
lag-TZLangi (Tanzania)
lagLangi
lv-LVLatvian (Latvia)
lvLatvian
lt-LTLithuanian (Lithuania)
ltLithuanian
luo-KELuo (Kenya)
luoLuo
luy-KELuyia (Kenya)
luyLuyia
mk-MKMacedonian (Macedonia)
mkMacedonian
jmc-TZMachame (Tanzania)
jmcMachame
kde-TZMakonde (Tanzania)
kdeMakonde
mg-MGMalagasy (Madagascar)
mgMalagasy
ms-BNMalay (Brunei)
ms-MYMalay (Malaysia)
msMalay
ml-INMalayalam (India)
mlMalayalam
mt-MTMaltese (Malta)
mtMaltese
gv-GBManx (United Kingdom)
gvManx
mr-INMarathi (India)
mrMarathi
mas-KEMasai (Kenya)
mas-TZMasai (Tanzania)
masMasai
mer-KEMeru (Kenya)
merMeru
mnMongolian
mfe-MUMorisyen (Mauritius)
mfeMorisyen
naq-NANama (Namibia)
naqNama
ne-INNepali (India)
ne-NPNepali (Nepal)
neNepali
nd-ZWNorth Ndebele (Zimbabwe)
ndNorth Ndebele
nb-NONorwegian Bokmål (Norway)
nbNorwegian Bokmål
nn-NONorwegian Nynorsk (Norway)
nnNorwegian Nynorsk
nyn-UGNyankole (Uganda)
nynNyankole
or-INOriya (India)
orOriya
om-ETOromo (Ethiopia)
om-KEOromo (Kenya)
omOromo
ps-AFPashto (Afghanistan)
psPashto
fa-AFPersian (Afghanistan)
fa-IRPersian (Iran)
faPersian
pl-PLPolish (Poland)
plPolish
pt-BRPortuguese (Brazil)
pt-GWPortuguese (Guinea-Bissau)
pt-MZPortuguese (Mozambique)
pt-PTPortuguese (Portugal)
ptPortuguese
pa-ArabPunjabi (Arabic)
pa-Arab-PKPunjabi (Arabic, Pakistan)
pa-GuruPunjabi (Gurmukhi)
pa-Guru-INPunjabi (Gurmukhi, India)
paPunjabi
ro-MDRomanian (Moldova)
ro-RORomanian (Romania)
roRomanian
rm-CHRomansh (Switzerland)
rmRomansh
rof-TZRombo (Tanzania)
rofRombo
ru-MDRussian (Moldova)
ru-RURussian (Russia)
ru-UARussian (Ukraine)
ruRussian
rwk-TZRwa (Tanzania)
rwkRwa
saq-KESamburu (Kenya)
saqSamburu
sg-CFSango (Central African Republic)
sgSango
seh-MZSena (Mozambique)
sehSena
sr-CyrlSerbian (Cyrillic)
sr-Cyrl-BASerbian (Cyrillic, Bosnia and Herzegovina)
sr-Cyrl-MESerbian (Cyrillic, Montenegro)
sr-Cyrl-RSSerbian (Cyrillic, Serbia)
sr-LatnSerbian (Latin)
sr-Latn-BASerbian (Latin, Bosnia and Herzegovina)
sr-Latn-MESerbian (Latin, Montenegro)
sr-Latn-RSSerbian (Latin, Serbia)
srSerbian
sn-ZWShona (Zimbabwe)
snShona
ii-CNSichuan Yi (China)
iiSichuan Yi
si-LKSinhala (Sri Lanka)
siSinhala
sk-SKSlovak (Slovakia)
skSlovak
sl-SISlovenian (Slovenia)
slSlovenian
xog-UGSoga (Uganda)
xogSoga
so-DJSomali (Djibouti)
so-ETSomali (Ethiopia)
so-KESomali (Kenya)
so-SOSomali (Somalia)
soSomali
es-ARSpanish (Argentina)
es-BOSpanish (Bolivia)
es-CLSpanish (Chile)
es-COSpanish (Colombia)
es-CRSpanish (Costa Rica)
es-DOSpanish (Dominican Republic)
es-ECSpanish (Ecuador)
es-SVSpanish (El Salvador)
es-GQSpanish (Equatorial Guinea)
es-GTSpanish (Guatemala)
es-HNSpanish (Honduras)
es-419Spanish (Latin America)
es-MXSpanish (Mexico)
es-NISpanish (Nicaragua)
es-PASpanish (Panama)
es-PYSpanish (Paraguay)
es-PESpanish (Peru)
es-PRSpanish (Puerto Rico)
es-ESSpanish (Spain)
es-USSpanish (United States)
es-UYSpanish (Uruguay)
es-VESpanish (Venezuela)
esSpanish
sw-KESwahili (Kenya)
sw-TZSwahili (Tanzania)
swSwahili
sv-FISwedish (Finland)
sv-SESwedish (Sweden)
svSwedish
gsw-CHSwiss German (Switzerland)
gswSwiss German
shi-LatnTachelhit (Latin)
shi-Latn-MATachelhit (Latin, Morocco)
shi-TfngTachelhit (Tifinagh)
shi-Tfng-MATachelhit (Tifinagh, Morocco)
shiTachelhit
dav-KETaita (Kenya)
davTaita
ta-INTamil (India)
ta-LKTamil (Sri Lanka)
taTamil
te-INTelugu (India)
teTelugu
teo-KETeso (Kenya)
teo-UGTeso (Uganda)
teoTeso
th-THThai (Thailand)
thThai
bo-CNTibetan (China)
bo-INTibetan (India)
boTibetan
ti-ERTigrinya (Eritrea)
ti-ETTigrinya (Ethiopia)
tiTigrinya
to-TOTonga (Tonga)
toTonga
tr-TRTurkish (Turkey)
trTurkish
uk-UAUkrainian (Ukraine)
ukUkrainian
ur-INUrdu (India)
ur-PKUrdu (Pakistan)
urUrdu
uz-ArabUzbek (Arabic)
uz-Arab-AFUzbek (Arabic, Afghanistan)
uz-CyrlUzbek (Cyrillic)
uz-Cyrl-UZUzbek (Cyrillic, Uzbekistan)
uz-LatnUzbek (Latin)
uz-Latn-UZUzbek (Latin, Uzbekistan)
uzUzbek
vi-VNVietnamese (Vietnam)
viVietnamese
vun-TZVunjo (Tanzania)
vunVunjo
cy-GBWelsh (United Kingdom)
cyWelsh
yo-NGYoruba (Nigeria)
yoYoruba
zu-ZAZulu (South Africa)
zuZulu