{"id":25228147,"url":"https://github.com/webtranslateit/webtranslateit","last_synced_at":"2025-04-04T07:08:49.757Z","repository":{"id":711032,"uuid":"357776","full_name":"webtranslateit/webtranslateit","owner":"webtranslateit","description":"A CLI to sync locale files with webtranslateit.com.","archived":false,"fork":false,"pushed_at":"2024-04-08T08:03:32.000Z","size":870,"stargazers_count":116,"open_issues_count":2,"forks_count":35,"subscribers_count":11,"default_branch":"main","last_synced_at":"2024-04-08T09:29:32.046Z","etag":null,"topics":["i18n","internationalization","language-files","languages","localization","ruby","sync","translations","webtranslateit","wti"],"latest_commit_sha":null,"homepage":"https://webtranslateit.com","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/webtranslateit.png","metadata":{"files":{"readme":"readme.md","changelog":"history.md","contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2009-11-02T07:49:51.000Z","updated_at":"2024-04-15T06:45:47.812Z","dependencies_parsed_at":"2023-02-16T04:46:11.211Z","dependency_job_id":"f6e6d08d-7f05-41dc-8ca1-606e50e0bc0e","html_url":"https://github.com/webtranslateit/webtranslateit","commit_stats":{"total_commits":714,"total_committers":20,"mean_commits":35.7,"dds":0.08543417366946782,"last_synced_commit":"d4f48431ab98c5efd05fc5abce5b56a46210da4a"},"previous_names":[],"tags_count":126,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webtranslateit%2Fwebtranslateit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webtranslateit%2Fwebtranslateit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webtranslateit%2Fwebtranslateit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webtranslateit%2Fwebtranslateit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/webtranslateit","download_url":"https://codeload.github.com/webtranslateit/webtranslateit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247135144,"owners_count":20889421,"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":["i18n","internationalization","language-files","languages","localization","ruby","sync","translations","webtranslateit","wti"],"created_at":"2025-02-11T09:51:32.968Z","updated_at":"2025-04-04T07:08:49.730Z","avatar_url":"https://github.com/webtranslateit.png","language":"Ruby","readme":"# WebTranslateIt Synchronization Tool : wti\n\n[![Gem Downloads](https://img.shields.io/gem/dt/web_translate_it.svg)](https://rubygems.org/gems/web_translate_it/) |\n[Report a bug](https://github.com/webtranslateit/webtranslateit/issues) |\n[Support](https://webtranslateit.com/support) |\n[WebTranslateIt.com Homepage](https://webtranslateit.com) |\n[Docker Package](https://github.com/webtranslateit/wti-docker/pkgs/container/wti-docker)\n\nwti lets you easily sync your language files with [WebTranslateIt.com](https://webtranslateit.com), a web-based tool to translation software.\n\n\u003cimg src=\"http://edouard.baconfile.com.s3.us-east-1.amazonaws.com/web_translate_it/wti4.png\" alt=\"WebTranslateIt Synchronization Tool\" width=\"500px\"\u003e\n\n### wti...\n\n* wti is a **command-line tool**. It works on all operating systems: Windows, Linux, MacOS X, ... It is also available as a [Docker package](https://github.com/webtranslateit/wti-docker/pkgs/container/wti-docker).\n* wti is really easy to use. It was inspired by git. Use `wti push` and `wti pull` to sync your language files with WebTranslateIt.com.\n\n### Optionally, wti does...\n\n* include a rack middleware you can use in your Rails app to automatically fetch new translations from WebTranslateIt.com.\n* include libraries you can use to programmatically fetch your segments from WebTranslateIt.com. See [Extras](https://github.com/webtranslateit/webtranslateit/wiki/Extras)\n* include a web interface for your translation team to update your language files. [Learn more on the web_translate_it_server project page](https://github.com/webtranslateit/web_translate_it_server).\n\n---\n\n## Installation\n\nYou will also need ruby to run `wti`. We require ruby version 3.0 or newer. On Linux or a Mac, it’s already installed. Install [RubyInstaller](http://rubyinstaller.org/) if you’re using Windows. [See detailed installation instructions for Windows users](https://github.com/webtranslateit/webtranslateit/wiki/Install-wti-on-Windows).\n\n``` bash\n$ gem install web_translate_it\nFetching: web_translate_it-3.0.2.gem (100%)\nSuccessfully installed web_translate_it-3.0.2\n1 gem installed\n```\n\nAt this point you should have the `wti` executable working:\n\n``` bash\n$ wti -v\nwti version 3.0.2\n```\n\nWe also provide `wti` as a Docker packages. [See our packages and instructions to install](https://github.com/webtranslateit/wti-docker/pkgs/container/wti-docker).\n\n## Configuration\n\nNow that `wti` is installed, you’ll have to configure your project. Basically, `wti` is to be run on a project root directory, and looks for a `.wti` file containing your project information. The command `wti init` lets your create your `.wti` file.\n\n``` bash\n$ wti init proj_pvt_V8skdjsdDDA4\n# Initializing project\n\n The project Frontend was successfully initialized.\n\nYou can now use `wti` to push and pull your language files.\nCheck `wti --help` for help.\n```\n\n`proj_pvt_V8skdjsdDDA4` is the API token, which you can find in your project settings.\n\nIf you’d like to specify another path for your configuration file, you can use `wti init`. This command will ask you to enter your project API token and where to save the configuration file (by default it will create a `.wti` in your project root directory).\n\nNow you’re all set and you can use the `wti` commands on your project.\n\n## Using on multiple projects\n\nPlease refer to [our documentation about syncing multiple projects](https://github.com/webtranslateit/webtranslateit/wiki/Using-wti-with-multiple-projects).\n\n## Usage\n\nExecute `wti --help` to see the usage:\n\n    Usage: wti \u003ccommand\u003e [options]+\n\n    The most commonly used wti commands are:\n\n      pull        Pull target language file(s)\n      push        Push master language file(s)\n      match       Display matching of local files with File Manager\n      add         Create and push a new master language file\n      addlocale   Add a new locale to the project\n      server      Start a synchronisation server\n      status      Fetch and display project statistics\n      init        Configure your project to sync      \n\n    See `wti \u003ccommand\u003e --help` for more information on a specific command.\n\n    [options] are:\n      --config, -c \u003cs\u003e:   Path to a translation.yml file (default: .wti)\n         --version, -v:   Print version and exit\n            --help, -h:   Show this message\n\nAppend `--help` for each command for more information. For instance:\n\n    $ wti push --help\n    wti push [filename] - Push master language file(s)\n    [options] are:\n      -l, --locale=\u003cs\u003e        ISO code of locale(s) to push\n      -t, --target            Upload all target files\n      -f, --force             Force push (bypass conditional requests to WTI)\n      -m, --merge             Force WTI to merge this file\n      -i, --ignore-missing    Force WTI to not obsolete missing strings\n      -n, --minor             Minor Changes. When pushing a master file, prevents\n                              target translations to be flagged as `to_verify`.\n      -a, --label=\u003cs\u003e         Apply a label to the changes\n      -c, --config=\u003cs\u003e        Path to a configuration file (default: .wti)\n      --all                   DEPRECATED -- See `wti push --target` instead\n      -d, --debug             Display debug information\n      -h, --help              Show this message\n\n## Sample Commands\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003cth\u003eCommand\u003c/th\u003e\n    \u003cth\u003eAction\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ewti add path/to/master/file.po\u003c/td\u003e\n    \u003ctd\u003eUpload a new master language file\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ewti add file1.po file2.po file3.xml\u003c/td\u003e\n    \u003ctd\u003eCreate several master language files at once, by specifying each file\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ewti add *.po\u003c/td\u003e\n    \u003ctd\u003eCreate several master language files at once, by specifying an extension\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003efind . -name \"*en.yml\" | xargs wti add\u003c/td\u003e\n    \u003ctd\u003eFind all the en.yml files and add them to the project\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ewti push\u003c/td\u003e\n    \u003ctd\u003eUpdate a master language file\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ewti push -l fr\u003c/td\u003e\n    \u003ctd\u003eUpdate a target (French) language file\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ewti push -l \"fr en da sv\"\u003c/td\u003e\n    \u003ctd\u003eUpdate several target language files at once (French, English, Danish, Swedish)\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ewti push --all\u003c/td\u003e\n    \u003ctd\u003eUpdate all language files at once\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ewti push path/to/file.yml\u003c/td\u003e\n    \u003ctd\u003ePushes the path/to/file.yml file\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ewti pull\u003c/td\u003e\n    \u003ctd\u003eDownload target language files\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ewti pull -l fr\u003c/td\u003e\n    \u003ctd\u003eDownload a specific language file (French)\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ewti pull --all\u003c/td\u003e\n    \u003ctd\u003eDownload all language files, including source\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ewti pull path/to/files/*\u003c/td\u003e\n    \u003ctd\u003eDownload all files in path/to/files\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ewti pull path/to/files/* -l fr\u003c/td\u003e\n    \u003ctd\u003eDownload all fr files in path/to/files\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ewti pull --force\u003c/td\u003e\n    \u003ctd\u003eForce pull (to bypass WebTranslateIt’s HTTP caching)\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ewti addlocale fr\u003c/td\u003e\n    \u003ctd\u003eAdd a new locale to the project\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ewti addlocale fr da sv\u003c/td\u003e\n    \u003ctd\u003eAdd several locales at once\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ewti status\u003c/td\u003e\n    \u003ctd\u003eView project translation statistics\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ewti status config/locales/app/en.yml\u003c/td\u003e\n    \u003ctd\u003eView translation statistics on file config/locales/app/en.yml\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ewti match\u003c/td\u003e\n    \u003ctd\u003eShow matching between files on local computer and the ones in WebTranslateIt’s File Manager\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n## Hooks\n\nIt is sometimes useful to hook a command or a script before or after a push or a pull. One use-case would be to launch a build after pulling language files. You can do that by implementing hooks in your `.wti` file.\n\nThere are 4 hooks:\n\n* `before_pull`\n* `after_pull`\n* `before_push`\n* `after_push`\n\nCheck the [sample `.wti`](https://github.com/webtranslateit/webtranslateit/blob/main/examples/.wti#L21-L28) file for implementation.\n\n## Exit codes\n\n`wti` returns exit codes on failure. The exit code is `0` if the command executed successfully and `1` if the command executed but encountered at least one error. This is useful to act upon errors if you use `wti` to pull files in an automated build process.\n\n``` zsh\n~/code/webtranslateit.com[master]% wti pull\n# Pulling files on WebTranslateIt\n config/locales/translation_validator/en.yml        | e82e044..e82e044  Skipped\n config/locales/app/en.yml                          | f2ca86c..f2ca86c  Skipped\n config/locales/defaults/en.yml                     | 2fcb61f..2fcb61f  Skipped\n config/locales/js/en.yml                           | ee6589d..ee6589d  Skipped\n config/locales/js/fr.yml                           | 2f8bb0e..2f8bb0e  Skipped\n config/locales/translation_validator/fr.yml        | 534af2c..534af2c  Skipped\n config/locales/app/fr.yml                          | 29f8c9d..da39a3e  OK\n config/locales/defaults/fr.yml                     | aca123e..aca123e  Skipped\nPulled 8 files at 7 files/sec, using 3 threads.\n\n~/code/webtranslateit.com[master]% echo $?\n0\n\n~/code/webtranslateit.com[master]% wti pull\n# Pulling files on WebTranslateIt\n config/locales/translation_validator/en.yml        | e82e044..e82e044  Error\n config/locales/app/en.yml                          | f2ca86c..f2ca86c  Skipped\n config/locales/defaults/fr.yml                     | aca123e..aca123e  Skipped\nPulled 3 files at 3 files/sec, using 3 threads.\n\n~/code/webtranslateit.com[master]% echo $?\n1\n```\n\n`wti status` command also returns meaningful codes. It will exit with `0` if the project is 100% translated and proofread, `100` if the project is not 100% translated and `101` if the project is not 100% proofread. This could allow you to check if a project is 100% translated or completed before deploying a project.\n\n``` zsh\n~/Desktop/test% wti status\n# Gathering information on test ts\nfr: 40% translated, 40% completed.\nen: 90% translated, 0% completed.\n\n~/Desktop/test% echo $?\n100\n\n~/Desktop/test% wti status\n# Gathering information on test ts\nen: 100% translated, 0% completed.\nfr: 100% translated, 100% completed.\n\n~/Desktop/test% echo $?\n101\n\n~/Desktop/test% wti status\n# Gathering information on test ts\nen: 100% translated, 100% completed.\nfr: 100% translated, 100% completed.\n\n~/Desktop/test% echo $?   \n0\n```\n\n# License\n\nCopyright (c) 2009-2024 [WebTranslateIt Software S.L](https://webtranslateit.com), released under the MIT License.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebtranslateit%2Fwebtranslateit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebtranslateit%2Fwebtranslateit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebtranslateit%2Fwebtranslateit/lists"}