fix(i18n): use 词元 instead of 令牌 for token in zh locale - #40977
Conversation
…essmanbilibili/opencode into fix/zh-token-translation
|
Thanks! I'll take a look |
|
bad translation from china government |
|
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. |
|
|
|
But 令牌 is not a correct translation; it is more likely to cause misunderstanding. |
|
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. |
|
The ONLY correct translation is “词元”. This is the hard truth. |
|
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. |
|
Please don't pollute the civilized world. |
|
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 “令牌”. |
|
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. |
|
不知道在吵什么,我觉得原来令牌这个翻译确实不合理,在我心理最合理的翻译,就 token不动 > 词元 > 令牌,词元起码比令牌更合理一些 不讨论官方立场,中文翻译追求事物的本意,从这点上词元我感觉确实问题不大,起码暂时找不到比这个更合理的翻译了。 举个反例,要是按照日语的翻译逻辑,给token翻译成片假名 “托肯” “脱坑”之类的,看楼上的怎么评价 🤣 |
|
Came from the X post |
I agree, but I prefer to directly use the word To be frank, I don’t like the term That said, |
在界面上,二者的表达并不难区分,所以错误的翻译应该纠正。 |
|
恶心人🤢 |
|
Why not check what Wikipedia says? |
|
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. |
|
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翻译成“扣得”都行,别他妈一看见共产党这三个字就跟应激了是的 |
|
别到处拉屎,什么词元,滚一边去 |
|
@Hona Consider just left "token" as it is, do not translate it. Translate it to others only make things worse. |
|
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. |
|
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. |
哥们, 别 jb 在这串了, 跟nm 政府有什么关系, 要么就冲塔, 别在人家项目 pr 里面喷屎. |
|
This modification can only show that you are just a mouthpiece of Xi Jinping. |
|
「词元」不只是一个准确的「翻译」,而是用中文来重新描述了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. |
|
在使用面上,进行一个中文本地化的修改也不会对其他语言的用户造成任何影响。因此反对的声音即使是用英文写就也显得司马昭之心路人皆知。 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. |
|
我强烈支持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 |
你还司马昭之心上了,装牛魔理中客呢 |
|
提反对意见的一律打上反中标签,还是这个熟悉的味道 |
唔,即使我在上面鲜明的表达了我的意见,但平常我还是习惯叫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 ( |
|
我更希望像上面这样去冷静充分地讨论这个语言现象,来论证我为什么表达支持意见,而不是把技术讨论变成政治攻击。反对意见同样也需要充足的技术理由。当然,从现实的残酷角度来讲,我很庆幸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. |
|
Note I have merged this, going to the developer community accepted terminology. |
|
Although "词元"'s translation may not be the best, but better than “令牌" imo. |
理解,对于开发者来说确实是token用得多。我上面也提到了就连我自己也用。支持opencode |
|
官方"词元"的翻译肯定好于“令牌”,一帮魑魅魍魉在此狂吠,真令人作呕! |
|
词元容易让人误解1个token是一个词, |
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