Releases: i18next/i18next-scanner
Releases · i18next/i18next-scanner
v2.0.4
v2.0.3
v2.0.2
v2.0.1
v2.0.0
v1.9.4
v1.9.3
Add a propsFilter
callback to the options object of parseFuncFromString to filter the props string (7de861b)
const options = {
// Replace all special characters from string.
// Example: JsRender Helper
// {{:~i18n('For details, see the help page at ${url}.', { 'url': #data['url'] })}}
propsFilter: (s) => { // s = "{ 'url': #data['url'] }"
return s.replace(/#/g, ''); // "{ 'url': data['url'] }"
}
};
parser.parseFuncFromString(code, options, (key, options) => {
const defaultValue = key;
parser.set(key, {
...options,
defaultValue: defaultValue,
nsSeparator: false,
keySeparator: false
});
});