i18n: build translated sentences in code so they read correctly in every language (TBv3 + Mapper)

未关闭
#2,877 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
42/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
javascript, react

调研方向

Start with the named components in oclweb3 and oclmap: DeleteEntityDialog, ReleaseVersion, ResourceReferences, RepoHome, the event and error components, and SearchInputDrawer; then check constants.js and app startup language handling. Use the related translation PRs to see the affected sentence keys. Done means the listed UI text, dates, and document language follow the selected locale, with Spanish and Chinese event keys added.

由索引模型根据 Issue 内容生成。

描述

component/mapper component/web signal/has-dependencies signal/large-scope signal/low-risk signal/well-specified stage/triaged type/bug

Summary

The pt-BR review of oclweb3#60 and oclmap#90 (#2866) found sentences that the UI builds by stitching translated fragments together, or by dropping raw English values into translated text. No catalog edit can make these read correctly in Portuguese (or Spanish). They need code changes so that each sentence is a single translatable string with interpolated values. This ticket holds the code-side fixes that were deliberately kept out of the translation PRs so those could merge.

Acceptance criteria

  • DeleteEntityDialog, ReleaseVersion, ResourceReferences and repo.version.form.* take a translated resource-type label instead of the raw API type (Collection, concept, Source Version). The hardcoded 'versions, ' and 'concepts and mappings' in RepoHome go through i18n. Sentences avoid gendered articles before {{resourceType}}, or use per-type keys. (The unused common.object_types map added in oclweb3#60 can serve here; otherwise remove it.)
  • Activity feed (Events.jsx, DashboardEvents.jsx): each event type × object type is a whole-sentence key with preposition and site name, e.g. "Entrou no OCL", "Entrou em uma Organização X". The no-object "Joined" event stops using the API's English description. Remove the unused event_types.updated and .source. Add event_types / event_object_types for es and zh.
  • Error pages (Error401/403/404, ErrorUI): replace the please + link + or + … fragments with <Trans> sentences.
  • Search placeholders (SearchInputDrawer): replace the fragment chains with <Trans> sentences.
  • Relative times and dates follow the UI language: set the Moment locale at startup from the persisted language (both apps) and on change (oclweb3), and localize the M/D/YYYY formats in constants.js.
  • <html lang> follows the selected language.
  • oclweb3: guard UserMenu when the stored language isn't in LANGUAGES (a stored zh currently throws). Drop the i18n.languages = … overwrite in both apps.
  • Hardcoded English found near the touched code: UserProfile.jsx "Joined {date}" and Mapper ProjectLogs.jsx "{user} at {date}".

Related: #2866, OpenConceptLab/oclweb3#60, OpenConceptLab/oclmap#90

主要语言
没有语言数据
星标
4
派生
2
平均合并
2 小时 12 分钟
30 天内合并 PR
1

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

OpenConceptLab/ocl_issues 的其他 Issue

查看 OpenConceptLab/ocl_issues 的全部 Issue

相似的 Issue

更多 Web Dev Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。