mirror of
https://github.com/go-gitea/gitea.git
synced 2026-06-03 14:26:45 +02:00
The Workflow Dependencies graph in the Actions run details view had hard-coded English strings. Also in projects view and contributors view I found some hard-coded strings. The other items in the issue #37787 (Summary / All jobs / Run Details / Workflow file / Triggered via / Total duration) were already wired through ctx.Locale.Tr; their translations just need to land in the non-English locale_*.json files via the translation pipeline. Fixes #37787 --------- Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: Claude (Opus 4.8) <noreply@anthropic.com>
16 lines
636 B
TypeScript
16 lines
636 B
TypeScript
import {trN} from './i18n.ts';
|
|
import {getCurrentLocale} from '../utils.ts';
|
|
|
|
vi.mock('../utils.ts', () => ({getCurrentLocale: vi.fn()}));
|
|
|
|
test('trN', () => {
|
|
vi.mocked(getCurrentLocale).mockReturnValue('en-US');
|
|
expect(trN(0, '%d job', '%d jobs')).toEqual('0 jobs');
|
|
expect(trN(1, '%d job', '%d jobs')).toEqual('1 job');
|
|
expect(trN(2, '%d job', '%d jobs')).toEqual('2 jobs');
|
|
expect(trN(1000, '%d job', '%d jobs')).toEqual('1000 jobs');
|
|
// languages without a distinct singular always use the plural form
|
|
vi.mocked(getCurrentLocale).mockReturnValue('zh-CN');
|
|
expect(trN(1, '%d job', '%d jobs')).toEqual('1 jobs');
|
|
});
|