Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions src/renderer/src/i18n/ja-technical-literal-mistranslations.test.ts
Original file line number Diff line number Diff line change
@@ -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('プル')
})
})
4 changes: 2 additions & 2 deletions src/renderer/src/i18n/locales/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -10987,8 +10987,8 @@
"ed93b4f14f": "Commit",
"946a8a05ea": "このブランチの {{value0}} を作成します",
"e7ffa46946": "{{value0}} を作成する",
"95550cff15": "押す",
"d64292a938": "引く",
"95550cff15": "プッシュ",
"d64292a938": "プル",
"795f1509c5": "同期",
"390abeab93": "フォースプッシュ",
"1884cf34af": "このブランチをオリジンに公開します",
Expand Down
Loading