Skip to content

Commit b370fa0

Browse files
committed
[fix.i18n.mu.D8+] the palette menu spoke Chinese in an English interface
Ivan: 把这个菜单翻译成英语,还有哪些地方就是那个用的是中文的. Scanned rather than guessed: three files in the app carry CJK, and only two of them reach a user. palette.js — the picker's seven option labels, their tooltips, and the 27 + 10 class names. save-state.js — the button, its title, and four toasts. The third hit is a comment in index.ts:1631 quoting a request in his own words, which stays: a comment recording what he asked for is not interface text and translating it would destroy the citation. Verified by reading the rendered DOM, not the diff: the picker now reads Graphite · off | Bauhaus | Nordic cool grey | Mid-century modern | Coarse · eight classes | Subunit · one colour per chain | Colour-vision safe, and a CJK regex over document.body.innerText returns 0 matches. The notes are translated as prose rather than glossed, because they carry the reason a palette exists — "the quietest of the four, the one you can stare at for an hour" is the whole content of that option and a literal rendering would have lost it.
1 parent 9ea4e93 commit b370fa0

2 files changed

Lines changed: 26 additions & 26 deletions

File tree

‎src/app.frontend.facets.molstar-rdkit.editable/palette.js‎

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,17 @@
3535

3636
// ── classes, in reading order ────────────────────────────────────────────
3737
var CLASSES = [
38-
['bb', '主链'], ['gly', '甘氨酸'], ['ali', '脂肪侧链'], ['pro', '脯氨酸环'],
39-
['coo', '羧酸盐'], ['gua', '胍基'], ['nh3', '铵'], ['imi', '咪唑'], ['amd', '酰胺'],
40-
['oh', '羟基'], ['phe_oh', '酚'], ['ind', '吲哚'], ['ph', '苯环'],
41-
['sh', '硫醇'], ['sme', '硫醚'],
42-
['pho', '磷酸'], ['sug', '糖'], ['pur', '嘌呤'], ['pyr', '嘧啶'],
43-
['lringC', '配体环碳'], ['lchainC', '配体链碳'], ['lN', '配体 N'], ['lO', '配体 O'],
44-
['lS', '配体 S'], ['hal', '卤素'], ['ion', '离子'], ['wat', '水'],
38+
['bb', 'backbone'], ['gly', 'glycine'], ['ali', 'aliphatic'], ['pro', 'proline ring'],
39+
['coo', 'carboxylate'], ['gua', 'guanidinium'], ['nh3', 'ammonium'], ['imi', 'imidazole'], ['amd', 'amide'],
40+
['oh', 'hydroxyl'], ['phe_oh', 'phenol'], ['ind', 'indole'], ['ph', 'phenyl'],
41+
['sh', 'thiol'], ['sme', 'thioether'],
42+
['pho', 'phosphate'], ['sug', 'sugar'], ['pur', 'purine'], ['pyr', 'pyrimidine'],
43+
['lringC', 'ligand ring C'], ['lchainC', 'ligand chain C'], ['lN', 'ligand N'], ['lO', 'ligand O'],
44+
['lS', 'ligand S'], ['hal', 'halogen'], ['ion', 'ion'], ['wat', 'water'],
4545
];
4646
var ORDER = CLASSES.map(function (c) { return c[0]; });
4747
// long-form names, shown in the option tooltip rather than in the option text
48-
var FULLNAME = {'off': '统一石墨', 'd2': '包豪斯 · 白地', 'd3': '北欧 · 冷灰与鼠尾草', 'd5': '中世纪现代 · 芥末与孔雀', 'c7': 'Okabe-Ito · 双色盲安全'};
48+
var FULLNAME = {'off': 'Uniform graphite', 'd2': 'Bauhaus · white ground', 'd3': 'Nordic · cool grey and sage', 'd5': 'Mid-century modern · mustard and peacock', 'c7': 'Okabe-Ito · safe for both colour deficiencies'};
4949

5050
// ── the coarse layer ─────────────────────────────────────────────────────
5151
// Ivan, on the MolecularNodes capsid render: 没有必要是每一个都单独标注,可以按大类标注.
@@ -70,8 +70,8 @@
7070
ion: 'ion', wat: 'wat',
7171
};
7272
var COARSE_ORDER = ['back', 'phob', 'arom', 'polr', 'nega', 'posi', 'nuc', 'lig', 'ion', 'wat'];
73-
var COARSE_NAMES = { back: '主链', phob: '疏水', arom: '芳香', polr: '极性', nega: '负电',
74-
posi: '正电', nuc: '核酸', lig: '配体', ion: '离子', wat: '水' };
73+
var COARSE_NAMES = { back: 'backbone', phob: 'hydrophobic', arom: 'aromatic', polr: 'polar', nega: 'negative',
74+
posi: 'positive', nuc: 'nucleic', lig: 'ligand', ion: 'ion', wat: 'water' };
7575

