{"id":16225772,"url":"https://github.com/bartholomej/ngx-translate-cut","last_synced_at":"2025-06-19T07:05:15.734Z","repository":{"id":42933699,"uuid":"237415808","full_name":"bartholomej/ngx-translate-cut","owner":"bartholomej","description":"Angular pipe for cutting translations ✂️ 🌍 (plugin for ngx-translate)","archived":false,"fork":false,"pushed_at":"2025-06-15T14:47:13.000Z","size":6241,"stargazers_count":13,"open_issues_count":10,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-15T14:48:20.363Z","etag":null,"topics":["angular","angular10","angular14","angular15","angular9","i18n","internationalization","languages","localization","ng10","ng14","ng15","ng8","ng9","ngx","ngx-translate","translate","translations"],"latest_commit_sha":null,"homepage":"https://bartholomej.github.io/ngx-translate-cut/","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/bartholomej.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["bartholomej"],"patreon":null,"open_collective":null,"ko_fi":"bartholomej","tidelift":null,"custom":["https://www.paypal.me/bartholomej"]}},"created_at":"2020-01-31T11:22:02.000Z","updated_at":"2025-06-15T14:45:58.000Z","dependencies_parsed_at":"2023-12-14T00:28:12.574Z","dependency_job_id":"7d8690f6-b53f-40e7-a4a0-623969035c3d","html_url":"https://github.com/bartholomej/ngx-translate-cut","commit_stats":{"total_commits":140,"total_committers":2,"mean_commits":70.0,"dds":0.05714285714285716,"last_synced_commit":"30d1ee80a0587e6888e974e5bd5be2c732f8ea8c"},"previous_names":[],"tags_count":35,"template":false,"template_full_name":null,"purl":"pkg:github/bartholomej/ngx-translate-cut","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bartholomej%2Fngx-translate-cut","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bartholomej%2Fngx-translate-cut/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bartholomej%2Fngx-translate-cut/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bartholomej%2Fngx-translate-cut/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bartholomej","download_url":"https://codeload.github.com/bartholomej/ngx-translate-cut/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bartholomej%2Fngx-translate-cut/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260705809,"owners_count":23049488,"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":["angular","angular10","angular14","angular15","angular9","i18n","internationalization","languages","localization","ng10","ng14","ng15","ng8","ng9","ngx","ngx-translate","translate","translations"],"created_at":"2024-10-10T12:46:21.049Z","updated_at":"2025-06-19T07:05:10.706Z","avatar_url":"https://github.com/bartholomej.png","language":"TypeScript","funding_links":["https://github.com/sponsors/bartholomej","https://ko-fi.com/bartholomej","https://www.paypal.me/bartholomej"],"categories":["Development Utilities"],"sub_categories":["Internationalization"],"readme":"# ✂️🌍 NgxTranslateCut Pipe\n\n[![npm version](https://badge.fury.io/js/ngx-translate-cut.svg)](https://badge.fury.io/js/ngx-translate-cut)\n[![Package License](https://img.shields.io/npm/l/ngx-translate-cut.svg)](https://www.npmjs.com/ngx-translate-cut)\n[![Build \u0026 Publish](https://github.com/bartholomej/ngx-translate-cut/workflows/Build%20\u0026%20Publish/badge.svg?branch=master)](https://github.com/bartholomej/ngx-translate-cut/actions)\n[![NPM Downloads](https://img.shields.io/npm/dm/ngx-translate-cut.svg)](https://www.npmjs.com/ngx-translate-cut)\n[![codecov](https://codecov.io/gh/bartholomej/ngx-translate-cut/branch/master/graph/badge.svg?token=FV0ZM2Y3L3)](https://codecov.io/gh/bartholomej/ngx-translate-cut)\n\n\u003e Angular pipe for cutting translations ✂️ 🌍 (plugin for [@ngx-translate](https://github.com/ngx-translate/core))\n\n\u003e ✓ _Angular 19, Angular Universal (SSR) and Zoneless compatible_\n\nHere's the [demo](http://bartholomej.github.io/ngx-translate-cut/) or [stackblitz live preview](https://stackblitz.com/edit/ngx-translate-cut)\n\n## Install\n\n1. Make sure you have [@ngx-translate](https://github.com/ngx-translate/core) library installed, because this is its plugin\n\n2. Use `npm` (or `yarn`) to install the package\n\n```bash\nnpm install ngx-translate-cut # For Angular 19. See compatibility table\n```\n\nChoose the version corresponding to your Angular version:\n\n| Angular             | ngx-translate-cut | Install                            |\n| ------------------- | ----------------- | ---------------------------------- |\n| **ng19**            | 19.x              | `npm install ngx-translate-cut`    |\n| **ng18**            | 18.x              | `npm install ngx-translate-cut@18` |\n| **ng17**            | 17.x              | `npm install ngx-translate-cut@17` |\n| **ng16**            | 5.x               | `npm install ngx-translate-cut@5`  |\n| **ng15**            | 4.x               | `npm install ngx-translate-cut@4`  |\n| **ng14**            | 3.x               | `npm install ngx-translate-cut@3`  |\n| **ng13**            | 3.x               | `npm install ngx-translate-cut@3`  |\n| **ng12** (ivy only) | 2.x               | `npm install ngx-translate-cut@2`  |\n| \u003e= 5 =\u003c 12          | 1.x               | `npm install ngx-translate-cut@1`  |\n\n3. Add `NgxTranslateCutModule` into your module `imports`.\n\nFile `app.module.ts`\n\n```typescript\n  import { NgxTranslateCutModule } from 'ngx-translate-cut';\n\n  @NgModule({\n   // ...\n   imports: [\n     // ...\n     NgxTranslateCutModule\n   ]\n  })\n```\n\n## Usage\n\n### Definition\n\nStrings are separated with `|` _(pipe sign)_\n_[...but you can choose your own symbol](#options)_\n\nFile `assets/i18n/en.json`\n\n```json\n{\n  \"demo\": \"This is only one 'translate string' with | strong text | and | links\"\n}\n```\n\n### Example code\n\nIn your template use `translateCut:\u003cnumber\u003e` pipe right after `translate` pipe from [@ngx-translate](https://github.com/ngx-translate/core) library.\n\n```html\n{{ 'demo' | translate | translateCut:0 }}\n\n\u003cstrong\u003e {{ 'demo' | translate | translateCut:1 }} \u003c/strong\u003e\n\n{{ 'demo' | translate | translateCut:2 }}\n\n\u003ca href=\"#\"\u003e {{ 'demo' | translate | translateCut:3 }} \u003c/a\u003e\n```\n\n### Result\n\n\u003e This is only one 'translate string' with \u003cstrong\u003estrong\u003c/strong\u003e text and [links](https://github.com/bartholomej/ngx-translate-cut/)\n\n## Options\n\n### Separator\n\nIf you are not satisfied with the basic settings of the separator (which is `|`), you can choose your own separator\n\n```typescript\n  import { NgxTranslateCutModule } from 'ngx-translate-cut';\n\n  @NgModule({\n   // ...\n   imports: [\n     // ...\n     NgxTranslateCutModule.forRoot({\n      // Your separator in translation strings will be `*`\n      separator: '*'\n    }),\n   ]\n  })\n```\n\n### Trim\n\nIf you do not want to trim your translation strings before cutting you can set `trim` to `false` (default is `true`). See this [explanation](https://github.com/bartholomej/ngx-translate-cut/issues/62)...\n\n```typescript\n  import { NgxTranslateCutModule } from 'ngx-translate-cut';\n\n  @NgModule({\n   // ...\n   imports: [\n     // ...\n     NgxTranslateCutModule.forRoot({\n      trim: false\n    }),\n   ]\n  })\n```\n\n## Dependencies\n\n[@ngx-translate/core](https://github.com/ngx-translate/core)\n\n## FAQ\n\n### Older Angular\n\n#### Error\n\n\u003e Failed to compile.\n\u003e\n\u003e ./node_modules/ngx-translate-cut/fesm2015/ngx-translate-cut.mjs 17:18-28\n\u003e Can't import the named export 'Injectable' from non EcmaScript module (only default export is available)\n\n#### Solution\n\nYou are probably trying to use this library with an older version of Angular (Angular 5 – 11).\n\nInstall copmatibility version instead:\n\n```bash\nyarn add ngx-translate-cut@1 # for angular 5 – 11\n```\n\n## Development (notes for me)\n\n### Publish Stable\n\n```shell\nyarn release:patch\n# yarn release:minor\n# yarn release:major\n```\n\n### Publish next channel\n\n1. Bump version `-next.0` in `package.json`\n2. `yarn publish:next`\n\n## License\n\nCopyright \u0026copy; 2024 [Lukas Bartak](http://bartweb.cz)\n\nProudly powered by nature 🗻, wind 💨, tea 🍵 and beer 🍺 ;)\n\nAll contents are licensed under the [MIT license].\n\n[mit license]: LICENSE\n\n## Donation\n\nIf this project have helped you save time please consider [making a donation](https://github.com/sponsors/bartholomej) for some 🍺 or 🍵 ;)\n\n## Thanks to\n\nOriginal idea comes from: [@yuristsepaniuk](https://github.com/yuristsepaniuk) in [this thread](https://github.com/ngx-translate/core/issues/223).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbartholomej%2Fngx-translate-cut","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbartholomej%2Fngx-translate-cut","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbartholomej%2Fngx-translate-cut/lists"}