{"id":26045375,"url":"https://github.com/zigomir/transync","last_synced_at":"2025-04-10T11:12:17.921Z","repository":{"id":7243169,"uuid":"8553280","full_name":"zigomir/transync","owner":"zigomir","description":"Sync xliff and gdoc translations","archived":false,"fork":false,"pushed_at":"2015-05-30T08:56:56.000Z","size":280,"stargazers_count":7,"open_issues_count":2,"forks_count":7,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-05T04:39:00.136Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/zigomir.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-03-04T10:27:36.000Z","updated_at":"2022-12-02T18:51:45.000Z","dependencies_parsed_at":"2022-07-08T00:30:39.396Z","dependency_job_id":null,"html_url":"https://github.com/zigomir/transync","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zigomir%2Ftransync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zigomir%2Ftransync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zigomir%2Ftransync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zigomir%2Ftransync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zigomir","download_url":"https://codeload.github.com/zigomir/transync/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248208563,"owners_count":21065202,"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":[],"created_at":"2025-03-07T19:52:54.671Z","updated_at":"2025-04-10T11:12:17.898Z","avatar_url":"https://github.com/zigomir.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Install\n\n```bash\ngem install transync\n```\n\nYou need settings file to be named `transync.yml` and to be in same directory from which we are running `transync` command.\nFor example see `transync.SAMPLE.yml`.\n\n## Google Drive OAuth\n\nYou'll need to create an API project for Google Drive. Good instructions are written\n[here](https://github.com/google/google-api-ruby-client-samples/tree/master/drive#enable-the-drive-api).\nJust copy and paste `client_id` and `client_secret` into `transync.yml` file.\n\n## Assumptions\n\nYou have xliff files in one directory (I suggest `app/Resources/translations`), named like: `common.en.xliff` where `common`\nis name of the file and also GDoc `spreadsheet tab`. `en` is language and you have GDoc with structure where\nfirst row is `key`, `language 1`, `language 2`, ...\n\n## How does it work?\n\nUpdating GDoc from our xliff files. It won't delete any key, it will only add new or change existing ones. Same\nfor direction from GDoc to xliff.\n\n### Process\n\n- Create new Google Doc Spreadsheet\n- Copy it's `key` from URL to `transync.yml`\n- Set all the languages and `xliff` files (without language) you want to sync in `transync.yml` (look at `transync.SAMPLE.yml`)\n- set `XLIFF_FILES_PATH` to set path where are your `xliff` files. In project do it with relative path so others can use it\n- set `MISSING_TRANSLATION_TEXT` to set what text should go to `target` element for translation\n- run these commands respectively\n\n### Running order\n\n```\ntransync test   # test if all keys are set for all the languages. Also tests if everything in sync with GDoc\ntransync update # will test and add all the missing keys that are not presented for a particular language in XLIFF files\ntransync init   # will write all translations from XLIFF to GDoc spreadsheet. You need to run update command first, to ensure no keys are missing\n\n# After init was made you have these two to sync modes between Gdoc and XLIFF\ntransync x2g\ntransync g2x\n```\n\n### Gem development\n\n#### Running tests\n```\nruby g2x_spec.rb\nruby x2g_spec.rb\nruby update_spec.rb\n```\n\n## TODO\n\n- use ruby's 2.0 named parameters (more clear method calls)\n- better tests (move out network dependency -\u003e maybe try VCR, run all tests with RAKE)\n- add to travis / code climate\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzigomir%2Ftransync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzigomir%2Ftransync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzigomir%2Ftransync/lists"}