@deriv-com/translations 1.2.8 → 1.3.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.
|
@@ -142,6 +142,20 @@ const getKeyHash = (string) => crc32(string);
|
|
|
142
142
|
(err) => console.log(err)
|
|
143
143
|
);
|
|
144
144
|
|
|
145
|
+
// check if the directory of translations exist, if not create the directory of the translations first in the root
|
|
146
|
+
const translationsDir = path.resolve("./translations");
|
|
147
|
+
|
|
148
|
+
if (!fs.existsSync(translationsDir)) {
|
|
149
|
+
fs.mkdirSync(translationsDir)
|
|
150
|
+
}
|
|
151
|
+
// Add to en.json in translations directory
|
|
152
|
+
fs.writeFileSync(
|
|
153
|
+
path.resolve("./translations/en.json"),
|
|
154
|
+
JSON.stringify(messages_json),
|
|
155
|
+
"utf8",
|
|
156
|
+
(err) => console.log(err)
|
|
157
|
+
);
|
|
158
|
+
|
|
145
159
|
console.log("********* Translation strings compiled successfully *********")
|
|
146
160
|
} catch (e) {
|
|
147
161
|
program.error(e);
|
package/package.json
CHANGED