{"id":23410410,"url":"https://github.com/guitarneck/jstrings-localization","last_synced_at":"2026-05-16T18:36:56.260Z","repository":{"id":57286470,"uuid":"121008776","full_name":"guitarneck/jstrings-localization","owner":"guitarneck","description":"Javascript localisation class for both Node.js and Web browsers.","archived":false,"fork":false,"pushed_at":"2019-04-22T16:28:28.000Z","size":424,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-10T03:15:19.436Z","etag":null,"topics":["browser","javascript","jstrings","jstrings-localization","localisation","localization","node","node-js","nodejs","strings","translation"],"latest_commit_sha":null,"homepage":"","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/guitarneck.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}},"created_at":"2018-02-10T11:13:44.000Z","updated_at":"2019-04-22T16:28:30.000Z","dependencies_parsed_at":"2022-09-20T01:03:07.518Z","dependency_job_id":null,"html_url":"https://github.com/guitarneck/jstrings-localization","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/guitarneck/jstrings-localization","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guitarneck%2Fjstrings-localization","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guitarneck%2Fjstrings-localization/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guitarneck%2Fjstrings-localization/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guitarneck%2Fjstrings-localization/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/guitarneck","download_url":"https://codeload.github.com/guitarneck/jstrings-localization/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guitarneck%2Fjstrings-localization/sbom","scorecard":{"id":448958,"data":{"date":"2025-08-11","repo":{"name":"github.com/guitarneck/jstrings-localization","commit":"e86b21924c1a6a21440b177e09ee53a2a9bbe794"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/7 approved changesets -- score normalized to 0","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":"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":"Dangerous-Workflow","score":-1,"reason":"no workflows found","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":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"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":"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":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"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":-1,"reason":"no dependencies found","details":null,"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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"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":"Vulnerabilities","score":0,"reason":"71 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-8w4h-3cm3-2pm2","Warn: Project is vulnerable to: GHSA-pp7h-53gx-mx7r","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-cwfw-4gq5-mrqx","Warn: Project is vulnerable to: GHSA-g95f-p29q-9xw4","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-rq8g-5pc5-wrhr","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-h6ch-v84p-w6p9","Warn: Project is vulnerable to: GHSA-qrmc-fj45-qfc2","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-q42p-pg8m-cqh6","Warn: Project is vulnerable to: GHSA-w457-6q6x-cgp9","Warn: Project is vulnerable to: GHSA-62gr-4qp9-h98f","Warn: Project is vulnerable to: GHSA-f52g-6jhx-586p","Warn: Project is vulnerable to: GHSA-2cf5-4w76-r9qv","Warn: Project is vulnerable to: GHSA-3cqr-58rm-57f8","Warn: Project is vulnerable to: GHSA-g9r4-xpmj-mj65","Warn: Project is vulnerable to: GHSA-q2c6-c6pm-g3gh","Warn: Project is vulnerable to: GHSA-765h-qjxv-5f44","Warn: Project is vulnerable to: GHSA-f2jv-r9rf-7988","Warn: Project is vulnerable to: GHSA-jcpv-g9rr-qxrc","Warn: Project is vulnerable to: GHSA-44pw-h2cw-w3vq","Warn: Project is vulnerable to: GHSA-jp4x-w63m-7wgm","Warn: Project is vulnerable to: GHSA-c429-5p7v-vgjp","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-2pr6-76vf-7546","Warn: Project is vulnerable to: GHSA-8j8c-7jfh-h6hx","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-6c8f-qphg-qjgp","Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695","Warn: Project is vulnerable to: GHSA-fvqr-27wr-82fm","Warn: Project is vulnerable to: GHSA-4xc9-xhrj-v574","Warn: Project is vulnerable to: GHSA-x5rq-j2xg-h7qm","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-779f-wgxg-qr8f","Warn: Project is vulnerable to: GHSA-p9wx-2529-fp83","Warn: Project is vulnerable to: GHSA-5v2h-r2cx-5xgj","Warn: Project is vulnerable to: GHSA-rrrm-qjm4-v8hf","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-wrvr-8mpx-r7pp","Warn: Project is vulnerable to: GHSA-hxm2-r34f-qmc5","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-fhjf-83wg-r2j9","Warn: Project is vulnerable to: GHSA-8hfj-j24r-96c4","Warn: Project is vulnerable to: GHSA-wc69-rhjr-hc9g","Warn: Project is vulnerable to: GHSA-566m-qj78-rww5","Warn: Project is vulnerable to: GHSA-7fh5-64p2-3v2j","Warn: Project is vulnerable to: GHSA-gqgv-6jq5-jjj9","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-7xfp-9c55-5vqj","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-rjqq-98f6-6j3r","Warn: Project is vulnerable to: GHSA-mjxr-4v3x-q3m4","Warn: Project is vulnerable to: GHSA-cgfm-xwp7-2cvr","Warn: Project is vulnerable to: GHSA-rm97-x556-q36h","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-jv35-xqg7-f92r","Warn: Project is vulnerable to: GHSA-4g88-fppr-53pp","Warn: Project is vulnerable to: GHSA-4jqc-8m5r-9rpr","Warn: Project is vulnerable to: GHSA-2m39-62fm-q8r3","Warn: Project is vulnerable to: GHSA-mf6x-7mm4-x2g7","Warn: Project is vulnerable to: GHSA-mxhp-79qh-mcx6","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-xc7v-wxcw-j472","Warn: Project is vulnerable to: GHSA-cf4h-3jhx-xvhq"],"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-19T07:39:37.752Z","repository_id":57286470,"created_at":"2025-08-19T07:39:37.752Z","updated_at":"2025-08-19T07:39:37.752Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33114587,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-16T04:41:52.686Z","status":"ssl_error","status_checked_at":"2026-05-16T04:41:52.009Z","response_time":115,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["browser","javascript","jstrings","jstrings-localization","localisation","localization","node","node-js","nodejs","strings","translation"],"created_at":"2024-12-22T17:23:15.171Z","updated_at":"2026-05-16T18:36:56.242Z","avatar_url":"https://github.com/guitarneck.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url]\n[![Coverage Status][coveralls-image]][coveralls-url] [![dependencies][dependencies-image]][dependencies-url]\n[![dev dependencies][dev-dependencies-image]][dev-dependencies-url]\n\n# JStrings Localization\n\nA javascript singleton Localization for both Node.js and Web browsers.\nThe localised files are based on [JStrings](#about-jsctrings) format.\n\n# Table of Contents\n\n* [Install](#install)\n* [About JStrings](#about-jsctrings)\n* [Usage](#usage)\n    * [With Node.js](#With-node.js)\n    * [In a browser](#in-a-browser)\n* [Localization class](#localization-class)\n    * [Fields](#fields)\n    * [Methods](#methods)\n* [String prototype](#string-prototype)\n* [License](#license)\n\n# Install\n\n```bash\n$ npm i -D jstrings-localization\n```\n\nOr:\n\n```bash\n$ npm install --save-dev jstrings-localization\n```\n\n# About JStrings\n\n__JStrings__ are an extension of the [String Resources][apple-strings-url]\nformat used inside Apple developments.\nThis format is usefull during localisation process, human readable, and easy to shared.\nThe _Apple Strings Resources_ is in text format and contains pairs of key-value that are `strings`.\nComments can be sets inside the text file.\n\n```bash\n/* A one line comment */\n\"My first key\"=\"My first value\";\n\n/*\n *  A multi-lines comment\n *\n */\n\"My second key\"=\"My second value\";\n \n```\n\n\u003e The file format is very simple !\n\nComposed with the filename itself, followed by optinals underscore and ISO code,\nterminated by the extension.\n```bash\nfilename[_iso].extension\n\n// Default file\ncommon.jstrings.txt\n// English localised file\ncommon_en.jstrings.txt\n// French localised file\ncommon_fr.jstrings.txt\n...etc\n```\n\n\u003e ISO code's format and extensions are whatever you'd like _(See : ISO 639)_.\n\u003e\n\u003e The default file is used when no localised file according to a code were found.\n\nThe __JStrings__ introduces multi-lines values.\nIt used a specifics values format, surrounded by brackets.\nThe output result will be joined by a newline.\n\n```bash\n/* A multi-lines values */\n\"My 1st line...\"=[\"My 1st line\",\"followed by a 2nd line\",\"\",\"Ended by a 4th line\"];\n```\n\nIt's up to you to define the key you'd like to use.\nIt must be unique along the files you're using.\nBest practive is to be verbose in your code.\n\nYou'd like to add some variables in your string, for example, like this :\n```javascript\n    \"Welcome %1 ! Rock\\'n\\'Roll !\".localize().replace('%1',user.name);\n```\n\nThere's no specific format for the variables.\nYou can use any caracters you'd like at your own risk.\nBy the way, you can combine strings together.\n\n# Usage\n\n## With Node.js\n```javascript\n\"use strict\";\n\nconst Localization    = require(\"Localization\");\n\nconst languages       = [\"de\",\"en\",\"es\",\"he\",\"fr\"];\nlet   lang            = \"en\";\n\nLocalization.language( languages, lang );\n\nLocalization.load(\"strings/common.jstrings.txt\");\nLocalization.load(\"strings/myapp.jstrings.txt\");\n\nconsole.log( \"Hello world !\".localize() );\n```\n\n## In a browser\n```html\n    \u003cscript type=\"text/javascript\" src=\"js/jq/jquery.min.js\"\u003e\u003c/script\u003e\n    \u003cscript type=\"text/javascript\" src=\"js/lib/Localization.cls.js\"\u003e\u003c/script\u003e\n    \u003cscript type=\"text/javascript\"\u003e\n        var languages       = [\"de\",\"en\",\"es\",\"he\",\"fr\"];\n        var lang            = \"en\";\n\n        var page            = \"welcome.html\";\n\n        Localization.language( languages, lang );\n\n        lang = /fr/.test(navigator.language) ? 'fr' : 'en'; //Force 'fr' if ok \n        Localization.localize( lang );\n\n        if( ! Localization.load(\"strings/common.jstrings.txt\") )\n            console.log(\"Localization common FAILED !\");\n            \n        if( ! Localization.load(\"strings/myapp.jstrings.txt\")  )\n            console.log(\"Localization myapp  FAILED !\");\n\n        splash( \"Hello world !\".localize() );\n        \n        $(\"#content\").load(\"inc/\" + page.localize());\n    \u003c/script\u003e\n```\n\n# Localization class\n\nThe implementation of the Localization Class is based on the Singleton.\nYou don't need to instanciate it.\n\n## Fields\n\n| Name | Type | Description |\n|:----------------|:------------:|:------------------------------------------------------|\n| version | `string` | The class version. |\n| preferedLanguage | `array`| The languages your application can handel. |\n| defaultLanguage | `string`| Default language used when unmatched user language. |\n| currentLanguage | `string`| The language in use. |\n| userLanguage | `string`| The user language preferences or system language |\n\n\u003e You must not sets this values. Use the methods insteed. Keep in mind they are __read only__.\n \n## Methods\n\n* __language( preferedLang ,defaultLang )__\n\n  _Global settings of the Localization class. You would call it first._\n  \n    * preferedLang\n    \n      Type: `array`\n      \n      _List of the languages your application handle._\n    \n    * defaultLang\n    \n      Type : `string`\n      \n      _The default language used when user language's can't match any in the list._\n\n---\n\n* __localize( lang )__\n\n  _Specified the language for the localisation.\n  Updates also all the files previouly loaded to the specified language._\n  \n  * lang\n  \n    Type : `string`\n    \n    _The language used for the comming localisations. When you changed the code at run time,\n    keep in mind to refresh your application._\n\n    \u003e __Important ! There is _no ordered list_ of the files. Don't think _overwriting_ !__\n\n---\n\n* __load( file )__\n\n  _Load a file in path format, according to the localised settings._\n\n  * file\n  \n    Type : `string`\n    \n    _The path of the file to load. The format must not contains any iso code._\n    \n\n# String prototype\n\n* __localize()__\n\n  _Localise the string value or the variable value.\n  When no corresponding translation is available, the string remains the same._\n  \n  ```javascript\n    \"localize me\".localize()\n  ```\n\n# License\n\n[MIT © guitarneck](./LICENSE)\n\n[apple-strings-url]: https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/LoadingResources/Strings/Strings.html\n\n[downloads-image]: https://img.shields.io/npm/dm/jstrings-localization.svg\n[npm-image]: https://img.shields.io/npm/v/jstrings-localization.svg\n[npm-url]: https://www.npmjs.com/package/jstrings-localization\n\n[travis-image]: https://img.shields.io/travis/guitarneck/jstrings-localization.svg?label=travis-ci\n[travis-url]: https://travis-ci.org/guitarneck/jstrings-localization\n\n[coveralls-image]: https://coveralls.io/repos/github/guitarneck/jstrings-localization/badge.svg?branch=master\n[coveralls-url]: https://coveralls.io/github/guitarneck/jstrings-localization?branch=master\n\n[dev-dependencies-image]: https://david-dm.org/guitarneck/jstrings-localization/dev-status.svg\n[dev-dependencies-url]: https://david-dm.org/guitarneck/jstrings-localization?type=dev\n[dependencies-image]: https://david-dm.org/guitarneck/jstrings-localization/status.svg\n[dependencies-url]: https://david-dm.org/guitarneck/jstrings-localization\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguitarneck%2Fjstrings-localization","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fguitarneck%2Fjstrings-localization","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguitarneck%2Fjstrings-localization/lists"}