This repository was archived by the owner on Dec 31, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -191,7 +191,7 @@ export default class VueI18n {
191
191
// Match all the links within the local
192
192
// We are going to replace each of
193
193
// them with its translation
194
- const matches : any = ret . match ( / ( @ : [ \w | . ] + ) / g)
194
+ const matches : any = ret . match ( / ( @ : [ \w \- _ | . ] + ) / g)
195
195
for ( const idx in matches ) {
196
196
const link : string = matches [ idx ]
197
197
// Remove the leading @:
Original file line number Diff line number Diff line change @@ -13,13 +13,17 @@ export default {
13
13
linkEnd : 'This is a linked translation to @:message.hello' ,
14
14
linkWithin : 'Isn\'t @:message.hello we live in great?' ,
15
15
linkMultiple : 'Hello @:message.hoge!, isn\'t @:message.hello great?' ,
16
+ linkHyphen : '@:hyphen-hello' ,
17
+ linkUnderscore : '@:underscore_hello' ,
16
18
'hyphen-locale' : 'hello hyphen' ,
17
19
'1234' : 'Number-based keys are found' ,
18
20
'1mixedKey' : 'Mixed keys are not found.'
19
21
} ,
20
22
'hello world' : 'Hello World' ,
21
23
'Hello {0}' : 'Hello {0}' ,
22
24
'continue-with-new-account' : 'continue with new account' ,
25
+ 'hyphen-hello' : 'hyphen the wolrd' ,
26
+ underscore_hello : 'underscore the wolrd' ,
23
27
underscore : '{helloMsg} world' ,
24
28
plurals : {
25
29
car : 'car | cars' ,
Original file line number Diff line number Diff line change @@ -92,4 +92,11 @@ describe('issues', () => {
92
92
} ) . then ( done )
93
93
} )
94
94
} )
95
+
96
+ describe ( '#170' , ( ) => {
97
+ it ( 'should be translated' , ( ) => {
98
+ assert . equal ( vm . $i18n . t ( 'message.linkHyphen' ) , messages . en [ 'hyphen-hello' ] )
99
+ assert . equal ( vm . $i18n . t ( 'message.linkUnderscore' ) , messages . en . underscore_hello )
100
+ } )
101
+ } )
95
102
} )
You can’t perform that action at this time.
0 commit comments