{"id":17156349,"url":"https://github.com/projectcaluma/ember-localized-model","last_synced_at":"2025-10-11T09:33:36.270Z","repository":{"id":48270749,"uuid":"284690748","full_name":"projectcaluma/ember-localized-model","owner":"projectcaluma","description":"Handle model field translations for JSON:API","archived":false,"fork":false,"pushed_at":"2025-04-25T10:06:32.000Z","size":2847,"stargazers_count":1,"open_issues_count":5,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-04-25T11:20:40.350Z","etag":null,"topics":["ember-addon","emberjs","json-api","localization"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/projectcaluma.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-08-03T12:12:22.000Z","updated_at":"2025-04-25T10:06:30.000Z","dependencies_parsed_at":"2024-04-08T10:41:22.300Z","dependency_job_id":"803dc90b-374b-47fc-b5ed-747820787f24","html_url":"https://github.com/projectcaluma/ember-localized-model","commit_stats":{"total_commits":28,"total_committers":9,"mean_commits":3.111111111111111,"dds":0.6428571428571428,"last_synced_commit":"293a596afba02515f8c327a6956942c7faa2f988"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/projectcaluma/ember-localized-model","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectcaluma%2Fember-localized-model","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectcaluma%2Fember-localized-model/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectcaluma%2Fember-localized-model/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectcaluma%2Fember-localized-model/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/projectcaluma","download_url":"https://codeload.github.com/projectcaluma/ember-localized-model/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectcaluma%2Fember-localized-model/sbom","scorecard":{"id":746431,"data":{"date":"2025-08-11","repo":{"name":"github.com/projectcaluma/ember-localized-model","commit":"a76ec6340ba5a54572e7849fc2eb61f19304eb6f"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.8,"checks":[{"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":"Code-Review","score":10,"reason":"all changesets reviewed","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":"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":"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":"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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Warn: topLevel 'contents' permission set to 'write': .github/workflows/dependabot.yml:5","Warn: no topLevel permission defined: .github/workflows/release.yml: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":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"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":"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 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":"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":"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":"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/ci.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/projectcaluma/ember-localized-model/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/projectcaluma/ember-localized-model/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/projectcaluma/ember-localized-model/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:41: update your workflow using https://app.stepsecurity.io/secureworkflow/projectcaluma/ember-localized-model/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:42: update your workflow using https://app.stepsecurity.io/secureworkflow/projectcaluma/ember-localized-model/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:43: update your workflow using https://app.stepsecurity.io/secureworkflow/projectcaluma/ember-localized-model/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:74: update your workflow using https://app.stepsecurity.io/secureworkflow/projectcaluma/ember-localized-model/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:75: update your workflow using https://app.stepsecurity.io/secureworkflow/projectcaluma/ember-localized-model/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:77: update your workflow using https://app.stepsecurity.io/secureworkflow/projectcaluma/ember-localized-model/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/dependabot.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/projectcaluma/ember-localized-model/dependabot.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/dependabot.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/projectcaluma/ember-localized-model/dependabot.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/projectcaluma/ember-localized-model/release.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/projectcaluma/ember-localized-model/release.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/projectcaluma/ember-localized-model/release.yml/main?enable=pin","Info:   0 out of   9 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   5 third-party GitHubAction 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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: GNU Lesser General Public License v3.0: 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":"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":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"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-22T18:55:07.028Z","repository_id":48270749,"created_at":"2025-08-22T18:55:07.034Z","updated_at":"2025-08-22T18:55:07.034Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279006752,"owners_count":26084180,"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","status":"online","status_checked_at":"2025-10-11T02:00:06.511Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["ember-addon","emberjs","json-api","localization"],"created_at":"2024-10-14T22:06:13.304Z","updated_at":"2025-10-11T09:33:36.227Z","avatar_url":"https://github.com/projectcaluma.png","language":"JavaScript","readme":"# ember-localized-model\n\nHandle mutli-lang model fields where your JSON:API returns a dictionary / object\nwith all languages present.\n\n**Example:**\n\n```json\n{\n  \"id\": \"1\",\n  \"type\": \"books\",\n  \"attributes\": {\n    \"name\": {\n      \"de\": \"Der Name des Windes\",\n      \"en\": \"The name of the wind\"\n    }\n  }\n}\n```\n\n## Compatibility\n\n- Ember.js v4.12 or above\n- Ember CLI v4.12 or above\n- EmberData v4.12 or above\n- Node.js v16 or above\n\n## Installation\n\n```bash\nember install ember-localized-model\n```\n\n## Usage\n\n### First steps\n\nTo use this addon, first you need to import and extend your model from `LocalizedModel`:\n\n```js\nimport { LocalizedModel } from \"ember-localized-model\";\n\nexport default class YourModel extends LocalizedModel {}\n```\n\nTo serialize the multi-lang field correctly you also need to add a serializer:\n\n```js\nimport { LocalizedSerializer } from \"ember-localized-model\";\n\nexport default class YourModelSerializer extends LocalizedSerializer {}\n```\n\nOnce this is done, you can start adding your localized field via the `@localizedAttr` decorator:\n\n```js\nimport { LocalizedModel, localizedAttr } from \"ember-localized-model\";\n\nexport default class YourModel extends LocalizedModel {\n  @localizedAttr firstName;\n  @localizedAttr lastName;\n}\n```\n\n### Accessing the fields value\n\nTo read the model field you can simply use `yourModel.firstName`.\n\nThe locale the field displays depends on your `intl.primaryLocale`. You can\nchange your `primaryLocale` to display the model field in another locale.\n\nIf you want to switch locale for only one specific model, you can set\n`yourModel.localizedFieldLocale` to the desired locale.\n\nIf your locale has a region such as `en-US`, but you want to disregard the\nregion. Set `sanitizeLocale` to `true` in your `ember-cli-build.js` file:\n\n```js\nmodule.exports = function (defaults) {\n  const app = new EmberApp(defaults, {\n    \"localized-model\": {\n      sanitizeLocale: true,\n    },\n    // ...\n  });\n\n  // ...\n};\n```\n\nIf you want to access the raw data as sent by the backend, you can use\n`yourModel.localizedObjects.firstName`. This will return the raw data.\n\nFor example:\n\n```json\n{\n  \"de\": \"Johan\",\n  \"en\": \"John\"\n}\n```\n\n## Known Issues\n\n### Creating model records\n\nIf you have your model defined with a `@localizedAttr` field and directly set the\nfield on `store.createRecord` the setter for the field will not be called and\ninstead of the dictionary with the locale key, the value directly will be assigned\nto the field.\n\nThe serialized model then looks like this:\n\n```json\n{\n  \"type\": \"your-model\",\n  \"attributes\": {\n    \"name\": \"your name\"\n  }\n}\n```\n\ninstead of\n\n```json\n{\n  \"type\": \"your-model\",\n  \"attributes\": {\n    \"name\": {\n      \"en\": \"your name\"\n    }\n  }\n}\n```\n\n**Solution**:\nCreate your record first and then assign the localized field:\n\n```js\nconst yourModel = this.store.createRecord(\"yourModel\");\nyourModel.name = \"this is a test\";\n```\n\n## Contributing\n\nSee the [Contributing](CONTRIBUTING.md) guide for details.\n\n## License\n\nThis project is licensed under the [LGPL-3.0 License](LICENSE).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprojectcaluma%2Fember-localized-model","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprojectcaluma%2Fember-localized-model","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprojectcaluma%2Fember-localized-model/lists"}