{"id":19493383,"url":"https://github.com/i18next/jquery-i18next","last_synced_at":"2025-05-16T19:00:28.645Z","repository":{"id":57282155,"uuid":"46261098","full_name":"i18next/jquery-i18next","owner":"i18next","description":"jQuery-i18next is a jQuery based Javascript internationalization library on top of i18next. It helps you to easily internationalize your web applications.","archived":false,"fork":false,"pushed_at":"2023-05-23T15:26:11.000Z","size":3679,"stargazers_count":173,"open_issues_count":2,"forks_count":82,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-05-12T19:20:00.584Z","etag":null,"topics":["i18n","i18next","internationalization","javascript","jquery","jquery-i18n","jquery-plugin","translation"],"latest_commit_sha":null,"homepage":"https://locize.com/blog/jquery-i18next/","language":"HTML","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/i18next.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":"2015-11-16T08:16:18.000Z","updated_at":"2025-05-10T23:29:49.000Z","dependencies_parsed_at":"2024-06-18T12:39:19.422Z","dependency_job_id":"d271743e-c9b5-41cc-b39f-08abfe6ca532","html_url":"https://github.com/i18next/jquery-i18next","commit_stats":{"total_commits":76,"total_committers":11,"mean_commits":6.909090909090909,"dds":0.25,"last_synced_commit":"7be87139dfbcd74de7587cab8c9ae7bafac86282"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i18next%2Fjquery-i18next","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i18next%2Fjquery-i18next/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i18next%2Fjquery-i18next/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i18next%2Fjquery-i18next/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/i18next","download_url":"https://codeload.github.com/i18next/jquery-i18next/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254592367,"owners_count":22097010,"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","i18next","internationalization","javascript","jquery","jquery-i18n","jquery-plugin","translation"],"created_at":"2024-11-10T21:25:40.104Z","updated_at":"2025-05-16T19:00:28.609Z","avatar_url":"https://github.com/i18next.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Introduction\n\nSource can be loaded via [npm](https://www.npmjs.com/package/jquery-i18next), bower or [downloaded](https://github.com/i18next/jquery-i18next/blob/master/jquery-i18next.min.js) from this repo or from a CDN like [CDNJS](https://cdnjs.com/libraries/jquery-i18next).\n\n--------------\n**NEWS: localization as a service - locize.com**\n\nNeeding a translation management? Want to edit your translations with an InContext Editor? Use the orginal provided to you by the maintainers of i18next!\n\n![locize](https://camo.githubusercontent.com/da390a7a7e25592b49d672b46924146fcddcf5618219a3c533edbfbd3f8b833c/68747470733a2f2f6c6f63697a652e636f6d2f696d672f6164732f6769746875625f6c6f63697a652e706e67)\n\nWith using [locize](http://locize.com/?utm_source=jquery_i18next_readme\u0026utm_medium=github) you directly support the future of i18next and react-i18next.\n\n--------------\n\n## Advice:\n\nTo see jquery-i18next in a working app example, check out [this blog post](https://locize.com/blog/jquery-i18next/) and [this example](https://github.com/i18next/jquery-i18next/tree/master/example/landing).\n\n--------------\n\nIf you don't use a module loader it will be added to window.jqueryI18next\n\n```\n# npm package\n$ npm install jquery-i18next\n\n# bower\n$ bower install jquery-i18next\n```\n\nSimplifies i18next usage in projects built based on jquery, like:\n\npage source:\n\n```html\n\u003cul class=\"nav\"\u003e\n  \u003cli\u003e\u003ca href=\"#\" data-i18n=\"nav.home\"\u003e\u003c/a\u003e\u003c/li\u003e\n  \u003cli\u003e\u003ca href=\"#\" data-i18n=\"nav.page1\"\u003e\u003c/a\u003e\u003c/li\u003e\n  \u003cli\u003e\u003ca href=\"#\" data-i18n=\"nav.page2\"\u003e\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n```\n\nloaded resource file (locales/en/translation.json):\n\n```json\n{\n  \"nav\": {\n    \"home\": \"Home\",\n    \"page1\": \"Page One\",\n    \"page2\": \"Page Two\"\n  }\n}\n```\n\njavascript code:\n\n```js\n$(\".nav\").localize();\n\n// results in\n// \u003cul class=\"nav\"\u003e\n//  \u003cli\u003e\u003ca href=\"#\" data-i18n=\"nav.home\"\u003eHome\u003c/a\u003e\u003c/li\u003e\n//  \u003cli\u003e\u003ca href=\"#\" data-i18n=\"nav.page1\"\u003ePage One\u003c/a\u003e\u003c/li\u003e\n//  \u003cli\u003e\u003ca href=\"#\" data-i18n=\"nav.page2\"\u003ePage Two\u003c/a\u003e\u003c/li\u003e\n// \u003c/ul\u003e\n```\n\n## Initialize the plugin\n\n```js\njqueryI18next.init(i18nextInstance, $, {\n  tName: 't', // --\u003e appends $.t = i18next.t\n  i18nName: 'i18n', // --\u003e appends $.i18n = i18next\n  handleName: 'localize', // --\u003e appends $(selector).localize(opts);\n  selectorAttr: 'data-i18n', // selector for translating elements\n  targetAttr: 'i18n-target', // data-() attribute to grab target element to translate (if different than itself)\n  optionsAttr: 'i18n-options', // data-() attribute that contains options, will load/set if useOptionsAttr = true\n  useOptionsAttr: false, // see optionsAttr\n  parseDefaultValueFromContent: true // parses default values from content ele.val or ele.text\n});\n```\n\n## using options in translation function\n\n```js\n\u003ca id=\"btn1\" href=\"#\" data-i18n=\"myKey\"\u003e\u003c/a\u003e\n$(\"#btn1\").localize(options);\n```\n\nor\n\n```js\n\u003ca id=\"btn1\" href=\"#\" data-i18n=\"myKey\" data-i18n-options='{ \"a\": \"b\" }'\u003e\u003c/a\u003e\n$(\"#btn1\").localize();\n// make sure you set the useOptionsAttr option to true if you want to pass the i18n options via data-i18n-options attribute.\n```\n\n`data-i18n-options` attribute must be a valid JSON object.\n\n## usage of selector function\n\n### translate an element\n\n```js\n\u003ca id=\"btn1\" href=\"#\" data-i18n=\"myKey\"\u003e\u003c/a\u003e\n$(\"#btn1\").localize(options);\n```\n\nmyKey: same key as used in i18next (optionally with namespaces)\noptions: same options as supported in i18next.t\n\n### translate children of an element\n\n```js\n\u003cul class=\"nav\"\u003e\n  \u003cli\u003e\u003ca href=\"#\" data-i18n=\"nav.home\"\u003e\u003c/a\u003e\u003c/li\u003e\n  \u003cli\u003e\u003ca href=\"#\" data-i18n=\"nav.page1\"\u003e\u003c/a\u003e\u003c/li\u003e\n  \u003cli\u003e\u003ca href=\"#\" data-i18n=\"nav.page2\"\u003e\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n$(\".nav\").localize();\n```\n\n### translate some inner element\n```js\n\u003cdiv class=\"outer\" data-i18n=\"ns:key\" data-i18n-target=\".inner\"\u003e\n  \u003cinput class=\"inner\" type=\"text\"\u003e\u003c/input\u003e\n\u003c/div\u003e\n$(\".outer\").localize();\n```\n\n### set different attribute\n```js\n\u003ca id=\"btn1\" href=\"#\" data-i18n=\"[title]key.for.title\"\u003e\u003c/a\u003e\n$(\"#btn1\").localize();\n```\n\n### set multiple attributes\n```js\n\u003ca id=\"btn1\" href=\"#\" data-i18n=\"[title]key.for.title;myNamespace:key.for.text\"\u003e\u003c/a\u003e\n$(\"#btn1\").localize();\n```\n\n### set innerHtml attributes\n```js\n\u003ca id=\"btn1\" href=\"#\" data-i18n=\"[html]key.for.title\"\u003e\u003c/a\u003e\n$(\"#btn1\").localize();\n```\n\n### prepend content\n```js\n\u003ca id=\"btn1\" href=\"#\" data-i18n=\"[prepend]key.for.title\"\u003einsert before me, please!\u003c/a\u003e\n$(\"#btn1\").localize();\n```\n\n### append content\n```js\n\u003ca id=\"btn1\" href=\"#\" data-i18n=\"[append]key.for.title\"\u003eappend after me, please!\u003c/a\u003e\n$(\"#btn1\").localize();\n```\n\n### set data\n```js\n\u003ca id=\"btn1\" href=\"#\" data-i18n=\"[data-someDataAttribute]key.for.content\"\u003e\u003c/a\u003e\n$(\"#btn1\").localize();\n```\n\n--------------\n\n\u003ch3 align=\"center\"\u003eGold Sponsors\u003c/h3\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://locize.com/\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/i18next/i18next/master/assets/locize_sponsor_240.gif\" width=\"240px\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fi18next%2Fjquery-i18next","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fi18next%2Fjquery-i18next","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fi18next%2Fjquery-i18next/lists"}