{"id":18440760,"url":"https://github.com/andreasnicolaou/locale-translator","last_synced_at":"2026-03-17T16:05:01.028Z","repository":{"id":57097430,"uuid":"243073207","full_name":"andreasnicolaou/locale-translator","owner":"andreasnicolaou","description":"Translate any locale with the provided pipe or service.","archived":false,"fork":false,"pushed_at":"2025-05-17T12:50:51.000Z","size":41,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-15T23:52:52.343Z","etag":null,"topics":["locales","locales-translation"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/andreasnicolaou.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,"zenodo":null}},"created_at":"2020-02-25T18:39:13.000Z","updated_at":"2025-07-24T14:36:12.000Z","dependencies_parsed_at":"2025-03-26T04:35:49.440Z","dependency_job_id":"9d6eb508-9a07-4efc-ac6b-c01aada2beb0","html_url":"https://github.com/andreasnicolaou/locale-translator","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/andreasnicolaou/locale-translator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreasnicolaou%2Flocale-translator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreasnicolaou%2Flocale-translator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreasnicolaou%2Flocale-translator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreasnicolaou%2Flocale-translator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andreasnicolaou","download_url":"https://codeload.github.com/andreasnicolaou/locale-translator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreasnicolaou%2Flocale-translator/sbom","scorecard":{"id":192452,"data":{"date":"2025-08-11","repo":{"name":"github.com/andreasnicolaou/locale-translator","commit":"ef6161799dc0615b755778dc55b9fbc52b586087"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.3,"checks":[{"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":"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":"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":"Code-Review","score":0,"reason":"Found 0/18 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":"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":"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":"Maintained","score":2,"reason":"3 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"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":"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":"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"}},{"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"}}]},"last_synced_at":"2025-08-16T21:02:57.923Z","repository_id":57097430,"created_at":"2025-08-16T21:02:57.923Z","updated_at":"2025-08-16T21:02:57.923Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30626906,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-17T14:16:03.965Z","status":"ssl_error","status_checked_at":"2026-03-17T14:16:03.380Z","response_time":56,"last_error":"SSL_read: 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":["locales","locales-translation"],"created_at":"2024-11-06T06:32:53.406Z","updated_at":"2026-03-17T16:05:01.011Z","avatar_url":"https://github.com/andreasnicolaou.png","language":"TypeScript","funding_links":[],"categories":["Development Utilities"],"sub_categories":["Internationalization"],"readme":"# LocaleTranslator\n\nEffortlessly convert ISO 639-1 locale codes (like `'en'`, `'fr'`, `'de'`) into human-readable language names or native names using a simple Angular pipe or service.\n\n![GitHub contributors](https://img.shields.io/github/contributors/andreasnicolaou/locale-translator)\n![GitHub License](https://img.shields.io/github/license/andreasnicolaou/locale-translator)\n![GitHub package.json version](https://img.shields.io/github/package-json/v/andreasnicolaou/locale-translator)\n![NPM Downloads](https://img.shields.io/npm/dm/%40andreasnicolaou%2Flocale-translator)\n\n## Installation\n\n```bash\nnpm install @andreasnicolaou/locale-translator\n```\n\n#### 1. Import the Module Based on Your Angular Version\n\n🟢 **For Angular 15+ (Standalone Projects)**\n\nYou can directly import the pipe into any standalone component:\n\n```typescript\nimport { TranslateLocalePipe } from '@andreasnicolaou/locale-translator';\n\n@Component({\n  standalone: true,\n  selector: 'your-component',\n  imports: [TranslateLocalePipe],\n  templateUrl: './your-component.html',\n})\nexport class YourComponent {}\n```\n\n🟠 **For Angular \u003c15 or Module-Based Projects**\n\nUse the provided `LocaleTranslationsModule` to wrap the pipe and service:\n\n```typescript\nimport { LocaleTranslationsModule } from '@andreasnicolaou/locale-translator';\n\n@NgModule({\n  declarations: [],\n  imports: [LocaleTranslationsModule],\n  exports: [],\n})\nexport class YourModule {}\n```\n\n\u003e 💡 Note: If you're using Angular 15+ but prefer NgModule-based architecture, you can also use the module wrapper for compatibility.\n\n#### Use the Service in Your Component (Optional)\n\n```typescript\nimport { LocaleTranslationsService, LocaleCode, LocaleType } from '@andreasnicolaou/locale-translator';\n\nexport class MyComponent {\n  constructor(private readonly localeTranslationsService: LocaleTranslationsService) {\n    const locale: LocaleType | undefined = this.localeTranslationsService.getLocale('en');\n    console.log(locale); // Logs the name and the nativeName\n\n    const localesMap: Map\u003cLocaleCode, LocaleType\u003e = this.localeTranslationsService.getAll();\n    console.log(localesMap); // Logs all available locales\n  }\n}\n```\n\n## API\n\n### `LocaleTranslationsService`\n\nThe service provides methods to retrieve locale data and manage translations.\n\n| Method                                    | Description                                                                                              |\n| ----------------------------------------- | -------------------------------------------------------------------------------------------------------- |\n| `getLocale(code: LocaleCode): LocaleType` | Retrieves the language details for a given locale code. If no translation is found, returns `undefined`. |\n| `getAll(): Map\u003cLocaleCode, LocaleType\u003e`   | Retrieves all language data, where the keys are locale codes, and the values are `LocaleType` objects.   |\n\n### `translateLocale` Pipe\n\nThe `translateLocale` pipe is used to translate a locale code into its respective name or native name.\n\n| Argument | Type                       | Description                                                           |\n| -------- | -------------------------- | --------------------------------------------------------------------- |\n| `code`   | `LocaleCode`               | The locale code (e.g., `'en'`, `'fr'`). This argument is required.    |\n| `native` | boolean (default: `false`) | If set to `true`, the pipe will return the native name of the locale. |\n\n### Usage Examples\n\n#### The pipe returns the language name by default. To get the native name, pass `true` as a second argument.\n\n```html\n\u003cdiv\u003e{{ 'en' | translateLocale }}\u003c/div\u003e\n```\n\n```html\n\u003cdiv\u003e{{ 'en' | translateLocale:true }}\u003c/div\u003e\n```\n\n## Contribution\n\n- **Having an issue**? or looking for support? [Open an issue](https://github.com/andreasnicolaou/locale-translator/issues/new) and we will get you the help you need.\n- Got a **new feature or a bug fix**? Fork the repo, make your changes, and submit a pull request.\n\n## Support this project\n\nIf you find this project useful, please star the repo to let people know that it's reliable. Also, share it with friends and colleagues that might find this useful as well. Thank you :smile:\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreasnicolaou%2Flocale-translator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandreasnicolaou%2Flocale-translator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreasnicolaou%2Flocale-translator/lists"}