{"id":42304742,"url":"https://github.com/futuweb/webpack-amdi18n-loader","last_synced_at":"2026-01-27T11:03:34.503Z","repository":{"id":57149125,"uuid":"44247615","full_name":"futuweb/webpack-amdi18n-loader","owner":"futuweb","description":"webpack i18n loader like require.js i18n plugin","archived":false,"fork":false,"pushed_at":"2023-08-03T06:37:50.000Z","size":154,"stargazers_count":23,"open_issues_count":4,"forks_count":19,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-16T08:42:30.225Z","etag":null,"topics":["i18n","loader","webpack","webpack-loader"],"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/futuweb.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":"2015-10-14T12:58:06.000Z","updated_at":"2024-11-19T08:23:01.000Z","dependencies_parsed_at":"2024-06-18T17:11:46.491Z","dependency_job_id":null,"html_url":"https://github.com/futuweb/webpack-amdi18n-loader","commit_stats":null,"previous_names":["toobug/webpack-amdi18n-loader"],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/futuweb/webpack-amdi18n-loader","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/futuweb%2Fwebpack-amdi18n-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/futuweb%2Fwebpack-amdi18n-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/futuweb%2Fwebpack-amdi18n-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/futuweb%2Fwebpack-amdi18n-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/futuweb","download_url":"https://codeload.github.com/futuweb/webpack-amdi18n-loader/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/futuweb%2Fwebpack-amdi18n-loader/sbom","scorecard":{"id":414905,"data":{"date":"2025-08-11","repo":{"name":"github.com/futuweb/webpack-amdi18n-loader","commit":"91c5a31839faebb01e5263775200048d12820fc3"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.4,"checks":[{"name":"Code-Review","score":2,"reason":"Found 6/21 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/test.yaml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yaml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/futuweb/webpack-amdi18n-loader/test.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yaml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/futuweb/webpack-amdi18n-loader/test.yaml/master?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/test.yaml:24","Warn: npmCommand not pinned by hash: .github/workflows/test.yaml:29","Warn: npmCommand not pinned by hash: .github/workflows/test.yaml:31","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   3 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 16 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"12 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-2j2x-2gpw-g8fm","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-76p3-8jx3-jpfq","Warn: Project is vulnerable to: GHSA-3rfm-jhwj-7488","Warn: Project is vulnerable to: GHSA-hhq3-ff78-jv3g","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-18T23:34:54.924Z","repository_id":57149125,"created_at":"2025-08-18T23:34:54.924Z","updated_at":"2025-08-18T23:34:54.924Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28812367,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T07:41:26.337Z","status":"ssl_error","status_checked_at":"2026-01-27T07:41:08.776Z","response_time":168,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","loader","webpack","webpack-loader"],"created_at":"2026-01-27T11:03:27.125Z","updated_at":"2026-01-27T11:03:34.498Z","avatar_url":"https://github.com/futuweb.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# amdi18n-loader\n\n[![Travis branch](https://img.shields.io/travis/futuweb/webpack-amdi18n-loader/master.svg)](https://travis-ci.org/futuweb/webpack-amdi18n-loader)\n[![npm](https://img.shields.io/npm/v/amdi18n-loader.svg)](https://npmjs.com/package/amdi18n-loader)\n\n[中文文档](./README_zh.md)\n\nWebpack i18n loader helps your projects to process internationalization (i18n).\n\nIt's quite similar to require.js i18n plugin.\n\nFeatures:\n\n- Fully compatitable with webpack 1/2/3/4\n- Works with language packages. (similar to require.js)\n- Support CommonJS/AMD/ESM module and `.json` files, and more, `.coffee` files\n- Auto init current language via `html[lang]` attribute, global varible or browser/system settings\n- Switch current language at runtime\n- Enable/Disable language packages via queries\n\n## Install\n\n```sh\nnpm install amdi18n-loader\n```\n\n## Usage\n\nFirst look at require.js i18n plugin's docs [here](http://requirejs.org/docs/api.html#i18n).\n\nThe structure of language packages are like this:\n\n- `lang.js`\n- `zh-cn/lang.js`\n- `zh-hk/lang.js`\n\nlang.js:\n\n```javascript\ndefine({\n    // root means the common language package\n    root:{\n        HELLO:'hello'\n    },\n    // we have the language packages below:\n    'zh-cn':true,\n    'zh-hk':true\n});\n```\n\nzh-cn/lang.js example:\n\n```javascript\ndefine({\n    // please note: no wrapper object here!\n    HELLO:'hello in zh-cn'\n});\n```\n\nThen use it like this:\n\n```javascript\ndefine([\n    'amdi18n-loader!lang'\n],function(amdi18n){\n\n    // By default, it will lookup `window._i18n.locale`,\n    //\n    // If not found, it will try to use the html[lang] attribute,\n    // For example: \u003chtml lang=\"en\"\u003e then language `en` was used,\n    //\n    // If still not found, it will try to use browser/system settings\n    //     navigator.languages[0] || navigator.language || navigator.userLanguage (.toLowerCase())\n    //\n    // If nothing found, `root` was used.\n    //\n    // You can manully change the language by\n    // `amdi18n.init(language)`;\n\n    console.log(amdi18n.HELLO);\n\n\n});\n```\n\n## Advanced Usage\n\n### Enable/Disable language packages\n\nYou can pass queries to enable or disable some langs.\n\n```javascript\n// We use commonjs now. It matters nothing.\nvar lang = require('amdi18n-loader?enable=[zh-cn]!');\n\n// It's not ok to use zh-hk now!\nlang.init('zh-hk');\n```\n\nThe code below behaviors the same:\n\n```javascript\n// We use commonjs now. It matters nothing.\n// Notice: we use `|` to as separator,\n// Because webpack will break the comma.\nvar lang = require('amdi18n-loader?disable=[zh-hk|en-us]!');\n\n// It's not ok to use zh-hk now!\nlang.init('zh-hk');\n```\n\nIt's ok to use both `enable` and `disable`, but if any one disables a lang, the lang will not be usable. You can decide which to use by the length of list.\n\n### Expose Root Object\n\nIn some case, accessing `root` object is required (#19). You can pass a query `expose-root` to expose the `root` object.\n\n```javascript\nrequire('amdi18n-loader?expose-root=1!')\n```\n\n## Notice\n\nIf you choose to use `.json` files as your lang files in webpack 4+, You need to specify the type of json files, otherwise webpack will try to parse the final script content as JSON, and throws errors.\n\n```javascript\n// in module.rules\n{\n    // to avoid affecting other json files\n    // you'd better specify the lang files only,\n    test: /\\.json$/,\n    type: 'javascript/auto'\n},\n```\n\n## History\n\n### v0.9.4 (2022-09-14)\n\n- Fallback: Add support for nested objects. [#35](https://github.com/futuweb/webpack-amdi18n-loader/pull/35) (By cavic19)\n\n### v0.9.3 (2019-06-28)\n\n- update `mocha` in `devDependencies`. [#32](https://github.com/futuweb/webpack-amdi18n-loader/issues/32) (By umar-khan)\n- Fix: `false` value of a language key in root file ignored. [#33](https://github.com/futuweb/webpack-amdi18n-loader/issues/32) (By dlangerenken)\n\n### v0.9.2 (2019-02-12)\n\n- allows `export default{` without whitespace in ESM module lang files. [#30](https://github.com/futuweb/webpack-amdi18n-loader/issues/30) (By dlangerenken)\n\n### v0.9.1 (2018-12-17)\n\n- Fix: `navigator.languages` not exists on IE. [#28](https://github.com/futuweb/webpack-amdi18n-loader/issues/28) (By gitgrimbo)\n\n### v0.9.0 (2018-12-14)\n\n- Read language settings from `navigator.languages` `navigator.language` and `navigator.userLanguage`. [#25](https://github.com/futuweb/webpack-amdi18n-loader/issues/25)\n- Support using in Node environment. [#26](https://github.com/futuweb/webpack-amdi18n-loader/issues/26) (By gitgrimbo)\n\n### v0.8.0 (2018-07-01)\n\n- Support webpack 4.\n- Support ESM modules in lang files. (`export default {}`). [#16](https://github.com/futuweb/webpack-amdi18n-loader/issues/16)\n- Add a config to expose the `root` object. [#19](https://github.com/futuweb/webpack-amdi18n-loader/issues/19)\n- Support using in global config (e.g. `webpack.config.js`) and passing options.\n- Better auto test for Node 7/8/10 and webpack 1/2/3/4.\n\n### v0.7.0 (2018-03-20)\n\n- Support functions in lang files. [#20](https://github.com/futuweb/webpack-amdi18n-loader/issues/20) (By ggriffithsIDBS)\n\n### v0.6.2 (2017-10-16)\n\n- Fix: failed to fallback to root. [#17](https://github.com/futuweb/webpack-amdi18n-loader/issues/17)\n\n### v0.6.1 (2017-06-29)\n\n- Add lang files to webpack dependencies, so they can be watched and live-reloaded. See [#15](https://github.com/futuweb/webpack-amdi18n-loader/issues/15). (By jou)\n\n### v0.6.0 (2017-06-11)\n\n- Add a type of format support (for require.js i18n plugin). See [#14](https://github.com/futuweb/webpack-amdi18n-loader/issues/14).\n\n### v0.5.2 (2017-02-07)\n\n- Fix: multi values in `enable` / `disable` queries invalid. [#10](https://github.com/futuweb/webpack-amdi18n-loader/issues/10)\n- If a lang specified in `enable`, no longer required to specify in root.\n\n### v0.5.1 (2017-01-14)\n\n- Fix: AMD lang file without factory function not working. [#8](https://github.com/futuweb/webpack-amdi18n-loader/issues/8)\n\n### v0.5.0 (2017-01-13)\n\n- Add `enable` and `disable` queries. [#6](https://github.com/futuweb/webpack-amdi18n-loader/issues/7)\n- Detect default language by html[lang] attribute. [#7](https://github.com/futuweb/webpack-amdi18n-loader/issues/7)\n- Rewrite the method that extract language definitions.\n- Add testing \u0026 travis CI.\n\n### v0.4.0 (2016-01-18)\n\n- Support `.coffee` language files. (By Mullerzs)\n\n### v0.3.2 (2015-12-15)\n\n- Fix bug using in UMD mode. (By Rick)\n\n### v0.3.1 (2015-12-15)\n\n- Fix bug on IE. (By Rick)\n\n### v0.3.0 (2015-12-14)\n\n- Support load CommonJS module and json file. (By Rick)\n\n### v0.2.0 (2015-10-15)\n\n- Auto init.\n\n### v0.1.0 (2015-10-14)\n\n- First release.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffutuweb%2Fwebpack-amdi18n-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffutuweb%2Fwebpack-amdi18n-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffutuweb%2Fwebpack-amdi18n-loader/lists"}