Skip to content

Commit 2dc5006

Browse files
committed
Translation module.
1 parent 109982e commit 2dc5006

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

examples/App.re

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ module WithRawIntlProvider = {
1717
let intlConfig =
1818
ReactIntl.intlConfig(
1919
~locale=locale->Locale.toString,
20-
~messages=locale->Locale.translations->Util.translationsToDict,
20+
~messages=locale->Locale.translations->Translation.toDict,
2121
(),
2222
);
2323
let intlCache = ReactIntl.createIntlCache();
@@ -44,7 +44,7 @@ let make = () => {
4444

4545
<ReactIntl.IntlProvider
4646
locale={locale->Locale.toString}
47-
messages={locale->Locale.translations->Util.translationsToDict}>
47+
messages={locale->Locale.translations->Translation.toDict}>
4848
<Page locale setLocale={locale => locale->SetLocale->dispatch} />
4949
</ReactIntl.IntlProvider>;
5050
};

examples/Locale.re

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[@bs.module "./translations/en.json"]
2-
external en: array(Util.translation) = "default";
2+
external en: array(Translation.t) = "default";
33
[@bs.module "./translations/ru.json"]
4-
external ru: array(Util.translation) = "default";
4+
external ru: array(Translation.t) = "default";
55

66
type locale =
77
| En

examples/Util.re renamed to examples/Translation.re

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
type translation = {
1+
type t = {
22
id: string,
33
defaultMessage: string,
44
message: Js.nullable(string),
55
};
66

7-
let translationsToDict = (translations: array(translation)) => {
7+
let toDict = (translations: array(t)) => {
88
translations->Belt.Array.reduce(
99
Js.Dict.empty(),
1010
(dict, entry) => {

0 commit comments

Comments
 (0)