fix(i18n): correct ja Push/Pull button translations (#12301)
The source-control primary action rendered 押す ("press") and 引く ("pull a
physical object") for Push/Pull. プッシュ/プル match the sibling フォースプッシュ
and 同期 labels. A guard test pins both so bootstrap re-translation cannot
silently regress them.
Co-authored-by: Iris-Fla <103801589+Iris-Fla@users.noreply.github.com>
This commit is contained in:
parent
38490ee6c1
commit
d4f2ae1454
|
|
@ -0,0 +1,42 @@
|
|||
/**
|
||||
* Guards the source control "Push"/"Pull" button mistranslations so
|
||||
* bootstrap re-translation cannot silently regress them.
|
||||
*/
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import ja from './locales/ja.json'
|
||||
|
||||
function findByKey(node: unknown, key: string): string | undefined {
|
||||
if (!node || typeof node !== 'object') {
|
||||
return undefined
|
||||
}
|
||||
if (Array.isArray(node)) {
|
||||
for (const item of node) {
|
||||
const found = findByKey(item, key)
|
||||
if (found !== undefined) {
|
||||
return found
|
||||
}
|
||||
}
|
||||
return undefined
|
||||
}
|
||||
const record = node as Record<string, unknown>
|
||||
if (typeof record[key] === 'string') {
|
||||
return record[key] as string
|
||||
}
|
||||
for (const value of Object.values(record)) {
|
||||
const found = findByKey(value, key)
|
||||
if (found !== undefined) {
|
||||
return found
|
||||
}
|
||||
}
|
||||
return undefined
|
||||
}
|
||||
|
||||
describe('ja technical literal / sense fixes', () => {
|
||||
it('translates the source control Push action as プッシュ, not 押す', () => {
|
||||
expect(findByKey(ja, '95550cff15')).toBe('プッシュ')
|
||||
})
|
||||
|
||||
it('translates the source control Pull action as プル, not 引く', () => {
|
||||
expect(findByKey(ja, 'd64292a938')).toBe('プル')
|
||||
})
|
||||
})
|
||||
|
|
@ -10998,8 +10998,8 @@
|
|||
"ed93b4f14f": "Commit",
|
||||
"946a8a05ea": "このブランチの {{value0}} を作成します",
|
||||
"e7ffa46946": "{{value0}} を作成する",
|
||||
"95550cff15": "押す",
|
||||
"d64292a938": "引く",
|
||||
"95550cff15": "プッシュ",
|
||||
"d64292a938": "プル",
|
||||
"795f1509c5": "同期",
|
||||
"390abeab93": "フォースプッシュ",
|
||||
"1884cf34af": "このブランチをオリジンに公開します",
|
||||
|
|
|
|||
Loading…
Reference in New Issue