Ways to get localized content
Is this page helpful?
English
, en-US
, or en-GB
.
es-ES
for Spanish.en-US
and the second language set as Spanish es-ES
, which falls back to the default language.
language=es-ES
– Specifies the codename of the requested language.system.language=es-ES
– Filters content items by their language.language parameter value | system.language parameter value | Behavior |
es-ES | <not set> | The API returns content items in Spanish. If an item is not translated to Spanish, the API returns the English (en-us ) version of the items as fallback. |
es-ES | es-ES | The API returns only content items in Spanish. If an item is not translated to Spanish, the API doesn't return it. |
es-ES | en-US | The API returns only content items in English provided they don't have content in Spanish. If an item is translated to Spanish, it is not returned. |
# Tip: Find more about Ruby SDKs at https://kontent.ai/learn/ruby
require 'delivery-sdk-ruby'
delivery_client = Kontent::Ai::Delivery::DeliveryClient.new project_id: '8d20758c-d74c-4f59-ae04-ee928c0816b7'
delivery_client.item('about_us')
.language('es-ES')
.execute do |response|
item = response.item
end
# Tip: Find more about Ruby SDKs at https://kontent.ai/learn/ruby
require 'delivery-sdk-ruby'
delivery_client = Kontent::Ai::Delivery::DeliveryClient.new project_id: '8d20758c-d74c-4f59-ae04-ee928c0816b7'
delivery_client.items([
'system.type'.eq('article'),
'elements.url_pattern'.eq('acerda-de-nosotros')
])
.language('es-ES')
.execute do |response|
items = response.items
end
# Tip: Find more about Ruby SDKs at https://kontent.ai/learn/ruby
require 'delivery-sdk-ruby'
delivery_client = Kontent::Ai::Delivery::DeliveryClient.new project_id: '975bf280-fd91-488c-994c-2f04416e5ee3'
delivery_client.items(['system.language'.eq('es-ES')])
.language('es-ES')
.execute do |response|
items = response.items
end