Files
fvtt-chroniques-de-l-etrange/src/config/localize.js

35 lines
1.1 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* Chroniques de l'Étrange — Système FoundryVTT
*
* Chroniques de l'Étrange est un jeu de rôle édité par Antre-Monde Éditions.
* Ce système FoundryVTT est une implémentation indépendante et n'est pas
* affilié à Antre-Monde Éditions,
* mais a été réalisé avec l'autorisation d'Antre-Monde Éditions.
*
* @author LeRatierBretonnien
* @copyright 20242026 LeRatierBretonnien
* @license CC BY-NC-SA 4.0 https://creativecommons.org/licenses/by-nc-sa/4.0/
*/
import { MAGICS, SUBTYPES } from "./constants.js"
export function preLocalizeConfig() {
const localizeConfigObject = (obj, keys) => {
for (const o of Object.values(obj)) {
for (const key of keys) {
o[key] = game.i18n.localize(o[key])
}
}
}
localizeConfigObject(SUBTYPES, ["label"])
Object.values(MAGICS).forEach((magic) => {
magic.label = game.i18n.localize(magic.label)
magic.aspectlabel = game.i18n.localize(magic.aspectlabel)
Object.values(magic.speciality).forEach((spec) => {
spec.label = game.i18n.localize(spec.label)
spec.labelelement = game.i18n.localize(spec.labelelement)
})
})
}