@tolgee/format-icu 5.0.0-alpha.1 → 5.0.0-alpha.2
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.
- package/README.md +157 -0
- package/README.njk.md +44 -0
- package/package.json +3 -3
package/README.md
ADDED
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
<!-- This file was generated using pnpm generate-readmes script
|
|
2
|
+
|
|
3
|
+
Don't edit this file. Edit the README.md.njk. Macros can be found in readmeMacros/macros.njk
|
|
4
|
+
|
|
5
|
+
-->
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
<h1 align="center" style="border-bottom: none">
|
|
9
|
+
<b>
|
|
10
|
+
<a href="https://tolgee.io">Tolgee ICU Format Plugin</a><br>
|
|
11
|
+
</b>
|
|
12
|
+
The ICU Formatter Plugin for Tolgee JS integrations
|
|
13
|
+
<br>
|
|
14
|
+
</h1>
|
|
15
|
+
|
|
16
|
+
<div align="center">
|
|
17
|
+
|
|
18
|
+
[](https://tolgee.io)
|
|
19
|
+
|
|
20
|
+
Tolgee is an open-source alternative to Crowdin, Phrase, or Lokalise with its very own revolutionary integrations.
|
|
21
|
+
|
|
22
|
+

|
|
23
|
+
|
|
24
|
+

|
|
25
|
+
|
|
26
|
+

|
|
27
|
+

|
|
28
|
+

|
|
29
|
+
[](https://github.com/tolgee/tolgee-js)
|
|
30
|
+
[](https://github.com/tolgee/server)
|
|
31
|
+
[](https://github.com/tolgee/tolgee-platform/discussions)
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
<div align="center">
|
|
35
|
+
|
|
36
|
+
[<img src="https://img.shields.io/badge/-Facebook-424549?style=social&logo=facebook" height=25 />](https://www.facebook.com/Tolgee.i18n)
|
|
37
|
+
[<img src="https://img.shields.io/badge/-Twitter-424549?style=social&logo=twitter" height=25 />](https://twitter.com/Tolgee_i18n)
|
|
38
|
+
[<img src="https://img.shields.io/badge/-Linkedin-424549?style=social&logo=linkedin" height=25 />](https://www.linkedin.com/company/tolgee)
|
|
39
|
+
|
|
40
|
+
**Become part of the family. Join [slack channel <img src="https://img.shields.io/badge/-Tolgee Comunity-424549?style=social&logo=slack" height=25 />](https://join.slack.com/t/tolgeecommunity/shared_invite/zt-195isb5u8-_RcSRgVJfvgsPpOBIok~IQ)**
|
|
41
|
+
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
## What is Icu Format Plugin?
|
|
47
|
+
It's a plugin for Tolgee JS, which enables the rendering of messages in [ICU message format](https://tolgee.io/platform/icu_message_format).
|
|
48
|
+
For more information about the Tolgee ICU Format plugin, visit the [docs](https://tolgee.io/js-sdk/5.0.0-alpha.1/formatting#icu-formatter).
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
## Quick links
|
|
52
|
+
- [Tolgee JS SDK docs](https://tolgee.io/js-sdk)
|
|
53
|
+
- [Tolgee Website](https://tolgee.io)
|
|
54
|
+
- Product (Learn more about the great features)
|
|
55
|
+
- [Dev tools](https://tolgee.io/features/dev-tools)
|
|
56
|
+
- [Translation assistance](https://tolgee.io/features/translation-assistance)
|
|
57
|
+
- [Collaboration](https://tolgee.io/features/collaboration)
|
|
58
|
+
- Integrations (Learn how to integrate Tolgee with your favorite technology)
|
|
59
|
+
- [React](https://tolgee.io/integrations/react)
|
|
60
|
+
- [Angular](https://tolgee.io/integrations/angular)
|
|
61
|
+
- [Vue](https://tolgee.io/integrations/vue)
|
|
62
|
+
- [Svelte](https://tolgee.io/integrations/svelte)
|
|
63
|
+
- [Next.js](https://tolgee.io/integrations/next)
|
|
64
|
+
- [Gatsby](https://tolgee.io/integrations/gatsby)
|
|
65
|
+
- [More...](https://tolgee.io/integrations/all)
|
|
66
|
+
- [Tolgee platform docs](https://tolgee.io/platform)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
## Installation
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
npm install @tolgee/format-icu
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
## Usage
|
|
78
|
+
|
|
79
|
+
First, create a Tolgee instance and run it.
|
|
80
|
+
|
|
81
|
+
```ts
|
|
82
|
+
import { FormatIcu } from "@tolgee/format-icu";
|
|
83
|
+
|
|
84
|
+
const tolgee = Tolgee()
|
|
85
|
+
.use(FormatIcu())
|
|
86
|
+
.init(...)
|
|
87
|
+
|
|
88
|
+
...
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Now you can use ICU format in your translations. Example:
|
|
92
|
+
|
|
93
|
+
```ts
|
|
94
|
+
tolgee.t('test', 'Hello, I am {name}.', { name: 'John' })
|
|
95
|
+
// 'Hello, I am John.'
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Check our [ICU format documentation](https://tolgee.io/platform/icu_message_format) to learn more.
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
## Why to use Tolgee?
|
|
102
|
+
Because it saves a lot of time, you would spend on localization tasks without it. Because it enables you to provide perfectly translated software.
|
|
103
|
+
|
|
104
|
+
### Features
|
|
105
|
+
|
|
106
|
+
- All-in-one localization solution for your JS application 🙌
|
|
107
|
+
- Out-of-box in-context localization 🎉
|
|
108
|
+
- Automated screenshot generation 📷
|
|
109
|
+
- Translation management platform 🎈
|
|
110
|
+
- Open-source 🔥
|
|
111
|
+
|
|
112
|
+

|
|
113
|
+
Read more on the [Tolgee website](https://tolgee.io)
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
## Development
|
|
117
|
+
|
|
118
|
+
We welcome your PRs.
|
|
119
|
+
|
|
120
|
+
To develop the package locally:
|
|
121
|
+
1. Clone [the repository](https://github.com/tolgee/tolgee-js)
|
|
122
|
+
1. Install the packages in the repository root
|
|
123
|
+
```
|
|
124
|
+
pnpm install
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
1. Run web or any integration development script
|
|
129
|
+
```
|
|
130
|
+
pnpm develop:react
|
|
131
|
+
```
|
|
132
|
+
or
|
|
133
|
+
```
|
|
134
|
+
pnpm develop:web
|
|
135
|
+
```
|
|
136
|
+
This runs the development suite of this monorepo for the specific integration. The changes in each dependency package are
|
|
137
|
+
automatically built and propagated to the test application, which you can open and play within the browser.
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
### Testing
|
|
143
|
+
|
|
144
|
+
To run Jest tests of this package, execute
|
|
145
|
+
```
|
|
146
|
+
npm run test
|
|
147
|
+
```
|
|
148
|
+
In the `/packages/format-icu` directory.
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
## Contributors
|
|
153
|
+
|
|
154
|
+
<a href="https://github.com/tolgee/tolgee-platform/graphs/contributors">
|
|
155
|
+
<img alt="contributors" src="https://contrib.rocks/image?repo=tolgee/tolgee-js"/>
|
|
156
|
+
</a>
|
|
157
|
+
|
package/README.njk.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{% import "../../readmeMacros/macros.njk.md" as macros %}
|
|
2
|
+
|
|
3
|
+
{{ macros.header('Tolgee ICU Format Plugin', 'The ICU Formatter Plugin for Tolgee JS integrations', packageName) }}
|
|
4
|
+
|
|
5
|
+
## What is Icu Format Plugin?
|
|
6
|
+
It's a plugin for Tolgee JS, which enables the rendering of messages in [ICU message format](https://tolgee.io/platform/icu_message_format).
|
|
7
|
+
For more information about the Tolgee ICU Format plugin, visit the [docs]({{ macros.v5link('formatting#icu-formatter') }}).
|
|
8
|
+
|
|
9
|
+
{{ macros.links() }}
|
|
10
|
+
|
|
11
|
+
{{ macros.installation('format-icu') }}
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
First, create a Tolgee instance and run it.
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
import { FormatIcu } from "@tolgee/format-icu";
|
|
19
|
+
|
|
20
|
+
const tolgee = Tolgee()
|
|
21
|
+
.use(FormatIcu())
|
|
22
|
+
.init(...)
|
|
23
|
+
|
|
24
|
+
...
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Now you can use ICU format in your translations. Example:
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
tolgee.t('test', 'Hello, I am {name}.', { name: 'John' })
|
|
31
|
+
// 'Hello, I am John.'
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Check our [ICU format documentation](https://tolgee.io/platform/icu_message_format) to learn more.
|
|
35
|
+
|
|
36
|
+
{{ macros.why() }}
|
|
37
|
+
|
|
38
|
+
## Development
|
|
39
|
+
{{ macros.developmentInstallation() }}
|
|
40
|
+
{{ macros.developmentCore() }}
|
|
41
|
+
|
|
42
|
+
{{ macros.developmentTesting('/packages/format-icu') }}
|
|
43
|
+
|
|
44
|
+
{{ macros.contributors() }}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tolgee/format-icu",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.2",
|
|
4
4
|
"description": "Tolgee format-icu plugin.",
|
|
5
5
|
"main": "./dist/tolgee-format-icu.cjs.js",
|
|
6
6
|
"module": "./dist/tolgee-format-icu.esm.js",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@rollup/plugin-node-resolve": "13.3.0",
|
|
46
46
|
"@rollup/plugin-typescript": "8.3.4",
|
|
47
47
|
"@testing-library/jest-dom": "^5.16.5",
|
|
48
|
-
"@tolgee/core": "5.0.0-alpha.
|
|
48
|
+
"@tolgee/core": "5.0.0-alpha.2",
|
|
49
49
|
"@types/jest": "^27.0.2",
|
|
50
50
|
"@types/node": "^17.0.8",
|
|
51
51
|
"@types/testing-library__jest-dom": "^5.14.5",
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
"publishConfig": {
|
|
64
64
|
"access": "public"
|
|
65
65
|
},
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "10fd860a6c7d14d8d99bea89b2dd48c124ec80ec"
|
|
67
67
|
}
|