Implement a button to create items of a specific subtype in the player inventory (closes #120)
This commit is contained in:
parent
b3e699bc32
commit
96f5b17785
9 changed files with 73 additions and 21 deletions
|
|
@ -1,8 +1,14 @@
|
|||
import { localizerConfig } from "../config.mjs";
|
||||
|
||||
export function localizer(key, args = {}, depth = 0) {
|
||||
export function handlebarsLocalizer(key, ...args) {
|
||||
let data = args[0]
|
||||
if (args.length === 1) data = args[0].hash;
|
||||
if (key instanceof Handlebars.SafeString) key = key.toString();
|
||||
const localized = localizer(key, data);
|
||||
return localized;
|
||||
};
|
||||
|
||||
export function localizer(key, args = {}, depth = 0) {
|
||||
/** @type {string} */
|
||||
let localized = game.i18n.format(key, args);
|
||||
const subkeys = localized.matchAll(localizerConfig.subKeyPattern);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue