Skip to content

Projects and project languages

The SDK provides methods for listing and retrieving Lokalise Vantage projects and their associated languages.

API documentation

Use projects to retrieve projects belonging to a team:

projects = client.projects('team-id')
projects.each do |project|
puts "#{project.project_id}: #{project.name}"
end

Returns a LokaliseApiNext::Collections::Vantage::Projects collection containing LokaliseApiNext::Models::Vantage::Project objects.

You can also pass pagination parameters:

projects = client.projects('team-id', limit: 20)

If more results are available, use the returned cursor to retrieve the next page:

if projects.more?
next_page = client.projects(
'team-id',
limit: 20,
after: projects.cursor
)
end

API documentation

Use project to retrieve a single project by its ID:

project = client.project('project-id')
puts project.name
puts project.description
puts project.base_language['locale']
puts project.target_languages
puts project.translation_settings

Returns a LokaliseApiNext::Models::Vantage::Project object.

API documentation

Use project_languages to retrieve all languages associated with a project:

languages = client.project_languages('project-id')
languages.each do |language|
puts "#{language.language_name} (#{language.locale})"
end

Each language exposes its identifier, locale, name, and right-to-left writing direction flag:

language = languages.first
puts language.language_id
puts language.locale
puts language.language_name
puts language.is_rtl

Returns a LokaliseApiNext::Collections::Vantage::ProjectLanguages collection containing LokaliseApiNext::Models::Vantage::ProjectLanguage objects.

Unlike the projects list, this endpoint does not use cursor-based pagination.