English
, en-US
, or en-GB
.
es-ES
for Spanish.# 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'
# Gets a specific article in Spanish
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'
# Filters all articles to find the Spanish variant by its URL slug
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'
# Gets content items in Spanish without following language fallbacks
delivery_client.items(['system.language'.eq('es-ES')])
.language('es-ES')
.execute do |response|
items = response.items
end