Skip to content

fix(i18n): use 词元 instead of 令牌 for token in zh locale - #40977

Merged
Hona merged 5 commits into
anomalyco:devfrom
Speechlessmanbilibili:fix/zh-token-translation
Aug 7, 2026
Lines changed: 7 additions & 7 deletions
Merged

fix(i18n): use 词元 instead of 令牌 for token in zh locale#40977
Hona merged 5 commits into
anomalyco:devfrom
Speechlessmanbilibili:fix/zh-token-translation

Conversation

@Speechlessmanbilibili

Copy link
Copy Markdown
Contributor

Issue for this PR

Closes #40976

Type of change

  • Bug fix

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.ts with 「词元」, 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.md has no entry for token, so there is no established convention to contradict.

How did you verify your code works?

  • Only the 7 string values changed; no keys or logic touched
  • git diff confirms exactly those 7 lines
  • i18n keys still match en.ts (parity is key-based)

Screenshots / recordings

N/A — translation-only change

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Sorry, something went wrong.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
…essmanbilibili/opencode into fix/zh-token-translation

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@Hona

Hona commented Aug 7, 2026

Copy link
Copy Markdown
Member

Thanks! I'll take a look

@Hona
Hona merged commit b05a0d1 into anomalyco:dev Aug 7, 2026
2 checks passed
HQ123-BOOP pushed a commit to HQ123-BOOP/LibreCode that referenced this pull request Aug 9, 2026
@SlightDust

SlightDust commented Aug 10, 2026

Copy link
Copy Markdown

bad translation from china government

@Eronana

Eronana commented Aug 10, 2026

Copy link
Copy Markdown

This is a terrible, awful translation. It should never have been allowed into this codebase.

@Rin313

Rin313 commented Aug 10, 2026

Copy link
Copy Markdown

Please reject these pointless and garbage pull requests and focus on product development.
👉🌶🐷又在污染文明世界了

@zce

zce commented Aug 10, 2026

Copy link
Copy Markdown

词元 may be a valid academic translation, but that alone doesn't make it the right localization for a developer-facing tool. The relevant question should be what Chinese developers actually use and understand naturally. Today, keeping Token would likely be less surprising and avoids turning product localization into terminology advocacy.

@Speechlessmanbilibili

Copy link
Copy Markdown
Contributor Author

But 令牌 is not a correct translation; it is more likely to cause misunderstanding.

@zce

zce commented Aug 10, 2026

Copy link
Copy Markdown

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

Copy link
Copy Markdown

The ONLY correct translation is “词元”. This is the hard truth.
你们这帮政治露阴癖的傻逼有本事自己上井冈山,跑人家一个开源项目底下叫什么。

@SlightDust

Copy link
Copy Markdown

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

Copy link
Copy Markdown

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.

Do you know what government means? Yes, government defines which is CORRECT.
Obeying what government decide is not over-politicizing.
Disobeying it just because it's the government's decision is over-politicizing.

@dmwin72015

Copy link
Copy Markdown

Please don't pollute the civilized world.

@hangyan

hangyan commented Aug 10, 2026

Copy link
Copy Markdown

looks good

@cfmj

cfmj commented Aug 10, 2026

Copy link
Copy Markdown

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.

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

Copy link
Copy Markdown

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

Copy link
Copy Markdown

不知道在吵什么,我觉得原来令牌这个翻译确实不合理,在我心理最合理的翻译,就 token不动 > 词元 > 令牌,词元起码比令牌更合理一些

不讨论官方立场,中文翻译追求事物的本意,从这点上词元我感觉确实问题不大,起码暂时找不到比这个更合理的翻译了。

举个反例,要是按照日语的翻译逻辑,给token翻译成片假名 “托肯” “脱坑”之类的,看楼上的怎么评价 🤣

@rakshith1928

Copy link
Copy Markdown

Came from the X post

@Eronana

Eronana commented Aug 10, 2026

Copy link
Copy Markdown

But 令牌 is not a correct translation; it is more likely to cause misunderstanding.

I agree, but I prefer to directly use the word token.

To be frank, I don’t like the term 词元, because I’m pretty sure the term you actually use when communicating is token, not 词元. That’s why I gave it a thumbs down.

That said, 令牌 is clearly not the right translation either, and I think everyone here would agree on that. Your PR is definitely worthwhile, but what we ultimately settle on may still need to be discussed by the community.

@yiding-he

Copy link
Copy Markdown

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.

  • token for authentication -> 令牌
  • token for LLM processing -> 词元

在界面上,二者的表达并不难区分,所以错误的翻译应该纠正。

@Ion-nsx

Ion-nsx commented Aug 10, 2026

Copy link
Copy Markdown

恶心人🤢

@pplab

pplab commented Aug 10, 2026

Copy link
Copy Markdown

Why not check what Wikipedia says?
https://zh.wikipedia.org/wiki/Token

@StonerLing

Copy link
Copy Markdown

