Skip to content

Translatable collector messages (schema 4) - #18

Merged
lesnik512 merged 2 commits into
mainfrom
message-codes
Oct 10, 2026
Merged

lesnik512 merged 2 commits into
mainfrom
message-codes

Conversation

@lesnik512

@lesnik512 lesnik512 commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

The page could translate its own texts but not what collect wrote: warnings, service errors and the Jira error reached it as finished English sentences. Now they carry a code and params, so the page renders them in Russian.

Report (breaking, schema 4)

  • New Message model: code (MessageCode), params, text (the English rendering, as before).
  • Service.warnings is list[Message]; Service.error and JiraState.error are Message | None.
  • 13 codes: ci_disabled, environments_disabled, no_default_branch, no_production, commits_truncated, tags_truncated, merged_elsewhere, gitlab_unreachable, gitlab_status, gitlab_denied, jira_token_rejected, jira_status, jira_unreachable.
  • English lives only in Python (_messages.py factories); the page uses text for English, so the wording is not duplicated.
  • JiraError carries its Message; _jira.py builds it.
  • CLI stderr prints text, unchanged except one case below.

Behaviour changes

  • A --jira service whose project lookup fails now goes through explain_failure like the others: team/web: GitLab returned 404 for the project. instead of the raw API path, and a 403 lists where to check access.
  • Multi-line errors (the 403 checklist) now keep their line breaks on the page (white-space: pre-line); they used to collapse into one line.

Page

  • MESSAGES.ru holds one renderer per code; message(item) falls back to text for English or an unknown code.
  • GitLab texts inside params (Jira's errorMessages, GitLab feature names and the settings path) stay as written.

Russian wording

Reviewed every Russian string, with a second independent review. Fixes beyond the new messages:

  • N из M: M is now genitive (4 из 5 MR или коммитов, 1 из 21 MR или коммита) via a new rowsOf key.
  • "голова основной ветки" calque replaced with "последний коммит основной ветки".
  • Clearer intro (which tag/release "него" meant), ignored-picks text (entries may be projects without a tag), range-cut tooltip, legend ("прошёл" matches the other pipeline states), "Данные собраны".
  • Messages avoid number agreement with free integers (Достигнут лимит коммитов (N)) and use proper cases for resources (dative after "доступ к", accusative after "получить").

Kept on purpose: team jargon (MR, деплой, прод, пайплайн, джоба, скоуп) and "упало, но падать разрешено" over allow_failure.

CI

Ruff 0.17.0 (unpinned in CI) added datetime to ICN001, so import datetime as dt in three modules. Main would fail on its next run without this.

Guards

tests/test_page.py:

  • every t('...') key used on the page exists in en, and en and ru have the same keys;
  • every MessageCode has a Russian renderer.

Both were checked to fail when a key or renderer is removed.

Release

This is 0.6.0. README and the skill now pin release-scope>=0.6,<0.7; the GitLab job needs the same bump after the release. Clickable URLs in messages are left for a later PR.

Checked in the browser with a schema 4 fixture in both languages.

Warnings, service errors and the Jira error become messages with a code,
params and the English text. Report schema 4. The page renders Russian
from the code and params and falls back to the text.
Ruff 0.17 adds datetime to ICN001's conventions.
Russian: genitive after 'из' in the shipped count, number-neutral commit
limit, dative and accusative resource forms, clearer range and pick texts.
@lesnik512
lesnik512 merged commit ddd664f into main Oct 10, 2026
12 checks passed
@lesnik512
lesnik512 deleted the message-codes branch October 10, 2026 08:01
@lesnik512 lesnik512 mentioned this pull request Oct 10, 2026
3 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant