@redhat-cloud-services/frontend-components-translations 3.2.7 → 3.2.8
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 +4 -4
- package/esm/locales/cs.json +1 -1
- package/locales/cs.json +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -116,10 +116,10 @@ class App extends Component {
|
|
|
116
116
|
## Export strings from your app
|
|
117
117
|
You can use [babel-plugin-react-intl](https://www.npmjs.com/package/babel-plugin-react-intl) to export all of your formatted messages from your app to generate JSON files that will be used by translators.
|
|
118
118
|
|
|
119
|
-
To join your messages to one JSON that can be uploaded to translate service and combine all languages together you can use `mergeMessages.js` from `@redhat-cloud-services/frontend-components-utilities`. For
|
|
119
|
+
To join your messages to one JSON that can be uploaded to translate service and combine all languages together you can use `mergeMessages.js` from `@redhat-cloud-services/frontend-components-utilities`. For description of how to pass custom config run `mergeMessages.js --help`
|
|
120
120
|
|
|
121
121
|
```bash
|
|
122
|
-
node node_modules/@redhat-cloud-services/frontend-components-utilities/mergeMessages.js
|
|
122
|
+
node node_modules/@redhat-cloud-services/frontend-components-utilities/mergeMessages/mergeMessages.js
|
|
123
123
|
```
|
|
124
124
|
|
|
125
125
|
## Use messages in your app
|
|
@@ -156,7 +156,7 @@ export default () => {
|
|
|
156
156
|
|
|
157
157
|
## Providing access to intl for a non-components
|
|
158
158
|
|
|
159
|
-
A file contaning app constants, that is very much not a component can still leverage
|
|
159
|
+
A file contaning app constants, that is very much not a component can still leverage
|
|
160
160
|
translations by using the `intlHelper` function in the following way.
|
|
161
161
|
|
|
162
162
|
```JS
|
|
@@ -165,7 +165,7 @@ import { intlHelper } from '@redhat-cloud-services/frontend-components-translati
|
|
|
165
165
|
import messages from './Messages';
|
|
166
166
|
const cache = createIntlCache();
|
|
167
167
|
const intl = createIntl({
|
|
168
|
-
onError: console.log,
|
|
168
|
+
onError: console.log,
|
|
169
169
|
locale: navigator.language
|
|
170
170
|
}, cache);
|
|
171
171
|
const intlSettings = {locale: navigator.language}
|
package/esm/locales/cs.json
CHANGED
package/locales/cs.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redhat-cloud-services/frontend-components-translations",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.8",
|
|
4
4
|
"description": "Translations package for RedHat Cloud Services project.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "esm/index.js",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"react-intl": "^6.4.4"
|
|
36
36
|
},
|
|
37
37
|
"optionalDependencies": {
|
|
38
|
-
"@redhat-cloud-services/frontend-components-utilities": "^
|
|
38
|
+
"@redhat-cloud-services/frontend-components-utilities": "^4.0.13"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@formatjs/cli": "^6.1.3",
|