fix(i18n): keep chart part names as they read today

Waffle and ShareBar parts nested ui.valuePair inside the chart's own
pair, doubling the colon. Give a part its own ui.chartPart message that
renders exactly as before.
This commit is contained in:
Zakk committed 2026-09-30 02:37:28 +10:00
1 parent e320195747
commit 88e2928d1b
5 files changed
+8 -5

No files matched your search

+1
View File
@@ -1784,6 +1784,7 @@
"ui.cache": "Cache",
"ui.cancel": "Cancel",
"ui.changeApplying": "Another change is being applied",
"ui.chartPart": "{label} {value}",
"ui.clearFilters": "Clear filters",
"ui.config": "Configuration",
"ui.current": "Current",
+1
View File
@@ -1583,6 +1583,7 @@
"ui.cache": "缓存",
"ui.cancel": "取消",
"ui.changeApplying": "另一项修改正在应用",
"ui.chartPart": "{label} {value}",
"ui.clearFilters": "清除筛选",
"ui.config": "配置",
"ui.current": "当前",
+1
View File
@@ -1583,6 +1583,7 @@
"ui.cache": "快取",
"ui.cancel": "取消",
"ui.changeApplying": "另一項修改正在套用",
"ui.chartPart": "{label} {value}",
"ui.clearFilters": "清除篩選",
"ui.config": "組態",
"ui.current": "目前",
+4 -4
View File
@@ -8,10 +8,10 @@ const shares = [
];
it.each([
['en', 'Traffic: Proxy: 3, Direct: 1'],
['zh-TW', 'Traffic\uFF1AProxy\uFF1A3\uFF0CDirect\uFF1A1'],
['zh-CN', 'Traffic\uFF1AProxy\uFF1A3\uFF0CDirect\uFF1A1']
] as Array<[Lang, string]>)('describes every share as a complete value pair in %s', (lang, name) => {
['en', 'Traffic: Proxy 3, Direct 1'],
['zh-TW', 'Traffic\uFF1AProxy 3\uFF0CDirect 1'],
['zh-CN', 'Traffic\uFF1AProxy 3\uFF0CDirect 1']
] as Array<[Lang, string]>)('describes every share as one message in %s', (lang, name) => {
const t = (key: Parameters<typeof translate>[1], params?: Parameters<typeof translate>[2]) => translate(lang, key, params);
expect(shareDescription('Traffic', shares, t)).toBe(name);
});
+1 -1
View File
@@ -7,4 +7,4 @@ export const ChartDescription = createContext<string | undefined>(undefined);
export const useChartDescription = () => useContext(ChartDescription);
export const shareDescription = (label: string, shares: Array<{label: string; text: string}>, t: Translator) =>
t('ui.valuePair', {label, value: shares.map(share => t('ui.valuePair', {label: share.label, value: share.text})).join(t('ui.separator'))});
t('ui.valuePair', {label, value: shares.map(share => t('ui.chartPart', {label: share.label, value: share.text})).join(t('ui.separator'))});