{"id":13994470,"url":"https://github.com/crowdin/crowdin-api-client-ruby","last_synced_at":"2025-05-16T14:06:44.089Z","repository":{"id":4537831,"uuid":"5678219","full_name":"crowdin/crowdin-api-client-ruby","owner":"crowdin","description":"Ruby client library for Crowdin API","archived":false,"fork":false,"pushed_at":"2024-11-01T13:27:59.000Z","size":572,"stargazers_count":57,"open_issues_count":17,"forks_count":16,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-05-15T18:57:17.930Z","etag":null,"topics":["api","hacktoberfest","i18n","ruby","sdk"],"latest_commit_sha":null,"homepage":"https://rubygems.org/gems/crowdin-api","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/crowdin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2012-09-04T20:31:56.000Z","updated_at":"2025-05-12T11:48:39.000Z","dependencies_parsed_at":"2023-07-09T06:16:54.567Z","dependency_job_id":"ea03ad31-0a7b-49e7-aee3-d962da57e6c4","html_url":"https://github.com/crowdin/crowdin-api-client-ruby","commit_stats":{"total_commits":228,"total_committers":13,"mean_commits":17.53846153846154,"dds":0.6096491228070176,"last_synced_commit":"5cd45c5cef6c9d6cbbf5cef699f2c860414915b4"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crowdin%2Fcrowdin-api-client-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crowdin%2Fcrowdin-api-client-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crowdin%2Fcrowdin-api-client-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crowdin%2Fcrowdin-api-client-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crowdin","download_url":"https://codeload.github.com/crowdin/crowdin-api-client-ruby/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254404335,"owners_count":22065639,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","hacktoberfest","i18n","ruby","sdk"],"created_at":"2024-08-09T14:02:53.596Z","updated_at":"2025-05-16T14:06:44.061Z","avatar_url":"https://github.com/crowdin.png","language":"Ruby","readme":"\u003cp align=\"center\"\u003e\n  \u003cpicture\u003e\n    \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://support.crowdin.com/assets/logos/symbol/png/crowdin-symbol-cWhite.png\"\u003e\n    \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://support.crowdin.com/assets/logos/symbol/png/crowdin-symbol-cDark.png\"\u003e\n    \u003cimg width=\"150\" height=\"150\" src=\"https://support.crowdin.com/assets/logos/symbol/png/crowdin-symbol-cDark.png\"\u003e\n  \u003c/picture\u003e\n\u003c/p\u003e\n\n# Crowdin Ruby client\n\nThe Crowdin Ruby client is a lightweight interface to the Crowdin API. It provides common services for making API requests.\n\nCrowdin API is a full-featured RESTful API that helps you to integrate localization into your development process. The endpoints that we use allow you to easily make calls to retrieve information and to execute actions needed.\n\n\u003cdiv align=\"center\"\u003e\n\n[**`API Client Docs`**](http://crowdin.github.io/crowdin-api-client-ruby/) \u0026nbsp;|\u0026nbsp;\n[**`Crowdin API`**](https://developer.crowdin.com/api/v2/) \u0026nbsp;|\u0026nbsp;\n[**`Crowdin Enterprise API`**](https://developer.crowdin.com/enterprise/api/v2/)\n\n[![Gem](https://img.shields.io/gem/v/crowdin-api?logo=ruby\u0026cacheSeconds=1800)](https://rubygems.org/gems/crowdin-api)\n[![Gem](https://img.shields.io/gem/dt/crowdin-api?cacheSeconds=1800)](https://rubygems.org/gems/crowdin-api)\n[![Gem](https://img.shields.io/gem/dtv/crowdin-api?cacheSeconds=1800)](https://rubygems.org/gems/crowdin-api)\n[![Test and Lint](https://github.com/crowdin/crowdin-api-client-ruby/actions/workflows/test-and-lint.yml/badge.svg)](https://github.com/crowdin/crowdin-api-client-ruby/actions/workflows/test-and-lint.yml)\n[![codecov](https://codecov.io/gh/crowdin/crowdin-api-client-ruby/branch/main/graph/badge.svg?token=OJsyJwQbFM)](https://codecov.io/gh/crowdin/crowdin-api-client-ruby)\n[![GitHub](https://img.shields.io/github/license/crowdin/crowdin-api-client-ruby?cacheSeconds=1800)](https://github.com/crowdin/crowdin-api-client-ruby/blob/main/LICENSE)\n\n\u003c/div\u003e\n\n## Requirements\n* Ruby \u003e= 2.4\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```gemfile\ngem 'crowdin-api', '~\u003e 1.12.0'\n```\n\nAnd then execute:\n\n```console\nbundle install\n```\n\nOr install it yourself as:\n\n```console\ngem install crowdin-api\n```\n\n## Quick start\n\n### Initialization\n\n```ruby\nrequire 'crowdin-api'\n\n# Initialize a new Client instance with config options\ncrowdin = Crowdin::Client.new do |config|\n  config.api_token = 'YourApiToken'\nend\n\n# Or you can initialize Enterprise Client instance by specifying your\n# organization_domain in config options\ncrowdin = Crowdin::Client.new do |config|\n  config.api_token = 'YourEnterpriseApiToken'\n  config.organization_domain = 'YourOrganizationDomain'\nend\n# Note: we use full specified organization domain if that includes '.com'\n# config.organization_domain = your_domain -\u003e https://your_domain.api.crowdin.com\n# config.organization_domain = your_domain.com -\u003e https://your_domain.com\n\n# All supported Crowdin Client config options now:\ncrowdin = Crowdin::Client.new do |config|\n  config.api_token = 'YourApiToken' # [String] required\n  config.organization_domain = 'YourOrganizationDomain' # [String] optional\n  config.project_id = 'YourProjectId' # [Integer] nil by default\n  config.enable_logger = true # [Boolean] false by default\n  config.request_timeout = 60 # [nil, Integer] disabled by default\nend\n# Note: Client will initialize default Logger instance if you have specify\n# enable_logger to true, you can change it by crowdin.logger = YourLogger\n\n# Also you can specify proxy by adding it to ENV['http_proxy'] before Client initialization\n```\n\nTo generate a new token in Crowdin, follow these steps:\n- Go to *Account Settings* \u003e *API* tab, *Personal Access Tokens* section, and click *New Token*.\n- Specify *Token Name* and click *Create*.\n\nTo generate a new token in Crowdin Enterprise, follow these steps:\n- Go to *Account Settings* \u003e *Access tokens* tab and click *New token*.\n- Specify *Token Name*, select *Scopes* and *Projects*, click *Create*.\n\n### Usage\n\n```ruby\n# Create Project\nproject = crowdin.add_project(name: your_project_name, sourceLanguageId: your_language_id)\n\n# Get list of Projects\nprojects = crowdin.list_projects\n\n# Get list of Projects with offset and limit\nprojects = crowdin.list_projects(offset: 10, limit: 20)\n\n# Get specified project\nproject = crowdin.get_project(your_project_id)\n\n# Edit project\nproject = crowdin.edit_project(project_id, [{ op: 'replace',\n                                              path: '/name',\n                                              value: 'your_new_project_name' }])\n\n# Add Storage\nstorage = crowdin.add_storage(File.open('YourFilename.extension', 'r'))\n# or you can specify only absolute path to file\nstorage = crowdin.add_storage('YourFilename.extension')\n\n# Download file\nfile = crowdin.download_file(your_file_id, your_destination, your_project_id)\n# your_destination - filename or absolute path to the file, optional\n# Without a destination option, the file will not be saved automatically\n# project_id is optional, as it can be initialized with a Crowdin Client\n\n# File revisions\n# with initialized project_id in your Client\nfile_revisions = crowdin.list_file_revisions(your_file_id, limit: 10)\n# or you can specify your project_id\nfile_revisions = crowdin.list_file_revisions(your_file_id, { limit: 10 }, your_project_id)\n\n# Note: more examples you can find in spec folder\n```\n\n### Fetch all records\n\nThere is a possibility to fetch all records from paginatable methods using `fetch_all` method.\n\n```ruby\n# FetchAll options:\n# * limit, Integer, default: 500 | How many records need to load per one request\n# * offset, Integer, default: 0\n# * request_delay, Integer (seconds), default: 0 | Delay between requests. To specify a delay in milliseconds use float values like 0.100\n\n# Examples:\n\n@crowdin.fetch_all(:list_projects)\n\n# with options\n@crowdin.fetch_all(:list_projects, { limit: 10, request_delay: 1 })\n\n# playing with response per fetch\n# Note: the block actually don't make any effect to finite result\n@crowdin.fetch_all(:list_projects, { limit: 10, request_delay: 1 }) { |response| puts response['data'] }\n\n# also, you could specify a retry configuration to handle some exceptions\n# fetch all execution will be terminated if response status code is the same as one of the error_messages array value\n# otherwise, the request will be retried so many times, as indicated at retries_count\n@crowdin.fetch_all(:list_projects, {}, { request_delay: 2, retries_count: 3, error_messages: ['401'] })\n```\n\n### Command-Line Client\n\nThe Crowdin Ruby client support crowdin-console, where you can test endpoints easier\n\n```console\n$ bundle exec crowdin-console --enable-logger --api-token API_TOKEN --project-id PROJECT_ID\n```\n\nOr Crowdin Enterprise\n\n```console\n$ bundle exec crowdin-console --enable-logger --enterprise --api-token API_TOKEN --organization-domain DOMAIN --project-id PROJECT_ID\n```\nNote: you can specify full organization domain by adding '.com'\n\nWhen execute you'll have IRB console with configured *@crowdin* instance\n\n```\n\u003e @crowdin.list_projects\n```\n\n## Seeking Assistance\n\nIf you find any problems or would like to suggest a feature, please read the [How can I contribute](/CONTRIBUTING.md#how-can-i-contribute) section in our contributing guidelines.\n\n## Contributing\n\nIf you would like to contribute please read the [Contributing](/CONTRIBUTING.md) guidelines.\n\n## License\n\n\u003cpre\u003e\nThe Crowdin Ruby Client is licensed under the MIT License.\nSee the LICENSE.md file distributed with this work for additional \ninformation regarding copyright ownership.\n\nExcept as contained in the LICENSE file, the name(s) of the above copyright\nholders shall not be used in advertising or otherwise to promote the sale,\nuse or other dealings in this Software without prior written authorization.\n\u003c/pre\u003e\n","funding_links":[],"categories":["Ruby"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrowdin%2Fcrowdin-api-client-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrowdin%2Fcrowdin-api-client-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrowdin%2Fcrowdin-api-client-ruby/lists"}