35 lines
1.1 KiB
JavaScript
35 lines
1.1 KiB
JavaScript
/**
|
||
* 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 2024–2026 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)
|
||
})
|
||
})
|
||
}
|