Pomo icon indicating copy to clipboard operation
Pomo copied to clipboard

Bug: Variables do not work with returnStrings = true

Open lemoer opened this issue 3 years ago • 0 comments

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"

lemoer avatar Sep 11 '21 22:09 lemoer