Skip to content

Commit af5d315

Browse files
committed
Review changes
1 parent 9038707 commit af5d315

File tree

5 files changed

+23
-28
lines changed

5 files changed

+23
-28
lines changed

src/DefaultEditor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ class DefaultEditor extends Component {
387387
<Info>
388388
{_(
389389
'The positioning inputs are relative to the ' +
390-
'anchor points on the text box'
390+
'anchor points on the text box.'
391391
)}
392392
</Info>
393393
<Radio

src/components/widgets/ColorPicker.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const CustomColorPicker = localize(
4949
return (
5050
<div>
5151
<div>
52-
<p className="colorpicker__title">{_('Custom colors')}</p>
52+
<p className="colorpicker__title">{_('Custom Colors')}</p>
5353
<div className="colorpicker__saturation">
5454
<Saturation {...props} />
5555
</div>
@@ -72,7 +72,7 @@ const CustomColorPicker = localize(
7272
</div>
7373
</div>
7474
<div>
75-
<p className="colorpicker__title">{_('Default colors')}</p>
75+
<p className="colorpicker__title">{_('Default Colors')}</p>
7676
<div className="colorpicker__preset-colors">
7777
<PresetColors colors={defaultColors} onClick={onChangeComplete} />
7878
</div>

src/components/widgets/text_editors/RichText/LinkEditor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class LinkEditor extends Component {
8989
render() {
9090
const {position} = this.state;
9191
const {onBlur, onFocus, linkURL, localize: _} = this.props;
92-
const placeholderText = _('Enter link URL');
92+
const placeholderText = _('Enter Link URL');
9393
const urlText = _('URL');
9494

9595
return (

utils/findLocaleStrings.js

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,14 @@ import path from 'path';
77
const pathToSrc = path.join(__dirname, '../src');
88
const srcGlob = path.join(pathToSrc, '**/*.js');
99

10-
let EXIT_CODE = 0;
1110
const localizeRE = /(^|[\.])(_|localize)$/;
1211

1312
findLocaleStrings();
1413

1514
function findLocaleStrings() {
1615
glob(srcGlob, (err, files) => {
1716
if (err) {
18-
EXIT_CODE = 1;
19-
console.log(err);
20-
return;
17+
throw new Error(err);
2118
}
2219

2320
const dict = {};
@@ -79,25 +76,23 @@ function findLocaleStrings() {
7976
});
8077

8178
if (!hasTranslation) {
82-
console.error('Found no translations.');
83-
EXIT_CODE = 1;
79+
throw new Error('Found no translations.');
8480
}
8581

86-
if (!EXIT_CODE) {
87-
const strings = Object.keys(dict)
88-
.sort()
89-
.map(k => k + spaces(maxLen - k.length) + ' // ' + dict[k])
90-
.join('\n');
91-
const pathToTranslationKeys = path.join(__dirname, 'translationKeys.txt');
92-
fs.writeFile(pathToTranslationKeys, strings);
93-
console.log('ok find_locale_strings');
94-
}
82+
const strings = Object.keys(dict)
83+
.sort()
84+
.map(k => k + spaces(maxLen - k.length) + ' // ' + dict[k])
85+
.join('\n');
86+
const pathToTranslationKeys = path.join(__dirname, 'translationKeys.txt');
87+
fs.writeFile(pathToTranslationKeys, strings);
88+
console.log(`translation keys were written to: ${pathToTranslationKeys}`);
9589
});
9690
}
9791

9892
function logError(file, node, msg) {
99-
console.error(file + ' [line ' + node.loc.start.line + '] ' + msg + '\n ');
100-
EXIT_CODE = 1;
93+
throw new Error(
94+
file + ' [line ' + node.loc.start.line + '] ' + msg + '\n '
95+
);
10196
}
10297

10398
function spaces(len) {
@@ -108,8 +103,8 @@ function spaces(len) {
108103
return out;
109104
}
110105

111-
process.on('exit', function() {
112-
if (EXIT_CODE) {
113-
throw new Error('find_locale_strings failed.');
106+
process.on('exit', function(code) {
107+
if (code === 1) {
108+
throw new Error('findLocaleStrings failed.');
114109
}
115110
});

utils/translationKeys.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ Continuing will convert your LaTeX expression into raw text.
2525
Continuing will convert your note to LaTeX-style text. // /components/widgets/text_editors/MultiFormatTextEditor.js:116
2626
Continuing will remove your expression. // /components/widgets/text_editors/MultiFormatTextEditor.js:126
2727
Custom // /DefaultEditor.js:179
28-
Custom colors // /components/widgets/ColorPicker.js:52
29-
Default colors // /components/widgets/ColorPicker.js:75
28+
Custom Colors // /components/widgets/ColorPicker.js:52
29+
Default Colors // /components/widgets/ColorPicker.js:75
3030
Display // /DefaultEditor.js:94
3131
Edit in HTML // /components/widgets/text_editors/MultiFormatTextEditor.js:34
3232
Edit in Rich Text // /components/widgets/text_editors/MultiFormatTextEditor.js:241
33-
Enter link URL // /components/widgets/text_editors/RichText/LinkEditor.js:92
33+
Enter Link URL // /components/widgets/text_editors/RichText/LinkEditor.js:92
3434
Filled Area // /DefaultEditor.js:104
3535
Fixed Height // /DefaultEditor.js:183
3636
Fixed Width // /DefaultEditor.js:182
@@ -82,7 +82,7 @@ Symbol
8282
Text // /DefaultEditor.js:364
8383
Text Attributes // /DefaultEditor.js:82
8484
The anchor point determines which side of the annotation's positioning coordinates refer to. // /DefaultEditor.js:256
85-
The positioning inputs are relative to the anchor points on the text box // /DefaultEditor.js:389
85+
The positioning inputs are relative to the anchor points on the text box. // /DefaultEditor.js:389
8686
This input has multiple values associated with it. Changing this setting will override these custom inputs. // /lib/constants.js:20
8787
Tick Labels // /DefaultEditor.js:334
8888
Tick Markers // /DefaultEditor.js:342

0 commit comments

Comments
 (0)