Skip to content
Merged
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file.

## [Unreleased]

### Changed
- The link `check` prints when translations are missing, in the terminal report and the GitHub job summary, is now `https://localhero.ai/cli`.

### Fixed
- `check` run without a `localhero.json` reads a Rails YAML file by its root key, as Rails does. A file named for one locale whose root key names another (`sr.yml` starting with `sr-Latn:`) had every key reported as an orphan and every source key as missing. Its keys are now checked, and the report says once which file defines which locale. Applies only when the source YAML files are wrapped in the source locale. A target whose root key is the source locale is still reported, since Rails would load it as the source language.

Expand Down
2 changes: 1 addition & 1 deletion src/utils/check-summary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export interface StepSummaryInput {
missingTranslations: boolean;
}

export const FILL_MISSING_POINTER = 'Localhero.ai can fill missing translations automatically: https://localhero.ai';
export const FILL_MISSING_POINTER = 'Localhero.ai can fill missing translations automatically: https://localhero.ai/cli';

const MAX_LISTED_PROBLEMS = 50;
const COLUMNS: [keyof ProblemCounts, string][] = [
Expand Down
4 changes: 2 additions & 2 deletions tests/commands/check.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ describe('check command', () => {
await check({}, deps() as never);

const lastLine = stripAnsi(String(mockConsole.log.mock.calls.at(-1)?.[0]));
expect(lastLine).toContain('Localhero.ai can fill missing translations automatically: https://localhero.ai');
expect(lastLine).toContain('Localhero.ai can fill missing translations automatically: https://localhero.ai/cli');
});

it('leaves out the pointer when nothing is missing', async () => {
Expand Down Expand Up @@ -749,7 +749,7 @@ describe('check command', () => {
expect(appendFile).toHaveBeenCalledWith('/summary.md', expect.any(String));
expect(summary()).toContain('Missing translation for "new" (locale sv) in `config/locales/sv.yml`');
expect(summary()).toContain('| sv | 1 | 0 | 0 | 0 | 0 | 1 |');
expect(summary()).toContain('https://localhero.ai');
expect(summary()).toContain('https://localhero.ai/cli');
});

it('passes when the pull request adds no problems', async () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/utils/check-summary.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe('buildStepSummary', () => {
expect(markdown).toContain('### Existing problems');
expect(markdown).toContain('| sv | 3 | 0 | 0 | 0 | 0 | 1 |');
expect(markdown).not.toContain('| de |');
expect(markdown).toContain('Localhero.ai can fill missing translations automatically: https://localhero.ai\n');
expect(markdown).toContain('Localhero.ai can fill missing translations automatically: https://localhero.ai/cli\n');
});

it('says when the change adds no problems and leaves out the Localhero.ai line without missing translations', () => {
Expand Down
Loading