Uh oh!
There was an error while loading. Please reload this page.
fix(i18n): use 词元 instead of 令牌 for token in zh locale - #40977
Conversation
…essmanbilibili/opencode into fix/zh-token-translation
Hona
commented
Aug 7, 2026
Thanks! I'll take a look |
Uh oh!
There was an error while loading. Please reload this page.
bad translation from china government |
Eronana
commented
Aug 10, 2026
This is a terrible, awful translation. It should never have been allowed into this codebase. |
Please reject these pointless and garbage pull requests and focus on product development. |
zce
commented
Aug 10, 2026
|
Speechlessmanbilibili
commented
Aug 10, 2026
But 令牌 is not a correct translation; it is more likely to cause misunderstanding. |
zce
commented
Aug 10, 2026
I strongly prefer keeping Token here. It is already the established term among Chinese, and is far more widely recognized than “词元”. It’s like NBA vs. 美职篮: a translation can be technically valid without being what people actually use. Localization should reflect established community usage, not try to redefine it. |
silicon14
commented
Aug 10, 2026
The ONLY correct translation is “词元”. This is the hard truth. |
SlightDust
commented
Aug 10, 2026
Who defines "CORRECT"? First there was the term "token" translated as "令牌", then the Chinese government came up with "词元". "令牌" was already an accepted translation, so why is "词元" supposedly the CORRECT one? Just because the Chinese government proposed it? If you ask me, that's over-politicizing things. |
silicon14
commented
Aug 10, 2026
Do you know what government means? Yes, government defines which is CORRECT. |
dmwin72015
commented
Aug 10, 2026
Please don't pollute the civilized world. |
hangyan
commented
Aug 10, 2026
looks good |
In the Chinese context, “令牌” means an authentication token, which is obviously inconsistent with the meaning of “token” in the LLM context. “词元” may not be a particularly good Chinese translation, but in any case, it is better than “令牌”. |
tqtij03440
commented
Aug 10, 2026
Please stop introducing this outdated and obsolete pictographic writing system into this open-source project. This is a political project driven by the Chinese government. |
hellodigua
commented
Aug 10, 2026
不知道在吵什么,我觉得原来令牌这个翻译确实不合理,在我心理最合理的翻译,就 token不动 > 词元 > 令牌,词元起码比令牌更合理一些 不讨论官方立场,中文翻译追求事物的本意,从这点上词元我感觉确实问题不大,起码暂时找不到比这个更合理的翻译了。 举个反例,要是按照日语的翻译逻辑,给token翻译成片假名 “托肯” “脱坑”之类的,看楼上的怎么评价 🤣 |
rakshith1928
commented
Aug 10, 2026
Came from the X post |
Eronana
commented
Aug 10, 2026
I agree, but I prefer to directly use the word To be frank, I don’t like the term That said, |
yiding-he
commented
Aug 10, 2026
在界面上,二者的表达并不难区分,所以错误的翻译应该纠正。 |
Ion-nsx
commented
Aug 10, 2026
恶心人🤢 |
pplab
commented
Aug 10, 2026
Why not check what Wikipedia says? |
官方"词元"的翻译肯定好于“令牌”,一帮魑魅魍魉在此狂吠,真令人作呕! |
词元容易让人误解1个token是一个词, |
1208nn
commented
Aug 10, 2026
'词元量' may better than '词元数'. It sometimes a cost unit. btw, this translation has not yet been officially ratified; it is only a recommended usage and remains provisional. |
OliverZou
commented
Aug 10, 2026
这个怎么可能,你这是语文...> 词元容易让人误解1个token是一个词,
|
alexj11324
commented
Aug 10, 2026
Since "token" is already widely recognized and commonly used among Chinese developers, I don’t think there is much benefit in translating it as "词元." Keeping "token" untranslated would be clearer and more consistent with how the developer community actually uses the term. As others have mentioned above, "词元" is a relatively formal translation that has been promoted largely through Chinese government-affiliated press and does not necessarily reflect the terminology preferred by the majority of Chinese developers. More broadly, there are many English technical terms whose official Chinese translations have never become common in everyday usage. For example, "无线局域网" may be used as a formal translation in contexts related to Wi-Fi, while most people simply say "Wi-Fi." Similarly, "App" remains extremely common in Chinese despite the existence of translations such as "应用" or "应用程序." For this reason, I think it would be better for the OpenCode maintenance team to keep "token" untranslated in the Chinese localization. This would better match actual developer usage and make the terminology feel more natural to Chinese users. |
mstscmsn
commented
Aug 10, 2026
傻逼 |
jhqn2023
commented
Aug 11, 2026
is:pr is:open 蠢人翻译插入 "词元"这种私货, |
davyzhu
commented
Aug 11, 2026
Technical issues should not be politicized; support opencode in translating token as 词元. 技术问题不应该政治化,支持opencode把token翻译成词元。 |
Fission21
commented
Aug 11, 2026
https://www.peopleapp.com/column/30052861725-500007638386 |
词元 the word itself is objectively bad and fundamentally incorrect as tokens could be larger than words(词) or span over word boundaries. Tokenizers do not operate on 词 but rather on byte streams. There is nothing 元 about tokens at all with respect to splitting up words. |
cfmj
commented
Aug 11, 2026
demo-zexuan
commented
Aug 11, 2026
一帮人政治漏阴癖真的是服了😅😅😅 |
xq546247083
commented
Aug 11, 2026
demo-zexuan
commented
Aug 11, 2026
@Hona Hi~ If possible, please close the comment section of this issue as soon as possible. Some irrational people have begun to personally attack under the comment. At present, the following discussion is completely full of political and personal attacks, which is no longer relevant to the opencode project. |
demo-zexuan
commented
Aug 11, 2026
@Hona At present, the comment area has been introduced into meaningless personal attacks by such people, which is not good news for the opencode community. It‘s ridiculous. |
xq546247083
commented
Aug 11, 2026
xq546247083
commented
Aug 11, 2026
=================
|
yeliex
commented
Aug 11, 2026
Actually just keeping |
yeliex
commented
Aug 11, 2026
Before |
Mar7thLover
commented
Aug 11, 2026
OpenCode should not use such a terrible translation. By the way, this is a politically charged translation that should absolutely not be accepted by the open-source community. |
看完这条thread这下不得不支持词元了,想看这堆📍CN的起号小鬼和词元组一辈子代码😋赞成割裂,加速不要停🫡反正就是个翻译,爱用en用en爱用zh用zh,何苦互相为难呢 |
Zhou-Shilin
commented
Aug 11, 2026
@Hona I would recommend locking this conversation at this point to prevent further unnecessary debate. Regarding the terminology, I strongly suggest keeping the original English word Token rather than translating it to 词元. The general consensus among Chinese developers and tech professionals is that 词元 is an awkward and suboptimal translation. In the Chinese tech community—both in day-to-day discussions and in formal technical documentation—it is standard practice to retain well-established English terms like Token as they are. Keeping it in English will feel much more natural and accurate to native readers. |




Issue for this PR
Closes#40976
Type of change
What does this PR do?
In the zh locale, the context usage panel translates "token" as 「令牌」, which is the API-credential term (访问令牌) and reads oddly in an LLM context — e.g. 「推理令牌」, 「缓存令牌」. This replaces the 7 occurrences in
packages/app/src/i18n/zh.tswith 「词元」, the common scholarly translation for LLM tokens.The zht locale and older zh versions keep the English "token" (总 token, 输入 token), and
.opencode/glossary/zh-cn.mdhas no entry for token, so there is no established convention to contradict.How did you verify your code works?
git diffconfirms exactly those 7 linesen.ts(parity is key-based)Screenshots / recordings
N/A — translation-only change
Checklist