diff --git a/package.json b/package.json index 8fe55c4..2f8a04d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@secjs/intl", - "version": "1.0.0", + "version": "1.0.1", "description": "", "license": "MIT", "author": "João Lenon", diff --git a/resources/locales/pt-br/stub.json b/resources/locales/pt-br/stub.json index 06f4a37..1291e37 100644 --- a/resources/locales/pt-br/stub.json +++ b/resources/locales/pt-br/stub.json @@ -1,3 +1,3 @@ { - "test": "Olá meu nome é {{name}}!" + "test": "Olá meu nome é {{ name }}!" } diff --git a/src/Sntl.ts b/src/Sntl.ts index 6f0b13a..08cee0d 100644 --- a/src/Sntl.ts +++ b/src/Sntl.ts @@ -66,7 +66,7 @@ export class Sntl { if (fields) { Object.keys(fields).forEach(k => { - message = message.replace(new RegExp(`{{${k}}}`), fields[k]) + message = message.replace(new RegExp(`{{\\s*${k}\\s*}}`), fields[k]) }) }