Skip to content

Russian compaction usage labels use unclear literal in/out translations #53384

Description

@Wiedzmin-git

Description

The Russian compaction usage labels read as literal translations of English "in/out":

Сессия сжата · 217,2 тыс. в · 1,7 тыс. из

The suffixes в and из are unclear in this context. Suggested wording:

Сессия сжата · Вход: 217,2 тыс. · выход: 1,7 тыс.

The proposed translation is exactly Вход: {{input}} · выход: {{output}}, preserving both placeholders.

Plugins

None relevant to this translation.

OpenCode version

2.0.23. The same translation is still present in v2 at e2d5400.

Steps to reproduce

  1. Use the Russian locale in Desktop/Web.
  2. Complete a session compaction with input/output usage reported.
  3. Read the usage labels in the compaction timeline row.

Screenshot and/or share link

Before/after text is shown above; no session share link is provided.

Operating System

Windows; this is a shared locale string, not an OS-specific issue.

Terminal

OpenCode Desktop, not TUI.

Proposed contribution

A one-line fix is prepared independently of my feature proposals. The affected UI package typecheck and interpolation check passed on v2.0.23; I can submit a separate PR targeting current v2 if the wording is accepted.

The patches have been applied locally. In my own day-to-day use, I have not noticed bugs so far; this is a personal observation, not proof of correctness or a substitute for independent review.

I am not a programmer. The fix was created with AI assistance, and I cannot independently verify the code. Please independently review the wording and implementation before merging; automated tests and AI reviews are not a substitute for maintainer review.

Activity

  1. opencodejr commented on Oct 27, 2026

    @opencodejr
    Contributor

    Thanks for the clear report. I can confirm this on 2.0.23, and it still happens on the latest dev (f7d0ce1).

    The Russian string for ui.messagePart.compaction.usage in packages/ui/src/i18n/ru.ts is {{input}} в · {{output}} из. The English source is {{input}} in · {{output}} out, so "in/out" ended up as the prepositions в/из rather than words for input and output tokens. The compaction row in the session timeline builds its label as Сессия сжата · <usage>, so with numbers filled in it reads Сессия сжата · 217,2 тыс. в · 1,7 тыс. из, as you described.

    The script below loads the Russian translations and builds the label the same way the app does. It prints that exact text on both versions.

    Maintainers will review the wording (your suggestion Вход: {{input}} · выход: {{output}} keeps both placeholders) and decide on the fix.

    Reproduction script (repro.ts)
    // Renders the Russian compaction timeline label exactly as
    // packages/session-ui/src/message/message-content.tsx builds it:
    //   [t("ui.messagePart.compaction"), t("ui.messagePart.compaction.usage", {input, output})].join(" · ")
    // Usage: bun /workspace/repro/repro.ts [path-to-repo]   (default /workspace/repo)
    const repo = process.argv[2] ?? "/workspace/repo"
    const { dict } = await import(`${repo}/packages/ui/src/i18n/ru.ts`)
    const fmt = new Intl.NumberFormat("ru", { notation: "compact", maximumFractionDigits: 1 })
    const tpl = (s: string, p: Record<string, string>) => s.replace(/{{\s*(\w+)\s*}}/g, (_, k) => p[k] ?? "")
    const usage = tpl(dict["ui.messagePart.compaction.usage"], { input: fmt.format(217_200), output: fmt.format(1_700) })
    const label = [dict["ui.messagePart.compaction"], usage].join(" · ")
    console.log("raw template:", JSON.stringify(dict["ui.messagePart.compaction.usage"]))
    console.log("rendered:    ", label)
    if (/ в · .* из$/.test(label)) { console.log("BUG: prepositions 'в'/'из' used for input/output"); process.exit(1) }
    console.log("OK")

    Run it: bun repro.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions