Pomo
Pomo copied to clipboard
Bug: Variables do not work with returnStrings = true
Variables do not work when returnStrings = true is set.
See the following minimal example:
let po = 'msgid "foo %d"\nmsgstr "bar %d"\n';
Pomo.load(po, { format: 'po', mode: 'literal'});
Pomo.returnStrings = true;
console.log(Pomo.getText("foo %d", { variables: [10] })) // returns "bar %d"
With returnStrings = false, the command returns bar 10
as expected :
let po = 'msgid "foo %d"\nmsgstr "bar %d"\n';
Pomo.load(po, { format: 'po', mode: 'literal'});
console.log(Pomo.getText("foo %d", { variables: [10] }).translation) // returns "bar 10"