1
1
// MF1: { gender, select, male{he} female{she} other{they} }
2
2
const genderSelect : Select = {
3
- select : [ [ 'gender' ] ] ,
3
+ select : [ { var_path : [ 'gender' ] } ] ,
4
4
cases : [
5
5
{ key : [ 'male' ] , value : [ 'he' ] } ,
6
6
{ key : [ 'female' ] , value : [ 'she' ] } ,
@@ -10,83 +10,124 @@ const genderSelect: Select = {
10
10
11
11
// MF1: { count, plural, one{a message} other{# messages} }
12
12
const countPlural : Select = {
13
- select : [ { func : 'plural' , args : [ [ 'count' ] ] } ] ,
13
+ select : [ { func : 'plural' , args : [ { var_path : [ 'count' ] } ] } ] ,
14
14
cases : [
15
15
{ key : [ 'one' ] , value : [ 'a message' ] } ,
16
16
{
17
17
key : [ 'other' ] ,
18
- value : [ { func : 'number' , args : [ [ 'count' ] ] } , ' messages' ]
18
+ value : [ { func : 'number' , args : [ { var_path : [ 'count' ] } ] } , ' messages' ]
19
19
}
20
20
]
21
21
}
22
22
23
23
const gameMessages : Resource = {
24
24
id : 'game-messages' ,
25
25
locale : 'en' ,
26
- messages : {
27
- monsters : {
28
- dinosaur : { indefinite : [ 'a Dinosaur' ] , plural : [ 'Dinosaurs' ] } ,
29
- elephant : { indefinite : [ 'an Elephant' ] , plural : [ 'Elephants' ] } ,
30
- ogre : { indefinite : [ 'an Ogre' ] , plural : [ 'Ogres' ] } ,
31
- other : { indefinite : [ 'a Monster' ] , plural : [ 'Monsters' ] }
32
- } ,
33
- 'killed-by' : [
34
- 'You have been killed by ' ,
35
- { msg : [ 'monsters' , [ 'monster' ] , 'indefinite' ] }
36
- ] ,
37
- 'kill-count' : {
38
- select : [
39
- { func : 'plural' , args : [ [ 'monster-count' ] ] } ,
40
- { func : 'plural' , args : [ [ 'dungeon-count' ] ] }
41
- ] ,
42
- cases : [
26
+ entries : [
27
+ {
28
+ id : 'monsters' ,
29
+ entries : [
30
+ {
31
+ id : 'dinosaur' ,
32
+ entries : [
33
+ { id : 'indefinite' , value : [ 'a Dinosaur' ] } ,
34
+ { id : 'plural' , value : [ 'Dinosaurs' ] }
35
+ ]
36
+ } ,
43
37
{
44
- key : [ 'one' ] ,
45
- value : [
46
- 'You have killed ' ,
47
- { msg : [ 'monsters' , [ 'monster' ] , 'indefinite' ] } ,
48
- '.'
38
+ id : 'elephant' ,
39
+ entries : [
40
+ { id : 'indefinite' , value : [ 'an Elephant' ] } ,
41
+ { id : 'plural' , value : [ 'Elephants' ] }
49
42
]
50
43
} ,
51
44
{
52
- key : [ 'other' , 'one' ] ,
53
- value : [
54
- 'You have killed ' ,
55
- { func : 'number' , args : [ [ 'monster-count' ] ] } ,
56
- ' ' ,
57
- { msg : [ 'monsters' , [ 'monster' ] , 'plural' ] } ,
58
- ' in one dungeon.'
45
+ id : 'ogre' ,
46
+ entries : [
47
+ { id : 'indefinite' , value : [ 'an Ogre' ] } ,
48
+ { id : 'plural' , value : [ 'Ogres' ] }
59
49
]
60
50
} ,
61
51
{
62
- key : [ 'other' , 'other' ] ,
63
- value : [
64
- 'You have killed ' ,
65
- { func : 'number' , args : [ [ 'monster-count' ] ] } ,
66
- ' ' ,
67
- { msg : [ 'monsters' , [ 'monster' ] , 'plural' ] } ,
68
- ' in ' ,
69
- { func : 'number' , args : [ [ 'dungeon-count' ] ] } ,
70
- ' dungeons.'
52
+ id : 'other' ,
53
+ entries : [
54
+ { id : 'indefinite' , value : [ 'a Monster' ] } ,
55
+ { id : 'plural' , value : [ 'Monsters' ] }
71
56
]
72
57
}
73
58
]
59
+ } ,
60
+ {
61
+ id : 'killed-by' ,
62
+ value : [
63
+ 'You have been killed by ' ,
64
+ { msg_path : [ 'monsters' , { var_path : [ 'monster' ] } , 'indefinite' ] }
65
+ ]
66
+ } ,
67
+ {
68
+ id : 'kill-count' ,
69
+ value : {
70
+ select : [
71
+ { func : 'plural' , args : [ { var_path : [ 'monster-count' ] } ] } ,
72
+ { func : 'plural' , args : [ { var_path : [ 'dungeon-count' ] } ] }
73
+ ] ,
74
+ cases : [
75
+ {
76
+ key : [ 'one' ] ,
77
+ value : [
78
+ 'You have killed ' ,
79
+ {
80
+ msg_path : [ 'monsters' , { var_path : [ 'monster' ] } , 'indefinite' ]
81
+ } ,
82
+ '.'
83
+ ]
84
+ } ,
85
+ {
86
+ key : [ 'other' , 'one' ] ,
87
+ value : [
88
+ 'You have killed ' ,
89
+ { func : 'number' , args : [ { var_path : [ 'monster-count' ] } ] } ,
90
+ ' ' ,
91
+ { msg_path : [ 'monsters' , { var_path : [ 'monster' ] } , 'plural' ] } ,
92
+ ' in one dungeon.'
93
+ ]
94
+ } ,
95
+ {
96
+ key : [ 'other' , 'other' ] ,
97
+ value : [
98
+ 'You have killed ' ,
99
+ { func : 'number' , args : [ { var_path : [ 'monster-count' ] } ] } ,
100
+ ' ' ,
101
+ { msg_path : [ 'monsters' , { var_path : [ 'monster' ] } , 'plural' ] } ,
102
+ ' in ' ,
103
+ { func : 'number' , args : [ { var_path : [ 'dungeon-count' ] } ] } ,
104
+ ' dungeons.'
105
+ ]
106
+ }
107
+ ]
108
+ }
74
109
}
75
- }
110
+ ]
76
111
}
77
112
78
113
const extMessages : Resource = {
79
114
id : 'remote-ref' ,
80
115
locale : 'en' ,
81
- messages : {
82
- friend : [
83
- 'Your friend has become ' ,
84
- {
85
- func : 'sparkle' ,
86
- args : [
87
- { id : 'game-messages' , msg : [ 'monsters' , [ 'monster' ] , 'indefinite' ] }
88
- ]
89
- }
90
- ]
91
- }
116
+ entries : [
117
+ {
118
+ id : 'friend' ,
119
+ value : [
120
+ 'Your friend has become ' ,
121
+ {
122
+ func : 'sparkle' ,
123
+ args : [
124
+ {
125
+ res_id : 'game-messages' ,
126
+ msg_path : [ 'monsters' , { var_path : [ 'monster' ] } , 'indefinite' ]
127
+ }
128
+ ]
129
+ }
130
+ ]
131
+ }
132
+ ]
92
133
}
0 commit comments