Extract a translation catalog compatible with mwg/i18n from a compiled game. MWL keeps the source text as the message id, so the base-language catalog maps each id to itself and translators fill in the other locales.
mwg/i18n
import { compile, extractCatalog } from '@datamoc/mw_games/mwl';const game = compile("[{ tag: 'game', schema: 0.1 }]");console.log(extractCatalog(game, { locale: 'fr' }).locale); // 'fr' Copy
import { compile, extractCatalog } from '@datamoc/mw_games/mwl';const game = compile("[{ tag: 'game', schema: 0.1 }]");console.log(extractCatalog(game, { locale: 'fr' }).locale); // 'fr'
Extract a translation catalog compatible with
mwg/i18nfrom a compiled game. MWL keeps the source text as the message id, so the base-language catalog maps each id to itself and translators fill in the other locales.