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 +19
-2
lines changed
Expand file tree Collapse file tree 3 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ export default function (Vue) {
4141 if ( ! locale ) { return null }
4242
4343 let val = getValue ( locale , key )
44+ if ( Array . isArray ( val ) ) { return val }
4445 if ( isNil ( val ) ) { val = locale [ key ] }
4546 if ( isNil ( val ) ) { return null }
4647
Original file line number Diff line number Diff line change @@ -36,7 +36,10 @@ export default {
3636 [
3737 'this is nested array error 1'
3838 ]
39- ]
39+ ] ,
40+ issues : {
41+ array_bugs : [ 'bug1' , 'bug2' ]
42+ }
4043 } ,
4144 ja : {
4245 message : {
@@ -66,6 +69,9 @@ export default {
6669 [
6770 'これはネストされた配列のエラー1です。'
6871 ]
69- ]
72+ ] ,
73+ issues : {
74+ array_bugs : [ 'バグ1' , 'バグ2' ]
75+ }
7076 }
7177}
Original file line number Diff line number Diff line change @@ -45,4 +45,14 @@ describe('issues', () => {
4545 )
4646 } )
4747 } )
48+
49+ describe ( '#91, #51' , ( ) => {
50+ it ( 'should be translated' , ( ) => {
51+ const arrayLocales = locales [ Vue . config . lang ] . issues . array_bugs
52+ for ( let i = 0 ; i < arrayLocales . length ; i ++ ) {
53+ const item = vm . $t ( 'issues.array_bugs' ) [ i ]
54+ assert . equal ( item , arrayLocales [ i ] )
55+ }
56+ } )
57+ } )
4858} )
You can’t perform that action at this time.
0 commit comments