Skip to content

Commit c777987

Browse files
committed
Fixed Swedish translation and updated i18n instructions.
1 parent a0968d6 commit c777987

File tree

5 files changed

+73
-22
lines changed

5 files changed

+73
-22
lines changed

build/cwc/locales.js

Lines changed: 42 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,13 @@ closureBuilder.build({
108108

109109

110110
/**
111-
* JPN Translation.
111+
* FRA Translation.
112112
*/
113113
closureBuilder.build({
114-
name: 'Locales.jpn',
114+
name: 'Locales.fra',
115115
srcs: glob([
116-
'locales/_jpn.js',
117-
'locales/jpn/**/*.js',
116+
'locales/_fra.js',
117+
'locales/fra/**/*.js',
118118
]),
119119
externs: [
120120
'build/externs/locales.js',
@@ -125,17 +125,17 @@ closureBuilder.build({
125125
rewrite_polyfills: false,
126126
},
127127
},
128-
out: 'genfiles/core/js/locales/jpn.js',
128+
out: 'genfiles/core/js/locales/fra.js',
129129
});
130130

131131

132132
/**
133-
* KOR Translation.
133+
* HIN Translation.
134134
*/
135135
closureBuilder.build({
136-
name: 'Locales.kor',
136+
name: 'Locales.hin',
137137
srcs: glob([
138-
'locales/kor/translation.js',
138+
'locales/hin/translation.js',
139139
]),
140140
externs: [
141141
'build/externs/locales.js',
@@ -146,17 +146,18 @@ closureBuilder.build({
146146
rewrite_polyfills: false,
147147
},
148148
},
149-
out: 'genfiles/core/js/locales/kor.js',
149+
out: 'genfiles/core/js/locales/hin.js',
150150
});
151151

152152

153153
/**
154-
* HIN Translation.
154+
* JPN Translation.
155155
*/
156156
closureBuilder.build({
157-
name: 'Locales.hin',
157+
name: 'Locales.jpn',
158158
srcs: glob([
159-
'locales/hin/translation.js',
159+
'locales/_jpn.js',
160+
'locales/jpn/**/*.js',
160161
]),
161162
externs: [
162163
'build/externs/locales.js',
@@ -167,17 +168,17 @@ closureBuilder.build({
167168
rewrite_polyfills: false,
168169
},
169170
},
170-
out: 'genfiles/core/js/locales/hin.js',
171+
out: 'genfiles/core/js/locales/jpn.js',
171172
});
172173

174+
173175
/**
174-
* FRA Translation.
176+
* KOR Translation.
175177
*/
176178
closureBuilder.build({
177-
name: 'Locales.fra',
179+
name: 'Locales.kor',
178180
srcs: glob([
179-
'locales/_fra.js',
180-
'locales/fra/**/*.js',
181+
'locales/kor/translation.js',
181182
]),
182183
externs: [
183184
'build/externs/locales.js',
@@ -188,9 +189,32 @@ closureBuilder.build({
188189
rewrite_polyfills: false,
189190
},
190191
},
191-
out: 'genfiles/core/js/locales/fra.js',
192+
out: 'genfiles/core/js/locales/kor.js',
192193
});
193194

195+
196+
/**
197+
* SWE Translation.
198+
*/
199+
closureBuilder.build({
200+
name: 'Locales.swe',
201+
srcs: glob([
202+
'locales/_swe.js',
203+
'locales/swe/**/*.js',
204+
]),
205+
externs: [
206+
'build/externs/locales.js',
207+
],
208+
compress: true,
209+
options: {
210+
closure: {
211+
rewrite_polyfills: false,
212+
},
213+
},
214+
out: 'genfiles/core/js/locales/swe.js',
215+
});
216+
217+
194218
/**
195219
* VIE Translation.
196220
*/

build/external/extra_files.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ closureBuilder.build({
3939
});
4040

4141

42+
/**
43+
* Blockly translation
44+
*/
4245
closureBuilder.build({
4346
name: 'Blockly language files',
4447
resources: [
@@ -48,6 +51,7 @@ closureBuilder.build({
4851
BlocklyPath + 'msg/js/hi.js',
4952
BlocklyPath + 'msg/js/ja.js',
5053
BlocklyPath + 'msg/js/ko.js',
54+
BlocklyPath + 'msg/js/sv.js',
5155
BlocklyPath + 'msg/js/vi.js',
5256
],
5357
out: 'genfiles/third_party/external/blockly/msg/',

doc/I18N.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,29 @@ closureBuilder.build({
6666
});
6767
```
6868

69+
### Adjust Blockly translation build rule
70+
71+
Adjust the *Blockly translation* build rule in the file
72+
`build/external/extra_files.js` to include the new supported language.
73+
74+
Example for the "deu" translation:
75+
76+
```javascript
77+
/**
78+
* Blockly translation
79+
*/
80+
closureBuilder.build({
81+
name: 'Blockly language files',
82+
resources: [
83+
...
84+
BlocklyPath + 'msg/js/de.js',
85+
...
86+
],
87+
out: 'genfiles/third_party/external/blockly/msg/',
88+
});
89+
```
90+
91+
6992
Additional language support
7093
----------------------------
7194

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"eslint": "^4.19.1",
1515
"eslint-config-google": "^0.9.1",
1616
"http-server": "latest",
17-
"jasmine-core": "^3.2.1",
17+
"jasmine-core": "^3.3.0",
1818
"jsdoc": "^3.5.5",
1919
"karma": "^3.1.1",
2020
"karma-chrome-launcher": "latest",

0 commit comments

Comments
 (0)