Skip to content

Comments

chore(ci): add multiple language support for translation-changelog#61

Open
nevermarine wants to merge 9 commits intomainfrom
chore/ci/add-en-to-ru-for-translation-changelog
Open

chore(ci): add multiple language support for translation-changelog#61
nevermarine wants to merge 9 commits intomainfrom
chore/ci/add-en-to-ru-for-translation-changelog

Conversation

@nevermarine
Copy link

@nevermarine nevermarine commented Feb 17, 2026

Description

This PR adds bidirectional translation support to the translate-changelog action. The action now supports translating changelog files between English and Russian in both directions (en->ru and ru->en), with configurable file naming patterns.

Key technical changes:

  • Added source_lang and target_lang inputs to specify translation direction
  • Added file_prefix input for customizable file naming (e.g., CHANGELOG-v or v)
  • Added github_token input for PR creation authentication
  • Implemented YAML-aware translation that preserves structure and only translates values (keys remain in English)
  • Implemented smart branch management: creates or reuses translation branches
  • Added force push support to update existing translations when source files change

Why do we need it, and what problem does it solve?

Previously, the action only supported Russian->English translation with hardcoded file patterns. This created several limitations:

  1. One-way translation only: Users who write changelogs in English couldn't translate to Russian
  2. Inflexible file naming: The v*.yml pattern was hardcoded, couldn't work with different naming conventions like CHANGELOG-v*.yml
  3. Poor translation quality: Line-by-line translation was breaking YAML structure and translating keys like features: into функции:

This update enables:

  • Bidirectional translation workflows (write in either language, translate to the other)
  • Support for different repository file naming conventions
  • Proper YAML structure preservation with semantic translation

What is the expected result?

For Russian->English translation (default behavior):

- uses: your-org/translate-changelog@main
  with:
    github_token: ${{ secrets.GITHUB_TOKEN }}

For English->Russian translation:

- uses: your-org/translate-changelog@main
  with:
    github_token: ${{ secrets.GITHUB_TOKEN }}
    source_lang: en
    target_lang: ru
    file_prefix: CHANGELOG-v

Expected results:

  1. When a changelog file matching the pattern is committed, the action automatically creates a translation
  2. Translation branch is named translation/{source}-to-{target}/{version} (e.g., translation/en-to-ru/v3.1.0)
  3. YAML structure is preserved - only string values are translated, keys remain in English
  4. A PR is created with the translated changelog
  5. If the source file is updated, the translation is automatically updated (force push to the same branch)

Signed-off-by: Maksim Fedotov <maksim.fedotov@flant.com>
@nevermarine nevermarine marked this pull request as draft February 17, 2026 15:37
@nevermarine nevermarine self-assigned this Feb 18, 2026
Signed-off-by: Maksim Fedotov <maksim.fedotov@flant.com>
Signed-off-by: Maksim Fedotov <maksim.fedotov@flant.com>
Signed-off-by: Maksim Fedotov <maksim.fedotov@flant.com>
Signed-off-by: Maksim Fedotov <maksim.fedotov@flant.com>
Signed-off-by: Maksim Fedotov <maksim.fedotov@flant.com>
Signed-off-by: Maksim Fedotov <maksim.fedotov@flant.com>
Signed-off-by: Maksim Fedotov <maksim.fedotov@flant.com>
Signed-off-by: Maksim Fedotov <maksim.fedotov@flant.com>
@nevermarine nevermarine marked this pull request as ready for review February 24, 2026 08:42
@nevermarine nevermarine requested a review from duckhawk February 24, 2026 08:42
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