This repository was archived by the owner on Dec 31, 2024. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -191,7 +191,7 @@ export default class VueI18n {
191191 // Match all the links within the local
192192 // We are going to replace each of
193193 // them with its translation
194- const matches : any = ret . match ( / ( @ : [ \w | . ] + ) / g)
194+ const matches : any = ret . match ( / ( @ : [ \w \- _ | . ] + ) / g)
195195 for ( const idx in matches ) {
196196 const link : string = matches [ idx ]
197197 // Remove the leading @:
Original file line number Diff line number Diff line change @@ -13,13 +13,17 @@ export default {
1313 linkEnd : 'This is a linked translation to @:message.hello' ,
1414 linkWithin : 'Isn\'t @:message.hello we live in great?' ,
1515 linkMultiple : 'Hello @:message.hoge!, isn\'t @:message.hello great?' ,
16+ linkHyphen : '@:hyphen-hello' ,
17+ linkUnderscore : '@:underscore_hello' ,
1618 'hyphen-locale' : 'hello hyphen' ,
1719 '1234' : 'Number-based keys are found' ,
1820 '1mixedKey' : 'Mixed keys are not found.'
1921 } ,
2022 'hello world' : 'Hello World' ,
2123 'Hello {0}' : 'Hello {0}' ,
2224 'continue-with-new-account' : 'continue with new account' ,
25+ 'hyphen-hello' : 'hyphen the wolrd' ,
26+ underscore_hello : 'underscore the wolrd' ,
2327 underscore : '{helloMsg} world' ,
2428 plurals : {
2529 car : 'car | cars' ,
Original file line number Diff line number Diff line change @@ -92,4 +92,11 @@ describe('issues', () => {
9292 } ) . then ( done )
9393 } )
9494 } )
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+ } )
95102} )
You can’t perform that action at this time.
0 commit comments