1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2024-10-27 20:34:29 +00:00
tobspr_shapez.io/src/js/translations.js

22 lines
634 B
JavaScript
Raw Normal View History

2020-05-17 10:12:13 +00:00
import { globalConfig } from "./core/config";
2020-05-19 09:11:08 +00:00
// @ts-ignore
2020-05-19 09:08:28 +00:00
const baseTranslations = require("./built-temp/base-en.json");
2020-05-17 10:12:13 +00:00
export const T = baseTranslations;
if (G_IS_DEV && globalConfig.debug.testTranslations) {
// Replaces all translations by fake translations to see whats translated and what not
const mapTranslations = obj => {
for (const key in obj) {
const value = obj[key];
if (typeof value === "string") {
obj[key] = value.replace(/[a-z]/gi, "x");
} else {
mapTranslations(value);
}
}
};
mapTranslations(T);
}