{"id":25687077,"url":"https://github.com/holyshared/yaml-translator","last_synced_at":"2025-08-01T04:33:45.780Z","repository":{"id":56898948,"uuid":"80900299","full_name":"holyshared/yaml-translator","owner":"holyshared","description":"Translate for the locales configuration file","archived":false,"fork":false,"pushed_at":"2018-02-09T02:27:06.000Z","size":66,"stargazers_count":1,"open_issues_count":3,"forks_count":2,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-21T17:58:38.312Z","etag":null,"topics":["diff","gem","i18n","locale","ruby","translation"],"latest_commit_sha":null,"homepage":"","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/holyshared.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-04T06:51:02.000Z","updated_at":"2019-12-18T13:41:17.000Z","dependencies_parsed_at":"2022-08-21T02:20:47.257Z","dependency_job_id":null,"html_url":"https://github.com/holyshared/yaml-translator","commit_stats":null,"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holyshared%2Fyaml-translator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holyshared%2Fyaml-translator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holyshared%2Fyaml-translator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holyshared%2Fyaml-translator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/holyshared","download_url":"https://codeload.github.com/holyshared/yaml-translator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250535057,"owners_count":21446503,"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":["diff","gem","i18n","locale","ruby","translation"],"created_at":"2025-02-24T20:08:05.802Z","updated_at":"2025-04-23T23:44:00.599Z","avatar_url":"https://github.com/holyshared.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# yaml-translator\n\nyaml-translator is a gem that translates yaml format translation files into each language.  \nThe translation method supports google translate api in built-in.\n\n[![Gem Version](https://badge.fury.io/rb/yaml-translator.svg)](https://badge.fury.io/rb/yaml-translator)\n[![Build Status](https://travis-ci.org/holyshared/yaml-translator.svg?branch=master)](https://travis-ci.org/holyshared/yaml-translator)\n[![Coverage Status](https://coveralls.io/repos/github/holyshared/yaml-translator/badge.svg?branch=master)](https://coveralls.io/github/holyshared/yaml-translator?branch=master)\n[![Code Climate](https://codeclimate.com/github/holyshared/yaml-translator/badges/gpa.svg)](https://codeclimate.com/github/holyshared/yaml-translator)\n\n## Basic usage\n\nThe method of translating the language file is as follows.\n\n```ruby\ndir = File.dirname(__FILE__)\n\ntranslator = ::YamlTranslator.create(\n  :google_translate,\n  api_key: ENV['GOOGLE_TRANSLATE_API_KEY']\n)\n\nenglish_locale = translator.file(\"#{dir}/en.yml\")\njapanese_locale = english_locale.to(:ja)\n\np japanese_locale.to_s # convert to japanese locale yaml format\np japanese_locale.save_to(dir) # Write a ja.yml\n\ngerman_locale = english_locale.to(:de)\n\np german_locale.to_s # convert to german locale yaml format\np german_locale.save_to(dir) # Write a de.yml\n```\n\n## Translation of difference\n\nThe method of translating the difference is as follows.\n\n```ruby\ndir = File.dirname(__FILE__)\n\ntranslator = ::YamlTranslator.create(\n  :google_translate,\n  api_key: ENV['GOOGLE_TRANSLATE_API_KEY']\n)\n\ndiff_locale = translator.file(\"/path/to/before/en.yml\").diff(\"/path/to/after/en.yml\")\ndiff_locale.to(:ja).save\n```\n\ntranslate into multiple languages\n\n```ruby\ndiff_locale = translator.file(\"/path/to/before/en.yml\").diff(\"/path/to/after/en.yml\")\ndiff_locale.all(%w(ja en)).each { |r| r.save }\n```\n\n## Run the test\n\n\tbundle install\n\trake spec\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fholyshared%2Fyaml-translator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fholyshared%2Fyaml-translator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fholyshared%2Fyaml-translator/lists"}