{"id":20694804,"url":"https://github.com/mclander/angular-custom-locale","last_synced_at":"2025-06-19T07:08:23.961Z","repository":{"id":57178295,"uuid":"213438994","full_name":"mclander/angular-custom-locale","owner":"mclander","description":"Module for customization angular 4-8 locale","archived":false,"fork":false,"pushed_at":"2019-10-09T09:59:46.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-16T09:55:46.085Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/mclander.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":"2019-10-07T16:58:30.000Z","updated_at":"2019-10-09T09:59:48.000Z","dependencies_parsed_at":"2022-09-14T02:31:17.802Z","dependency_job_id":null,"html_url":"https://github.com/mclander/angular-custom-locale","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mclander/angular-custom-locale","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mclander%2Fangular-custom-locale","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mclander%2Fangular-custom-locale/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mclander%2Fangular-custom-locale/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mclander%2Fangular-custom-locale/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mclander","download_url":"https://codeload.github.com/mclander/angular-custom-locale/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mclander%2Fangular-custom-locale/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260705875,"owners_count":23049493,"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":[],"created_at":"2024-11-17T00:06:44.697Z","updated_at":"2025-06-19T07:08:18.474Z","avatar_url":"https://github.com/mclander.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# angular-custom-locale\nHelps to customization Angular 5.x-8.x locale\n\n# Usage\nImagine that we need to change view of numbers, in whole project. And this project already use some locale. \nI.e. our components uses  in declaration `providers:  {provide: LOCALE_ID, useValue: 'ru'}`.\nSo let is magic begin.\n\n```typescript\n// app.module.component.ts\n\n// Boilerplate\nimport customizeLocale from 'angular-custom-locale';\nimport { registerLocaleData } from '@angular/common';\n\n// Imports russian locale: where numbers outputs like 1234.56 =\u003e 1 234,56 \nimport localeRu from '@angular/common/locales/ru';\n\n// clone locale for safe use\nimport cloneDeep from 'cloneDeep';\nlet customizedLocaleRu = cloneDeep(localeRu);\n\n// Some hacks (i.e. magic): mutate locale (I plan to change this beehaviour in latest versions)\ncustomizeLocale(customizedLocaleRu, {\n  numbers: {\n    decimal: '.', // decimal separator, was ','\n    group: '',    // number group separator, was ' '\n    nan: '-'      // not a number message, was 'не число' (not a number), but I not sure, that it uses anywhere\n  }\n});\n\n// And now numbers output will be like 1234.56 =\u003e 1234.56. Just a magic for no magic)\nregisterLocaleData(customizedLocaleRu);\n// If we need change locale settings for whole project without declare locale providers, here is really dirty hack\n// We can change default locale. If you know right way let me know)\nregisterLocaleData(customizedLocaleRu, 'en');\n\n```\n\n# Parameter\nThis is Objech where first level of keys means group name of changing \nitems, 2nd level - means items names. All not case sensitive.\n\nNow supported only one section '**number**'. If you need more group, drop me a line.\n\nList of items:\n* **decimal** - decimal separator\n* **group** - digits group separator\n* **list** - list separator\n* **percentSign** - % (percent sign)\n* **plusSign** - + (plus sign)\n* **minusSign** - - (minus sign)\n* **exponential** - exponential\n* **superscriptingExponent** - superscripting exponent\n* **perMille** - ‰ (per-mille)\n* **infinity** - ∞ (infinity sign)\n* **nan** - not a number string\n* **timeSeparator** - time separator\u003e\n\n# Is it legal? Or (at least) good practice?\nI hope so. Angular trought 5 to 8 versions has no changes... in format of locales files.\nOf course, I can't guarantee it will not changed in Angular 9 (or even 8.xx).\nI just can promise to add some hack in this module if it will fired.\n\n# Naming\nAngular imports data for locales from [CLDR](http://cldr.unicode.org). So I just use \nnames from xml (e.g. [here](https://github.com/unicode-org/cldr/blob/release-36/common/main/ru.xml))\n\n```xml\n...\n\u003cnumbers\u003e\n   ...\n  \u003csymbols numberSystem=\"latn\"\u003e\n    \u003cdecimal\u003e,\u003c/decimal\u003e\n    \u003cgroup\u003e \u003c/group\u003e\n    \u003clist draft=\"contributed\"\u003e;\u003c/list\u003e\n    \u003cpercentSign\u003e%\u003c/percentSign\u003e\n    \u003cplusSign draft=\"contributed\"\u003e+\u003c/plusSign\u003e\n    \u003cminusSign draft=\"contributed\"\u003e-\u003c/minusSign\u003e\n    \u003cexponential\u003eE\u003c/exponential\u003e\n    \u003csuperscriptingExponent\u003e×\u003c/superscriptingExponent\u003e\n    \u003cperMille\u003e‰\u003c/perMille\u003e\n    \u003cinfinity\u003e∞\u003c/infinity\u003e\n    \u003cnan\u003eне число\u003c/nan\u003e\n    \u003ctimeSeparator draft=\"contributed\"\u003e:\u003c/timeSeparator\u003e\n  \u003c/symbols\u003e\n...\n```\n\n# Plans\n\n* Add more sections (on demand)\n* Change mutation behaviour to safe\n* Fixes this README (ough, my English)\n* Write descriptions for \"internal\" but exported functions setItem \u0026 getItem\n* Add warnings (or restictions for Angular 9+)\n\nJust write me if I'll can help you,.. or you can help me (pull request or any advises) mclander@list.ru.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmclander%2Fangular-custom-locale","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmclander%2Fangular-custom-locale","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmclander%2Fangular-custom-locale/lists"}