Translating “token” as “词元” is more appropriate in a technical context, or simply keeping it as “token” would be preferable.

Turning the discussion into a political argument instead of proposing a technically better solution only reflects the commenter’s own bias and double standards.

@ghidgdsr

ghidgdsr commented Aug 10, 2026

Copy link
Copy Markdown

Some so-called cyber-spiritual "civilized" people who speak Chinese should not pour out the mush that fills their heads. This is not a place for you to show off your "civility." If you have the ability, fork this project and modify it yourself—you can change it however you want, even if that means translating "Code" into "扣得". Just don't freak out the moment you see the words "Chinese Communist Party."

某些说着中文的赛博精神“文明”人不要把自己脑子里装的那些糨糊倒出来,这不是让你显摆你“文明”的地方,你有本事Fork这个项目自己改,你想怎么改都行,哪怕把Code翻译成“扣得”都行,别他妈一看见共产党这三个字就跟应激了是的

@Fission21

Copy link
Copy Markdown

别到处拉屎,什么词元,滚一边去

@dann2333

Copy link
Copy Markdown

@Hona Consider just left "token" as it is, do not translate it. Translate it to others only make things worse.

@YangKGcsdms

Copy link
Copy Markdown

Please do not translate "token" as "词元" (cíyuán). Chinese is highly abstract, and most people prefer to use general expressions rather than awkwardly linking unrelated words from two different languages. For example, the literal transliteration "鲁棒性" (lǔbàngxìng) was something I deeply resented during my school years; it wasn't until five years into my work that I learned the corresponding English word was "robustness." This is a linguistic error, and the field of computer science should avoid such problems.

@Elkeid-me

Elkeid-me commented Aug 10, 2026

Copy link
Copy Markdown

Of course, '令牌' (badge/pass) is a completely wrong translation, but '词元' (word-element literally) isn't necessarily accurate either. I suggest keeping 'token' as is.

'词' implies 'Word', but a token is not strictly limited to a 'Word'—for instance, should 'visual token' be translated as '视觉词元' (visual word-element)?

Furthermore, the vast majority of API providers in China directly use 'Token' rather than '词元'. Using '词元' in software aimed at professionals actually makes it harder to understand.

@shuke12306

shuke12306 commented Aug 10, 2026

Copy link
Copy Markdown

跑到洋人面前逢中必反何尝不是一种支味重。。。
image

@zhaoliang233

zhaoliang233 commented Aug 10, 2026

Copy link
Copy Markdown

bad translation from china government

哥们, 别 jb 在这串了, 跟nm 政府有什么关系, 要么就冲塔, 别在人家项目 pr 里面喷屎.
令牌翻译本来就不妥, 词元适合非计算机领域的普通人理解有什么问题?
还有别指望你的洋大人, 喷老中我敬你是条汉子, 舔你洋爹能让你膝盖硬起来?

@VZstless

Copy link
Copy Markdown

This modification can only show that you are just a mouthpiece of Xi Jinping.

@WhiteGiverMa

WhiteGiverMa commented Aug 10, 2026

Copy link
Copy Markdown

「词元」不只是一个准确的「翻译」,而是用中文来重新描述了token这个东西的根本性质,反而是所谓「文明世界」用token这个单词来做一词多义比较随意,叫token的东西太多了,如果是老程序员就会感觉怎么又多了一个叫token的东西。反对「词元」这个词的人就只有出于政治立场反对中国政府、反对以中文来命名新事物的理由,在技术学术上都站不住脚。


'Ciyuan' is not just an accurate 'translation', but a rephrasing of the fundamental nature of the word 'token' in Chinese. On the contrary, the so-called 'civilized world' uses the word 'token' to create a word with multiple meanings, which is quite arbitrary. There are too many things called 'token', and if it is an old programmer, they will feel that there is another thing called 'token'. Those who oppose the term 'ci yuan' only have political reasons to oppose the Chinese government and the naming of new things in Chinese, which are untenable in terms of technology and academia.

@WhiteGiverMa

Copy link
Copy Markdown

在使用面上,进行一个中文本地化的修改也不会对其他语言的用户造成任何影响。因此反对的声音即使是用英文写就也显得司马昭之心路人皆知。


In terms of usage, making a Chinese localization modification will not have any impact on users of other languages. Therefore, even if written in English, the voices of opposition are well-known to everyone about Sima Zhao's inner thoughts.

@WhiteGiverMa

Copy link
Copy Markdown

我强烈支持opencode团队合并这个PR,开源社区应该专注于技术本身,而非卷入无休止的键政;虽然我这种观点本身也是一种政治表达。opencode永远是我最爱的agent harness. @thdxr


I strongly support the opencode team merging this PR, and the open source community should focus on the technology itself rather than getting involved in endless politics; Although my viewpoint itself is also a political expression. OpenCode will always be my favorite agent harness. @ thdxr

@Ion-nsx

