没有不值得去解决的问题,也没有不值得去学习的技术!

A Tour of Go Multilingual Translation Project Implements Upstream Sync for Long-Term Maintenance

[Figure 2: upstream source preview]

作者:

在

Background: Translation projects must handle upstream changes

The course content for A Tour of Go comes from the official repository:

Plaintext
golang/website

The early workflow was straightforward:

Plaintext
Official source code
    ↓
Translation
    ↓
Validation
    ↓
Release

This approach works for an initial translation but is not suitable for long-term maintenance.

When the upstream content changes, several questions need answering:

  • Which course pages have changed?
  • Are the existing translations still valid?
  • Do they need to be retranslated?
  • Which pages can continue to be reused?

Therefore, an upstream revision sync mechanism has been added to go-tour-i18n.


Recording the official source baseline

The project now records the corresponding upstream commit:

Plaintext
upstream_commit
upstream_commit_time

The release manifest includes:

JSON
{
  "upstream_commit": "645042eb697eaf69e33a9af00c6b5b3fffdead5a",
  "upstream_commit_time": "2026-08-20T05:56:11Z"
}

This ensures that every official release version clearly corresponds to:

  • Which official source code version;
  • Which translation result;
  • Which production release.
[Figure 1: Git commit and project status]
[Figure 1: Git commit and project status]

Automatically detecting upstream source changes

When the official source code is updated, the project first performs a source preview.

This detection found:

  • welcome.article removed the old Simplified Chinese community translation link;
  • basics.article changed var to an inline code tag;
  • 93 referenced Example sources had no content changes.

Detection results:

Plaintext
Page unchanged=103
content_changed=0
Example unchanged=93
content_changed=0
conditional unchanged=2

This means:

Most of the course content does not need to be retranslated; only the parts that have actually changed need to be processed.

[Figure 2: upstream source preview]
[Figure 2: upstream source preview]

stale status: avoiding overwriting historical translations

Previously, the only translation status was:

Plaintext
ready

However, after the upstream changes, the original translations cannot simply be considered still valid.

Therefore, the following has been added:

Plaintext
stale

status.

This time:

  • welcome/2
  • basics/9

Due to the source revision change, it goes from the original:

Plaintext
ready

to:

Plaintext
stale

Then it re-enters the translation workflow.

This avoids:

  • mistakenly assuming that old translations still correspond to the new source code;
  • manually missing upstream modifications.
[Figure 3: stale retranslation status]
[Figure 3: stale retranslation status]

Regenerating translation batches

For the changed pages, new translation tasks are generated:

Plaintext
chatgpt-zh-CN-013

It includes:

Plaintext
welcome/2
basics/9

Full workflow:

Plaintext
export
 ↓
ChatGPT raw response
 ↓
process
 ↓
restore
 ↓
validation
 ↓
Translation Quality Review
 ↓
promotion

Results this time:

Plaintext
process:
restore_passed=2
restore_failed=0

validation:
validation_passed=2
validation_failed=0

review:
2/2 approved

And the quality rating:

Plaintext
A
[Figure 4: Retranslation workflow]
[Figure 4: Retranslation workflow]

Promotion preflight check

After retranslation is completed, it is not published directly.

The project adds a promotion preflight.

This check:

Plaintext
unit_count=122
page_count=103
example_count=19

changed_count=2
unchanged_count=120

review_approved_count=122

can_apply=true

Confirms:

  • All translation units are complete;
  • The page count is correct;
  • Example status is normal;
  • Review has passed.

Only after this is it allowed to proceed to formal application.

[Figure 5: promotion preflight]
[Figure 5: promotion preflight]

Generating a new production release

Finally, a release bundle is generated:

JSON
{
  "locale": "zh-CN",
  "upstream_commit": "645042eb697eaf69e33a9af00c6b5b3fffdead5a",
  "translation_units": 122,
  "pages": 103,
  "eligible_examples": 19,
  "articles": 7
}

The current release includes:

  • 122 translation units;
  • 103 course pages;
  • 19 executable Examples;
  • 7 article files.
[Figure 6: release.json]
[Figure 6: release.json]

Summary

The implementation of this upstream sync mechanism completes a major upgrade for go-tour-i18n:

From:

Plaintext
One-time translation project

To:

Plaintext
Continuously maintained multilingual course system

New maintenance workflow:

Plaintext
golang/website upstream
        ↓
commit baseline
        ↓
source diff
        ↓
stale detection
        ↓
translation regeneration
        ↓
validation
        ↓
Translation Quality Review
        ↓
promotion
        ↓
production release

When expanding to more language versions in the future, the same set of sync and validation workflows can be reused without redesigning the entire translation system.

关于作者 · 持续学习与技术实践

我是一名拥有 15 年以上开发经验的技术从业者,自 2013 年起持续运营个人技术博客,记录工作与个人项目中遇到的真实问题,以及解决问题过程中的探索、实践和思考。

除了技术写作,我也在持续开发和维护自己的独立项目,探索新技术和新工具在实际场景中的应用。我始终相信,没有不值得去解决的问题,也没有不值得去学习的技术。

如果这篇文章对你有所帮助,欢迎浏览博客中的其他文章,也欢迎交流技术经验与想法。

关于我  ·  GitHub  ·  邮件联系