fix i18n messages when token is 0

This commit is contained in:
jessop 2019-12-16 22:50:43 -05:00 committed by Jeremy Kauffman
parent 5c4e841ac3
commit c9fd7f032c
2 changed files with 2 additions and 2 deletions

View file

@ -59,6 +59,6 @@ export function __(message, tokens) {
}
return translatedMessage.replace(/%([^%]+)%/g, function($1, $2) {
return tokens[$2] || $2;
return tokens.hasOwnProperty($2) ? tokens[$2] : $2;
});
}