diff --git a/src/path.js b/src/path.js index 5b205bd43..d9a625c19 100644 --- a/src/path.js +++ b/src/path.js @@ -42,7 +42,9 @@ pathStateMachine[IN_PATH] = { pathStateMachine[BEFORE_IDENT] = { 'ws': [BEFORE_IDENT], - 'ident': [IN_IDENT, APPEND] + 'ident': [IN_IDENT, APPEND], + '0': [IN_IDENT, APPEND], + 'number': [IN_IDENT, APPEND] } pathStateMachine[IN_IDENT] = { diff --git a/test/specs/fixture/locales.js b/test/specs/fixture/locales.js index 59992b998..5095f68b6 100644 --- a/test/specs/fixture/locales.js +++ b/test/specs/fixture/locales.js @@ -13,7 +13,9 @@ export default { link_end: 'This is a linked translation to @:message.hello', link_within: 'Isn\'t @:message.hello we live in great?', link_multiple: 'Hello @:message.hoge!, isn\'t @:message.hello great?', - 'hyphen-locale': 'hello hyphen' + 'hyphen-locale': 'hello hyphen', + '1234': 'Number-based keys are found', + '1mixedKey': 'Mixed keys are not found.' }, 'hello world': 'Hello World', 'Hello {0}': 'Hello {0}', @@ -51,7 +53,9 @@ export default { list: 'こんにちは {0}, ごきげんいかが?' }, fallback1: 'これはフォールバック', - 'hyphen-locale': 'こんにちは、ハイフン' + 'hyphen-locale': 'こんにちは、ハイフン', + '1234': '数字ベースのキーは見つかりませんでした。', + '1mixedKey': 'ミックスされたキーは見つかりませんでした。' }, plurals: { car: 'ザ・ワールド | これはフォールバック', diff --git a/test/specs/issues.js b/test/specs/issues.js index a54bcb98c..f221c05f0 100644 --- a/test/specs/issues.js +++ b/test/specs/issues.js @@ -55,4 +55,17 @@ describe('issues', () => { } }) }) + + describe('#97', () => { + it('should be translated', () => { + assert.equal( + vm.$t('message.1234'), + locales[Vue.config.lang]['message']['1234'] + ) + assert.equal( + vm.$t('message.1mixedKey'), + locales[Vue.config.lang]['message']['1mixedKey'] + ) + }) + }) })