{"id":21433218,"url":"https://github.com/cdwv/i18next","last_synced_at":"2025-03-16T22:42:51.111Z","repository":{"id":78214523,"uuid":"61012836","full_name":"cdwv/i18next","owner":"cdwv","description":null,"archived":false,"fork":false,"pushed_at":"2016-06-13T06:36:40.000Z","size":324,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-01-23T08:44:32.117Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cdwv.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-06-13T06:35:16.000Z","updated_at":"2016-06-13T06:36:41.000Z","dependencies_parsed_at":"2023-05-25T18:46:12.574Z","dependency_job_id":null,"html_url":"https://github.com/cdwv/i18next","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdwv%2Fi18next","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdwv%2Fi18next/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdwv%2Fi18next/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdwv%2Fi18next/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cdwv","download_url":"https://codeload.github.com/cdwv/i18next/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243945526,"owners_count":20372893,"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-22T23:26:43.800Z","updated_at":"2025-03-16T22:42:51.090Z","avatar_url":"https://github.com/cdwv.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Introduction\n\n[![Build Status](https://secure.travis-ci.org/jamuhl/i18next-node.png)](http://travis-ci.org/jamuhl/i18next-node)\n\nProject goal is to provide the same easy way to translate a website on serverside like in \n[i18next](https://github.com/jamuhl/i18next) on the clientside:\n\n- Translation inside your server code or template\n- loading resourcefiles\n- update resourcefiles with missing strings\n- interpolation, plurals, nesting or resources\n- serve the same resources to the clientside\n\n# installation\n\n\tnpm install i18next\n\n# usage\n\nFirst require the module and init i18next:\n\n\tvar i18next = require('i18next');\n\ti18next.init(); // for options see i18next-node gh-page\n\nRegister the express middleware, so we can check current language settings:\n\n\t// Configuration\n\tapp.configure(function() {\n\t    app.use(express.bodyParser());\n\t    app.use(i18next.handle);\n\t    app.use(app.router);\n\n\t    [...]\n\t});\n\nRegister AppHelper so you can use the translate function in your template:\n\n\ti18next.registerAppHelper(app)\n\nNow you can (depending on your template language) do something like this in you template:\n\n\t// sample in jade\n\tbody\n        span= t('app.name')\n\nTo serve the clientside script and needed routes for resources and missing keys:\n\n\ti18next.serveClientScript(app)\n\t    .serveDynamicResources(app)\n\t    .serveMissingKeyRoute(app);\n\nnow you can add the script to you page and use i18next on the client like on the server:\n\n\tscript(src='i18next/i18next.js', type='text/javascript')\n\n    $.i18n.init([options], function() { \n        $('#appname').text($.t('app.name'));\n    });\n\nfor more information on clientside usage have a look at [i18next](http://jamuhl.github.com/i18next/)\n\n# sample\n\n- [i18next-node_Sample](https://github.com/jamuhl/i18next-node/tree/master/sample)\n\n# License\n\nCopyright (c) 2014 Jan Mühlemann\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.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdwv%2Fi18next","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcdwv%2Fi18next","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdwv%2Fi18next/lists"}