Ion-nsx commented Aug 10, 2026

Copy link
Copy Markdown

在使用面上,进行一个中文本地化的修改也不会对其他语言的用户造成任何影响。因此反对的声音即使是用英文写就也显得司马昭之心路人皆知。

In terms of usage, making a Chinese localization modification will not have any impact on users of other languages. Therefore, even if written in English, the voices of opposition are well-known to everyone about Sima Zhao's inner thoughts.

你还司马昭之心上了,装牛魔理中客呢

@Ion-nsx

Ion-nsx commented Aug 10, 2026

Copy link
Copy Markdown

提反对意见的一律打上反中标签,还是这个熟悉的味道

@WhiteGiverMa

WhiteGiverMa commented Aug 10, 2026

Copy link
Copy Markdown

I don't know but as a chinese if i don't know what does token means clearly you dont know "词元" means, it is a good translation, clearly if you don't know llm or anything you also have no idea what does that means. although that my feeling so it shouldn't account. Here's my thought (tl;dr): if you know what's token and read the news, you know 100% clearly knows what does that means, but if you don't know what's token, you don't know what does that means, what's your thoughts?

By the way I am curious about in which scenario they will use this word? even in deepseek pricing document page (in chinese ofc) it still written as token, so if you know anything let me know!

唔,即使我在上面鲜明的表达了我的意见,但平常我还是习惯叫token而不是词元。词元这个词比较简洁,对vibe coding的不经常接触技术的人也比较友好。并且实际上中国人并非强迫症地不能接受用英文描述生活事物,比如即使是央视也会说「WIFI」而不是「无线网络」。「词元」就比「无线网络」简洁很多。一般官方场合会用「词元」,以后用的人也可能会越来越多。「词元」对我们的意义还是很重要的,就像把“phone”叫「手机」、把“PC”叫「个人电脑」一样,政治上来讲,是一种文化话语权;但抛开政治因素,我们倒是不想让生活中充斥像日语奇怪片假名一样的,难以望文生义的语言。


Well, even though I clearly expressed my opinion above, I still prefer to call it token instead of word element. The word 'morpheme' is relatively concise and friendly to people who are not frequently exposed to Vibe coding technology. And in fact, Chinese people are not obsessive-compulsive and cannot accept describing daily things in English, such as even CCTV saying "WIFI" instead of "wireless network (wu xian wang luo 4 syllables)". The word element is much simpler than wireless network. Generally, 'word elements' are used in official occasions, and the number of people using them may increase in the future. The meaning of 'word element' is still very important to us, just like calling 'phone' 'mobile phone shou ji ' and 'PC' 'dian nao'. Politically speaking, it is a cultural discourse power; But aside from political factors, we don't want our lives to be filled with language like Japanese's strange katakana, which is difficult to understand.

@WhiteGiverMa

Copy link
Copy Markdown

我更希望像上面这样去冷静充分地讨论这个语言现象,来论证我为什么表达支持意见,而不是把技术讨论变成政治攻击。反对意见同样也需要充足的技术理由。当然,从现实的残酷角度来讲,我很庆幸opencode做了一个明智的政治选择。


I would prefer to calmly and fully discuss this linguistic phenomenon like the one above, to argue why I express supportive opinions, rather than turning technical discussions into political attacks. Opposing opinions also require sufficient technical reasons. Of course, from the harsh perspective of reality, I am grateful that OpenCode made a wise political choice.

@Hona

Hona commented Aug 10, 2026

Copy link
Copy Markdown
Member

Note I have merged this, going to the developer community accepted terminology.
Thank you for the feedback.

#41532

@muderstar

muderstar commented Aug 10, 2026

Copy link
Copy Markdown

Although "词元"'s translation may not be the best, but better than “令牌" imo.
It's not something better good or not, i guess they just want to prevent the ambiguity between these words in chinese. because "令牌" is something that access with, access token or key that let you pass, which clearly does not right.

@WhiteGiverMa

Copy link
Copy Markdown

Note I have merged this, going to the developer community accepted terminology. Thank you for the feedback.

#41532

理解,对于开发者来说确实是token用得多。我上面也提到了就连我自己也用。支持opencode
Understood that. For developers, tokens are indeed used more frequently. I mentioned earlier that even I use it myself. Support opencode

@rtwangdev-lab

rtwangdev-lab commented Aug 10, 2026

Copy link
Copy Markdown

官方"词元"的翻译肯定好于“令牌”,一帮魑魅魍魉在此狂吠,真令人作呕!
下次你们被解雇(fire)了的时候就说自己火(fire)了吧...

@ShaoxiongXu

ShaoxiongXu commented Aug 10, 2026

Copy link
Copy Markdown

词元容易让人误解1个token是一个词,
字元容易让人误解1个token是一个字,
上下文 上下文 模型处理的最小文本单位。
不如叫文元。

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.

i18n(zh): token translated as 令牌 reads oddly in LLM context