@ogs-gmbh/ngx-translate 1.4.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +105 -50
  3. package/fesm2022/ogs-gmbh-ngx-translate.mjs +368 -220
  4. package/fesm2022/ogs-gmbh-ngx-translate.mjs.map +1 -1
  5. package/package.json +9 -13
  6. package/types/ogs-gmbh-ngx-translate.d.ts +1188 -0
  7. package/enums/collecting-strategies.enum.d.ts +0 -23
  8. package/enums/preloading-strategies.enum.d.ts +0 -23
  9. package/errors/locale-not-defined.error.d.ts +0 -5
  10. package/errors/scope-not-defined.error.d.ts +0 -4
  11. package/errors/source-locale-not-defined.error.d.ts +0 -4
  12. package/errors/translation-not-defined.error.d.ts +0 -4
  13. package/esm2022/enums/collecting-strategies.enum.mjs +0 -25
  14. package/esm2022/enums/preloading-strategies.enum.mjs +0 -25
  15. package/esm2022/errors/locale-not-defined.error.mjs +0 -8
  16. package/esm2022/errors/scope-not-defined.error.mjs +0 -10
  17. package/esm2022/errors/source-locale-not-defined.error.mjs +0 -8
  18. package/esm2022/errors/translation-not-defined.error.mjs +0 -8
  19. package/esm2022/interceptors/translation.interceptor.mjs +0 -31
  20. package/esm2022/lib.module.mjs +0 -68
  21. package/esm2022/ogs-gmbh-ngx-translate.mjs +0 -5
  22. package/esm2022/pipe.module.mjs +0 -31
  23. package/esm2022/pipes/translation.pipe.mjs +0 -70
  24. package/esm2022/providers/config.provider.mjs +0 -16
  25. package/esm2022/providers/http.provider.mjs +0 -32
  26. package/esm2022/providers/interceptor.provider.mjs +0 -16
  27. package/esm2022/providers/preload.provider.mjs +0 -84
  28. package/esm2022/providers/scope.provider.mjs +0 -16
  29. package/esm2022/public-api.mjs +0 -23
  30. package/esm2022/services/translation-http.serivce.mjs +0 -58
  31. package/esm2022/services/translation-store.service.mjs +0 -379
  32. package/esm2022/services/translation.service.mjs +0 -332
  33. package/esm2022/tokens/config.token.mjs +0 -10
  34. package/esm2022/tokens/http.token.mjs +0 -18
  35. package/esm2022/tokens/preload.token.mjs +0 -10
  36. package/esm2022/tokens/scope.token.mjs +0 -10
  37. package/esm2022/types/config.type.mjs +0 -2
  38. package/esm2022/types/provider.type.mjs +0 -2
  39. package/esm2022/types/store.type.mjs +0 -2
  40. package/esm2022/utils/file.util.mjs +0 -85
  41. package/esm2022/utils/translate.util.mjs +0 -39
  42. package/index.d.ts +0 -5
  43. package/interceptors/translation.interceptor.d.ts +0 -16
  44. package/lib.module.d.ts +0 -24
  45. package/pipe.module.d.ts +0 -14
  46. package/pipes/translation.pipe.d.ts +0 -67
  47. package/providers/config.provider.d.ts +0 -12
  48. package/providers/http.provider.d.ts +0 -23
  49. package/providers/interceptor.provider.d.ts +0 -10
  50. package/providers/preload.provider.d.ts +0 -22
  51. package/providers/scope.provider.d.ts +0 -11
  52. package/public-api.d.ts +0 -22
  53. package/services/translation-http.serivce.d.ts +0 -23
  54. package/services/translation-store.service.d.ts +0 -214
  55. package/services/translation.service.d.ts +0 -108
  56. package/tokens/config.token.d.ts +0 -10
  57. package/tokens/http.token.d.ts +0 -18
  58. package/tokens/preload.token.d.ts +0 -9
  59. package/tokens/scope.token.d.ts +0 -9
  60. package/types/config.type.d.ts +0 -194
  61. package/types/provider.type.d.ts +0 -44
  62. package/types/store.type.d.ts +0 -113
  63. package/utils/file.util.d.ts +0 -24
  64. package/utils/translate.util.d.ts +0 -19
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2025 OGS Gesellschaft für Datenverarbeitung und Systemberatung mbH
3
+ Copyright (c) 2025 — present OGS Gesellschaft für Datenverarbeitung und Systemberatung mbH
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -1,50 +1,105 @@
1
- # i18n Translation Library
2
-
3
- ![GitHub License](https://img.shields.io/github/license/OGS-GmbH/ngx-translate?color=0f434e)
4
- ![NPM Version](https://img.shields.io/npm/v/%40ogs-gmbh%2Fngx-translate?color=0f434e)
5
- ![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/OGS-GmbH/ngx-translate/main-deploy.yml?color=0f434e)
6
-
7
- This Angular i18n library offers a REST-based approach to internationalization, with support for chunked and token-based translation loading.
8
-
9
- Translations are retrieved dynamically from remote endpoints, allowing for modular and scalable language management, especially in large applications or multi-tenant environments.
10
-
11
- Each translation chunk is associated with a specific feature or module, and access can be controlled via authentication tokens. The library enables runtime language switching and supports nested keys (multi-chunks).
12
-
13
- Its clean API and minimal setup make it easy to integrate into both new and existing projects.
14
-
15
- ## Installation
16
- To get started, you can install this package using your preferred package manager.
17
- ````shell
18
- npm install @ogs-gmbh/ngx-translate
19
- ````
20
-
21
- <details>
22
- <summary>Other package manager</summary>
23
- <br />
24
-
25
- ````shell
26
- yarn add @ogs-gmbh/ngx-translate
27
- ````
28
-
29
- ````shell
30
- pnpm install @ogs-gmbh/ngx-translate
31
- ````
32
-
33
- </details>
34
-
35
- ## License
36
- The MIT License (MIT) - Please have a look at the [LICENSE file](./LICENSE) for more details.
37
-
38
- ## Contributing
39
- Contributions are always welcome and greatly appreciated. Whether you want to report a bug, suggest a new feature, or improve the documentation, your input helps make the project better for everyone.
40
-
41
- If you're unsure where to start, check the open issues for guidance. Even small contributions, such as fixing typos or improving code readability, are valuable.
42
-
43
- Feel free to submit a pull request or start a discussion — we're happy to collaborate!
44
-
45
- ---
46
-
47
- <a href="https://www.ogs.de/en/"><img src="https://www.ogs.de/fileadmin/templates/main/img/logo.png" height="32" /></a>
48
- <p>Gesellschaft für Datenverarbeitung und Systemberatung mbH</p>
49
-
50
- [Imprint](https://www.ogs.de/en/imprint/) | [Contact](https://www.ogs.de/en/contact/) | [Careers](https://www.ogs.de/en/about-ogs/#Careers)
1
+ > *We're OGS, check out our work on [github.com/ogs-gmbh](https://github.com/ogs-gmbh)*
2
+
3
+ # ngx-translate
4
+
5
+ ![Preview](./docs/preview.avif)
6
+
7
+ <a href="./LICENSE" target="_blank"><img src="https://img.shields.io/github/license/OGS-GmbH/ngx-translate?color=0f434e&logo=hackthebox&logoColor=000000&labelColor=ffffff" /></a>
8
+ <a href="https://github.com/OGS-GmbH/ngx-translate/actions/workflows/main-deploy.yml" target="_blank"><img src="https://img.shields.io/github/actions/workflow/status/OGS-GmbH/ngx-translate/main-deploy.yml?color=0f434e&logo=rocket&logoColor=000000&labelColor=ffffff" /></a>
9
+ <a href="https://www.npmjs.com/package/@ogs-gmbh/ngx-translate" target="_blank"><img src="https://img.shields.io/npm/v/%40ogs-gmbh%2Fngx-translate?color=0f434e&logo=npm&logoColor=000000&labelColor=ffffff" /></a>
10
+
11
+ - **REST-based**\
12
+ Save, query and provide translations by API.
13
+
14
+ - **Optimized for performance**\
15
+ Pre-load, lazy-load and cache your translations
16
+
17
+ - **Multi-scoping ready**
18
+ Request multiple scopes which include translations at once
19
+
20
+ - **Developer experience**\
21
+ Use a local language for development & production
22
+
23
+ ## Getting Started
24
+
25
+ > [!IMPORTANT]
26
+ > We're offering an extensive API-Reference covered with in-depth usage examples of this project.
27
+
28
+ To get a starting point, simply refer to our documentation at [ogs-gmbh.github.io/ngx-translate](https://ogs-gmbh.github.io/ngx-translate).
29
+
30
+ ## Prerequisites
31
+
32
+ - Node.js version 18 or higher
33
+ - A package manager: e.g. npm, pnpm, ...
34
+
35
+ ## Installation
36
+
37
+ Using npm:
38
+ ```sh
39
+ $ npm install @ogs-gmbh/ngx-translate
40
+ ```
41
+
42
+ <details>
43
+ <summary>Using a different package managers?</summary>
44
+ <br/>
45
+
46
+ Using yarn:
47
+ ```sh
48
+ $ pnpm add @ogs-gmbh/ngx-translate
49
+ ```
50
+
51
+ Using pnpm:
52
+ ```sh
53
+ $ pnpm add @ogs-gmbh/ngx-translate
54
+ ```
55
+
56
+ Using bun:
57
+ ```sh
58
+ $ bun add @ogs-gmbh/ngx-translate
59
+ ```
60
+
61
+ </details>
62
+
63
+ ## License
64
+
65
+ The MIT License (MIT) - Please have a look at the [LICENSE file](./LICENSE) for more details.
66
+
67
+ ## Contributing
68
+ Contributions are always welcome and greatly appreciated. Whether you want to report a bug, suggest a new feature, or improve the documentation, your input helps make the project better for everyone.
69
+
70
+ Feel free to submit a pull request, issue or feature request.
71
+
72
+ ### Issues and Feature Requests
73
+ Reporting an issue or creating a feature request is made by creating a new issue on this repository.
74
+
75
+ You can create a [new issue or feature request here](../../issues/new/choose).
76
+
77
+ ### Pull Requests
78
+ GitHub offers a solid guideline for contributing to open source projects through pull requests, covering key practices. These best practices provide a reliable starting point for making effective contributions.
79
+
80
+ You can find the [guidelines here](https://docs.github.com/get-started/exploring-projects-on-github/contributing-to-a-project).
81
+
82
+ ### Code Of Conduct
83
+ We are committed to keeping a welcoming, inclusive, and respectful community for everyone. To help us achieve this, we kindly ask that you adhere to our [Code of Conduct](./CODE_OF_CONDUCT.md).
84
+
85
+ ## Disclaimer
86
+
87
+ All trademarks and registered trademarks mentioned are property of their respective owners and are used for identification purposes only. Use of these names does not imply endorsement or affiliation.
88
+
89
+ This project is a trademark of OGS Gesellschaft für Datenverarbeitung und Systemberatung mbH. The License does not grant rights to use the trademark without permission.
90
+
91
+ ---
92
+
93
+ <a href="https://www.ogs.de/en/">
94
+ <picture>
95
+ <source
96
+ srcset="https://raw.githubusercontent.com/OGS-GmbH/.github/refs/tags/v1.0.0/docs/assets/logo/light.svg"
97
+ media="(prefers-color-scheme: dark)"
98
+ />
99
+ <img height="64" alt="OGS Logo" src="https://raw.githubusercontent.com/OGS-GmbH/.github/refs/tags/v1.0.0/docs/assets/logo/dark.svg"
100
+ </picture>
101
+ </a>
102
+
103
+ Gesellschaft für Datenverarbeitung und Systemberatung mbH
104
+
105
+ [Imprint](https://www.ogs.de/en/imprint/) | [Contact](https://www.ogs.de/en/contact/) | [Careers](https://www.ogs.de/en/about-ogs/#Careers)