{"id":16092823,"url":"https://github.com/dleitee/crates","last_synced_at":"2025-08-06T15:15:53.747Z","repository":{"id":29970027,"uuid":"123357067","full_name":"dleitee/crates","owner":"dleitee","description":"🌎 A tool to generate your locale files compatible with i18n.","archived":false,"fork":false,"pushed_at":"2024-03-03T01:00:20.000Z","size":1037,"stargazers_count":52,"open_issues_count":18,"forks_count":5,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-07T20:12:14.173Z","etag":null,"topics":["cli","crates","i18n","internationalization","locale","locales"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dleitee.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"publiccode":null,"codemeta":null}},"created_at":"2018-02-28T23:55:55.000Z","updated_at":"2023-08-24T15:02:37.000Z","dependencies_parsed_at":"2024-10-06T16:56:54.699Z","dependency_job_id":"836a4868-c560-4200-bfbf-0a2fb6123ee0","html_url":"https://github.com/dleitee/crates","commit_stats":{"total_commits":62,"total_committers":4,"mean_commits":15.5,"dds":"0.30645161290322576","last_synced_commit":"18b2a7e6e5d75c3b7118bca64236d4ec2396ff01"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dleitee%2Fcrates","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dleitee%2Fcrates/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dleitee%2Fcrates/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dleitee%2Fcrates/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dleitee","download_url":"https://codeload.github.com/dleitee/crates/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243806070,"owners_count":20350775,"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":["cli","crates","i18n","internationalization","locale","locales"],"created_at":"2024-10-09T16:44:11.865Z","updated_at":"2025-03-16T08:32:23.211Z","avatar_url":"https://github.com/dleitee.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./crates.jpg\"\u003e\n\u003c/p\u003e\n\n# Crates\n\nCrates is a library that allows you to generate internationalization's files for any language you need using only a command.\n\nIt's perfect for sites that need to be translated into another language, you only need to call the **crates'** function adding the desired words and then execute the CLI command.\n\nThe **crates'** function is used as a marker for the library and just returns the string passed as an argument.\n\n## Install\n\nWith npm:\n\n```bash\n$ npm install --save crates\n```\n\nWith Yarn:\n\n```bash\n$ yarn add crates\n```\n\n## How it works\n\nFirst, you need to check which words you want to translate and then you can use the crates' function like in the code below:\n\n```es6\nimport _ from 'crates'\n\nconsole.log(_('Hello World'))\n```\n\nIf you run this code, it will print:\n\n```bash\n$ node code.js\nHello World\n```\n\nThat means the function by itself don't do anything, only returns its first argument.\n\nBut, after executing the CLI as shown below:\n\n```bash\n$ npx crates create --lang 'es,pt' --glob '**/*.js'\n```\n\nThe library will create the `internationalization` files into the `/translations` directory.\n\n```bash\n$ l translations\ntotal 32\ndrwxr-xr-x  6 danieloliveira  staff   192B Feb 22 08:35 .\ndrwxr-xr-x  7 danieloliveira  staff   224B Feb 20 21:56 ..\n-rw-r--r--  1 danieloliveira  staff   154B Feb 22 08:35 translation.es.json\n-rw-r--r--  1 danieloliveira  staff   129B Feb 22 08:35 translation.pt.json\n\n$ cat translations/translation.es.json\n{\n\t\"Hello World\": \"Hello World\"\n}\n```\n\nThese files are compatible with those plugins:\n\n| Plugin                  | Link                                                             |\n| ----------------------- | ---------------------------------------------------------------- |\n| **i18next**             | [Github](https://github.com/i18next/i18next)                     |\n| **i18n-webpack-plugin** | [Github](https://github.com/webpack-contrib/i18n-webpack-plugin) |\n| **rollup-plugin-i18n**  | [Github](https://github.com/phamtm/rollup-plugin-i18n)           |\n| **gulp-i18n**           | [Github](https://github.com/ciclo-pe/gulp-i18n)                  |\n\nIf you know some another plugin, please, let me know.\n\n## Contributing\n\n1. Fork it!\n1. Create your feature branch: `git checkout -b my-new-feature`\n1. Commit your changes: `git commit -m 'Add some feature'`\n1. Push to the branch: `git push origin my-new-feature`\n1. Submit a pull request :)\n\nor\n\n**Feel free to open an issue.**\n\n## License\n\nThe MIT License (MIT)\n\nCopyright (c) 2018 Daniel Leite de Oliveira\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdleitee%2Fcrates","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdleitee%2Fcrates","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdleitee%2Fcrates/lists"}