Module: RubyLokaliseApi::Rest::Languages
- Included in:
- RubyLokaliseApi::Rest
- Defined in:
- lib/ruby_lokalise_api/rest/languages.rb
Instance Method Summary collapse
-
#create_project_languages(project_id, req_params) ⇒ RubyLokaliseApi::Collections::ProjectLanguages
Creates one or multiple languages for a project.
-
#destroy_project_language(project_id, language_id) ⇒ RubyLokaliseApi::Generics::DeletedResource
Deletes a single language from the project.
-
#project_language(project_id, language_id) ⇒ RubyLokaliseApi::Resources::ProjectLanguage
Returns a single project language.
-
#project_languages(project_id, req_params = {}) ⇒ RubyLokaliseApi::Collections::ProjectLanguages
Returns project languages.
-
#system_languages(req_params = {}) ⇒ RubyLokaliseApi::Collections::SystemLanguages
Returns Lokalise system languages.
-
#update_project_language(project_id, language_id, req_params = {}) ⇒ RubyLokaliseApi::Resources::ProjectLanguage
Updates a language for a project.
Instance Method Details
#create_project_languages(project_id, req_params) ⇒ RubyLokaliseApi::Collections::ProjectLanguages
Creates one or multiple languages for a project
57 58 59 60 61 62 63 64 |
# File 'lib/ruby_lokalise_api/rest/languages.rb', line 57 def create_project_languages(project_id, req_params) name = 'ProjectLanguages' params = { query: project_id, req: req_params.to_array_obj(:languages) } data = endpoint(name: name, params: params).do_post collection name, data end |
#destroy_project_language(project_id, language_id) ⇒ RubyLokaliseApi::Generics::DeletedResource
Deletes a single language from the project
87 88 89 90 91 92 93 |
# File 'lib/ruby_lokalise_api/rest/languages.rb', line 87 def destroy_project_language(project_id, language_id) params = { query: [project_id, language_id] } data = endpoint(name: 'ProjectLanguages', params: params).do_delete RubyLokaliseApi::Generics::DeletedResource.new data.content end |
#project_language(project_id, language_id) ⇒ RubyLokaliseApi::Resources::ProjectLanguage
Returns a single project language
43 44 45 46 47 48 49 |
# File 'lib/ruby_lokalise_api/rest/languages.rb', line 43 def project_language(project_id, language_id) params = { query: [project_id, language_id] } data = endpoint(name: 'ProjectLanguages', params: params).do_get resource 'ProjectLanguage', data end |
#project_languages(project_id, req_params = {}) ⇒ RubyLokaliseApi::Collections::ProjectLanguages
Returns project languages
28 29 30 31 32 33 34 35 |
# File 'lib/ruby_lokalise_api/rest/languages.rb', line 28 def project_languages(project_id, req_params = {}) name = 'ProjectLanguages' params = { query: project_id, req: req_params } data = endpoint(name: name, params: params).do_get collection name, data end |
#system_languages(req_params = {}) ⇒ RubyLokaliseApi::Collections::SystemLanguages
Returns Lokalise system languages
13 14 15 16 17 18 19 20 |
# File 'lib/ruby_lokalise_api/rest/languages.rb', line 13 def system_languages(req_params = {}) name = 'SystemLanguages' params = { req: req_params } data = endpoint(name: name, params: params).do_get collection name, data end |
#update_project_language(project_id, language_id, req_params = {}) ⇒ RubyLokaliseApi::Resources::ProjectLanguage
Updates a language for a project
73 74 75 76 77 78 79 |
# File 'lib/ruby_lokalise_api/rest/languages.rb', line 73 def update_project_language(project_id, language_id, req_params = {}) params = { query: [project_id, language_id], req: req_params } data = endpoint(name: 'ProjectLanguages', params: params).do_put resource 'ProjectLanguage', data end |