{"id":21177427,"url":"https://github.com/betsol/sails-hook-i18n-fragment","last_synced_at":"2025-05-07T12:13:28.798Z","repository":{"id":143907354,"uuid":"39334720","full_name":"betsol/sails-hook-i18n-fragment","owner":"betsol","description":"A hook for Sails.js to support localization using fragments","archived":false,"fork":false,"pushed_at":"2015-07-19T13:52:57.000Z","size":124,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-07T12:13:23.161Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/betsol.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-19T13:30:35.000Z","updated_at":"2017-06-01T16:47:01.000Z","dependencies_parsed_at":"2023-03-21T10:11:57.114Z","dependency_job_id":null,"html_url":"https://github.com/betsol/sails-hook-i18n-fragment","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/betsol%2Fsails-hook-i18n-fragment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/betsol%2Fsails-hook-i18n-fragment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/betsol%2Fsails-hook-i18n-fragment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/betsol%2Fsails-hook-i18n-fragment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/betsol","download_url":"https://codeload.github.com/betsol/sails-hook-i18n-fragment/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252873888,"owners_count":21817715,"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":"2024-11-20T17:16:01.900Z","updated_at":"2025-05-07T12:13:28.777Z","avatar_url":"https://github.com/betsol.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# i18n fragment hook for Sails.js\n\n[![npm version](https://badge.fury.io/js/sails-hook-i18n-fragment.svg)][repo-npm]\n\n\nA special hook for Sails.js to support localization using fragments instead of strings.\nFragments are stored in the Markdown format and could be included into your views using locale aware function.\n\n\n## Usage\n\nInstall hook via npm: `npm install --save sails-hook-i18n-fragment`.\n\nCreate the following files in your project:\n\n- /locale/fragments/en/foo.md\n- /locale/fragments/de/foo.md\n- /locale/fragments/ru/foo.md\n\nCall the following function inside of your template: `fragment('foo')`.\nIt will output the fragment according to active locale.\nLocale is determined by original `i18n` hook (the `node-i18n` library), which is required.\n\nYou can use a complex file structure if you want to:\n\n- /locale/fragments/en/the/part/of/my/app/fragment.md\n\n`fragment('the.part.of.my.app.fragment')`.\n\nYou can change the base path using the `path` configuration option:\n\n```javascript\n# config/i18n.js\nmodule.exports['i18n-fragment'] = {\n  path: 'my-fragments/{locale}/{path}.md'\n};\n```\n\n\n## Changelog\n\nPlease see the [complete changelog][changelog] for list of changes.\n\n\n## Contributors\n\nThis library was made possible by [it's contributors][contributors].\n\n\n## Developer guide\n\nFork, clone, create a feature branch, commit, create a PR.\n\n\n## Feedback\n\nIf you have found a bug or have another issue with the library —\nplease [create an issue][new-issue].\n\nIf you have a question regarding the library or it's integration with your project —\nconsider asking a question at [StackOverflow][so-ask] and sending me a\nlink via [E-Mail][email]. I will be glad to help.\n\nHave any ideas or propositions? Feel free to contact me by [E-Mail][email].\n\nCheers!\n\n\n## Support\n\nIf you like this library consider to add star on [GitHub repository][repo-gh]\nand on [NPM][repo-npm].\n\nThank you!\n\n\n## License\n\nThe MIT License (MIT)\n\nCopyright (c) 2015 Slava Fomin II, BETTER SOLUTIONS\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n\n  [changelog]: changelog.md\n  [contributors]: https://github.com/betsol/sails-hook-i18n-fragment/graphs/contributors\n  [so-ask]: http://stackoverflow.com/questions/ask?tags=sails,node.js\n  [email]: mailto:s.fomin@betsol.ru\n  [new-issue]: https://github.com/betsol/sails-hook-i18n-fragment/issues/new\n  [repo-gh]: https://github.com/betsol/sails-hook-i18n-fragment\n  [repo-npm]: https://www.npmjs.com/package/sails-hook-i18n-fragment\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbetsol%2Fsails-hook-i18n-fragment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbetsol%2Fsails-hook-i18n-fragment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbetsol%2Fsails-hook-i18n-fragment/lists"}