7676
function coarsePal(id, name, note, list) {
7777
var m = {};
@@ -95,25 +95,25 @@
9595
}
9696

9797
var PALETTES = [
98-
{ id: 'off', name: '石墨 · 默认', note: '今天的做法:整场一块灰。留作对照。', m: null },
98+
{ id: 'off', name: 'Graphite · off', note: 'What the app does today: one grey for the whole scene. Kept as the control.', m: null },
9999

100-
pal('d2', '包豪斯', '地几乎是白,只有蓝、黄和一个深梅携带色相,其余落在灰阶上。画面上任何有颜色的东西都是被强调的。',
100+
pal('d2', 'Bauhaus', 'The ground is nearly white; only blue, yellow and one deep plum carry hue, and everything else falls on the grey scale. Anything coloured on screen is therefore something being emphasised.',
101101
['#eae7df', '#e2ded4', '#d5d1c6', '#c6c2b6',
102102
'#b0473a', '#2f5590', '#4a72ab', '#7a6aa5', '#9a9a8e',
103103
'#8d9aa5', '#6f6fa2', '#7d6690', '#8f8c93',
104104
'#d8b02a', '#a98d3c',
105105
'#b0473a', '#cfcabc', '#2f5590', '#6d8fb8',
106106
'#232321', '#4f4e49', '#1f4d94', '#b0392c', '#e0bc1f', '#0f8f6e', '#8b9094', '#efece4']),
107107

108-
pal('d3', '北欧冷灰', '冷灰做地,鼠尾草绿、雾蓝、陶土做全部中景,只留一个暖点。最安静,长时间盯不累。',
108+
pal('d3', 'Nordic cool grey', 'Cool grey ground; sage, mist blue and terracotta carry the whole mid-ground, with a single warm accent. The quietest of the four — the one you can stare at for an hour.',
109109
['#dfdedb', '#d8d7d2', '#cdccc5', '#c0bfb7',
110110
'#a9645a', '#4f6f88', '#6d8fa3', '#8b83a0', '#8fa08c',
111111
'#7fa0a4', '#77809c', '#7c6f88', '#8d8d94',
112112
'#b2984f', '#96814f',
113113
'#a07260', '#c9c6ba', '#6f9078', '#8fae9c',
114114
'#33332f', '#5a5a53', '#3a6a9c', '#a95246', '#c2a134', '#1c8f7d', '#8d9296', '#e9e9e4']),
115115

116-
pal('d5', '中世纪现代', 'Eames / Girard 那一路:暖灰做地,芥末黄、孔雀蓝、柿子红、橄榄绿四个方向。最有性格。',
116+
pal('d5', 'Mid-century modern', 'The Eames / Girard line: warm grey ground with mustard, peacock, persimmon and olive pulling in four directions. The one with the most character.',
117117
['#ded9cd', '#d6d0c2', '#c9c2b0', '#bcb49f',
118118
'#b05540', '#2f6f82', '#4f8f9c', '#8a6f9c', '#8a9a5f',
119119
'#6f9fa8', '#63699c', '#8a5f7a', '#94868f',
@@ -122,14 +122,14 @@
122122
'#2b2a26', '#565349', '#2a5f9c', '#b04a30', '#d8ae1c', '#0f9478', '#8a9094', '#eae6db']),
123123

124124
// by big category, not by functional group
125-
coarsePal('grp', '大类 · 八色', '把 27 个官能团折成 8 个大类:主链/疏水/芳香/极性/负电/正电/核酸/配体。远看能认出来的粒度,不是显微镜粒度。',
125+
coarsePal('grp', 'Coarse · eight classes', 'The 27 functional groups folded into 8: backbone / hydrophobic / aromatic / polar / negative / positive / nucleic / ligand. The grain you can read from across the room, not the grain of a microscope.',
126126
['#cfcabd', '#b9c3ae', '#a9a3c4', '#8fb8bc', '#a9647a', '#5f7fa8', '#c0a86a', '#8a9aa4', '#9a8c74', '#e2e6e4']),
127127

128-
{ id: 'sub', name: '亚基 · 每链一色', kind: 'chain',
129-
note: '每条链一个柔和的色,像衣壳那种画法。它不陈述化学,它陈述"这些原子是同一个亚基" —— 在组装体上,那才是携带结构的事实。',
128+
{ id: 'sub', name: 'Subunit · one colour per chain', kind: 'chain',
129+
note: 'One soft colour per chain, the way a capsid is drawn. It makes no claim about chemistry; it says these atoms are one subunit — which, on an assembly, is the fact that carries the structure.',
130130
m: null },
131131

132-
pal('c7', '色盲安全', '从公认的色盲安全色出发,按暖纸底重调,红色盲和绿色盲两种模拟同时验证过 —— 安全性最强的一版。',
132+
pal('c7', 'Colour-vision safe', 'Built from the established colour-blind-safe set, re-tuned for the warm paper ground, and checked under both protanopia and deuteranopia simulation — the safest of the four.',
133133
['#bbb7ad', '#a69e8b', '#a69e8b', '#8a7f65',
134134
'#a9592b', '#2863ab', '#008fad', '#9a86bf', '#9b8a62',
135135
'#84a894', '#438463', '#66508b', '#b4935a',

‎src/app.frontend.facets.molstar-rdkit.editable/save-state.js‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@
138138

139139
// ── buttons ──────────────────────────────────────────────────────────────
140140
function label(sec, saved) {
141-
return saved ? '已保存 · 重存' : 'SAVE';
141+
return saved ? 'Saved · re-save' : 'SAVE';
142142
}
143143

144144
function mount() {
@@ -156,7 +156,7 @@
156156
b.type = 'button';
157157
b.className = BTN;
158158
b.textContent = label(sec, !!saved[name]);
159-
b.title = '记住这一栏当前的设置。切换分子或 representation 之后自动恢复。';
159+
b.title = 'Remember this panel\'s current settings. They come back automatically after a molecule or representation change.';
160160
b.addEventListener('click', function (ev) {
161161
ev.preventDefault(); ev.stopPropagation();
162162
var s = load();
@@ -166,22 +166,22 @@
166166
b.setAttribute('data-saved', '1');
167167
clr.hidden = false;
168168
var n = Object.keys(s[name].cb).length + Object.keys(s[name].sel).length + Object.keys(s[name].rng).length;
169-
toast('已保存「' + name.slice(0, 18) + '」的 ' + n + ' 个控件');
169+
toast('Saved ' + n + ' control' + (n === 1 ? '' : 's') + ' for \u201c' + name.slice(0, 18) + '\u201d');
170170
});
171171

172172
var clr = document.createElement('button');
173173
clr.type = 'button';
174174
clr.className = BTN + '-clr';
175-
clr.textContent = '清除';
175+
clr.textContent = 'Clear';
176176
clr.hidden = !saved[name];
177-
clr.title = '忘掉这一栏保存的设置';
177+
clr.title = 'Forget the settings saved for this panel';
178178
clr.addEventListener('click', function (ev) {
179179
ev.preventDefault(); ev.stopPropagation();
180180
var s = load(); delete s[name]; store(s);
181181
b.textContent = label(sec, false);
182182
b.removeAttribute('data-saved');
183183
clr.hidden = true;
184-
toast('已清除「' + name.slice(0, 18) + '」');
184+
toast('Cleared \u201c' + name.slice(0, 18) + '\u201d');
185185
});
186186

187187
if (saved[name]) b.setAttribute('data-saved', '1');
@@ -203,7 +203,7 @@
203203
var c = restore(sec, saved[n]);
204204
if (c) { total += c; hit.push(n.slice(0, 14) + ' ' + c); }
205205
});
206-
if (total) toast('已恢复 ' + total + ' 个控件 · ' + hit.join(' / ') + (why ? ' · ' + why : ''));
206+
if (total) toast('Restored ' + total + ' control' + (total === 1 ? '' : 's') + ' · ' + hit.join(' / ') + (why ? ' · ' + why : ''));
207207
}
208208

209209
// The two things that wipe the scene are the structure select and the
@@ -221,7 +221,7 @@
221221
// than guessing one delay. restore() is a no-op when nothing differs, so the
222222
// extra passes cost nothing once the scene has settled.
223223
[900, 2200, 4500, 8000].forEach(function (d) {
224-
setTimeout(function () { mount(); restoreAll(d === 900 ? '切换后自动恢复' : ''); }, d);
224+
setTimeout(function () { mount(); restoreAll(d === 900 ? 'auto-restored after switch' : ''); }, d);
225225
});
226226
}, true);
227227

0 commit comments

Comments
 (0)