Hex-Dragon / PCL2

Plain Craft Launcher(我的世界启动器 PCL)的源代码,为支持社区研究而公开。
https://afdian.com/a/LTCat
Other
2.48k stars 185 forks source link

本地化:语言、配置项、时间 #4145

Open tangge233 opened 3 months ago

tangge233 commented 3 months ago

开头

是的,我又来了 这是继 #119 之后再次挖坑(别再去那个 PR 评论了……)

语言文件 Key 值暂行命名方法

### 一般情况下遵循如下的命名规则 `Lang` +所属页面或 Mod 的名称+ `Hint` 或 `Dialog(Title/Content/Btn1/Btn2/…)` (可选)+简易描述 例如 `ModMinecraft.vb` 中的“当前文件夹”对应的 Key 值为 `LangModMinecraftCurrentFolder`。这其中的 `ModMinecraft` 表面其属于 `ModMinecraft.vb` 这个 Mod,`CurrentFolder` 则描述其应当是当前目录的译文。 ### 当然也有一些例外情况 比如 PCL 窗口最上方的按钮,对应极其明显,因此可以直接使用 `LangTitleHome` 作为主页(其实叫启动页)的 Key 值 又比如一些常使用的弹窗按钮,其 Key 值不需要表明所属的页面,可以有 `LangDialogBtnOK`、`LangDialogBtnCancel` 等这样的写法。 ### 总结 在表意明确的前提下做到最简表达

状况

正在做的事

还需要做的事

已完成内容

不进行本地化的内容

帮助测试反馈

本地化工作可能会出现一些小错误,还请各位多多指正 开发版发布地址

帮助翻译 Help translation

[!NOTE]
目前相关翻译人手不足,如果你是我们所正在支持的语言的母语者并且有一定的时间和精力,请务必考虑协助我们翻译。 At present, there is a shortage of relevant translators. If you are a native speaker of the language we are supporting and have some time and energy, please consider assisting us with translation. 在本 PR 未被合并之前,请使用 Weblate 帮助翻译 Before this PR is merged, you can always use Weblate to help us with translation.

目前支持语言(字母顺序排序) Languages Supported (Alphabetical)

本地化的相关调整

特别感谢

@3gf8jv4dv 帮助翻译 zh_HK、zh_TW、en_US 和 en_GB @Chiloven945 帮助翻译 zh_HK、zh_TW、en_US、en_GB、el_GR,以及整 zh_MEME @youzi-2333 正在帮忙翻译 lzh @WForst-Breeze 正在帮忙翻译 fr_FR @wuyuncheng-26 帮助增加翻译,以及整 zh_MEME @SALTWOOD 帮忙整 zh_MEME @WTP016-CN 帮助翻译 zh_HK

效果预览

![image](https://github.com/user-attachments/assets/4b437695-8c52-404f-b786-2a195f5de1e2) ![image](https://github.com/user-attachments/assets/0ce77484-55f2-4f1f-a6af-d8074b5c6078) ![image](https://github.com/user-attachments/assets/b59e5236-5c74-4af8-b2f5-b49c4b6152c1) ![image](https://github.com/user-attachments/assets/645d00e4-d833-430a-ba5f-4e89a62554a2)

其它一些事

相关项目:Weblate

PCL2(压缩包)体积增量:0.8 MB 左右

Close #891

allMagicNB commented 3 months ago

哥们先转成草稿哥们(

3gf8jv4dv commented 3 months ago

Really appreciate this work. Keep following.

allMagicNB commented 3 months ago

繁体中文不一定是 zh-HK,还有可能是 zh-TW zh-MO……

3gf8jv4dv commented 3 months ago

繁体中文不一定是 zh-HK,还有可能是 zh-TW zh-MO……

I am curious which one the author will choose.

Chiloven945 commented 3 months ago

繁体中文不一定是 zh-HK,还有可能是 zh-TW zh-MO……

繁中可能需要拆分为zh-TW及zh-HK,按照Minecraft所提供的语言,香港及澳门共用zh-HK

Deep-Dark-Forest commented 3 months ago

建议在正文中添加:

Close #891
tangge233 commented 3 months ago

建议在正文中添加:

Close #891

tangge233 commented 3 months ago

一些控件不支持调用 DynamicResource ,比如 MyLoading 和 MyHint,有谁会修吗? 修好了

JingHai-Lingyun commented 3 months ago

我晚点看看,之前有尝试过做i18n

allMagicNB commented 3 months ago

可以先调一遍存进变量再输出变量吗?(

tangge233 commented 3 months ago

image image 这怎么不行啊……一直显示的是“提示文本”

Chiloven945 commented 3 months ago

实际上感觉对于字符串的翻译可以挪后,等之后有了crowdin project之后再进行翻译,翻译这件事情肯定是得社区投票之类的,目前可以先把代码内的文字改了就可以

tangge233 commented 3 months ago

实际上感觉对于字符串的翻译可以挪后,等之后有了crowdin project之后再进行翻译,翻译这件事情肯定是得社区投票之类的,目前可以先把代码内的文字改了就可以

是的,我也在想要不用 Weblate 这一类的项目提供更多语言翻译。目前先把多语言的可行性弄好……

tangge233 commented 3 months ago

后面写的代码基本上都没考虑多语言啊……写法十分………

LTCatt commented 3 months ago

最大问题就在于 PCL 的 UI 布局和代码都没有考虑过支持本地化…… 因为英文比中文更长,PCL 的许多按钮或者布局在变成英文后都会显示不下,所以有的 UI 也需要调整,甚至怎么调整都放不下(

tangge233 commented 3 months ago

最大问题就在于 PCL 的 UI 布局和代码都没有考虑过支持本地化…… 因为英文比中文更长,PCL 的许多按钮或者布局在变成英文后都会显示不下,所以有的 UI 也需要调整,甚至怎么调整都放不下(

已经深刻体会过了(悲)

顺便问下 MyHint 控件的 Text 属性该如何改成支持使用动态资源

JingHai-Lingyun commented 3 months ago

最大问题就在于 PCL 的 UI 布局和代码都没有考虑过支持本地化

XAML(没有 Flex 动态布局)的痛…… 换完语言感觉还会要多出一堆数据值用来调整 UI……

MCSteve123 commented 3 months ago

最大问题就在于 PCL 的 UI 布局和代码都没有考虑过支持本地化…… 因为英文比中文更长,PCL 的许多按钮或者布局在变成英文后都会显示不下,所以有的 UI 也需要调整,甚至怎么调整都放不下(

几年前的屎山(恼

tangge233 commented 3 months ago

image

刻进代码里的。一改就爆炸

3gf8jv4dv commented 3 months ago

Some personal opinions.

For most of the basic translations, I think it would be best if we could reach a consensus in this PR. This also makes it easier to test the launcher UI.

For translation, we need to translate based on the UI situation and the actual language habits of the target users, instead of rigidly translating directly from Simplified Chinese. Some words do not need to be completely consistent with Simplified Chinese, as long as users can correctly understand their meaning. It is nice to see some implementation in the current commits, but it is far from enough.

For Traditional Chinese, considering that the current user audience and reviewers are almost all mainland users, you can put it aside for now and localize it with more professional tools later.

I think I will provide some opinions later, either as a review or a PR (against your branch), but there is no exact time yet.

tangge233 commented 3 months ago

Some personal opinions. 一些个人意见。

For most of the basic translations, I think it would be best if we could reach a consensus in this PR. This also makes it easier to test the launcher UI.对于大多数基本翻译,我认为如果我们能在这个 PR 中达成共识,那将是最好的。这也使测试启动器 UI 变得更加容易。

For translation, we need to translate based on the UI situation and the actual language habits of the target users, instead of rigidly translating directly from Simplified Chinese. Some words do not need to be completely consistent with simplified Chinese, as long as users can correctly understand their meaning. It is nice to see some implementation in the current commits, but it is far from enough.对于翻译,我们需要根据UI情况和目标用户的实际语言习惯进行翻译,而不是死板地直接从简体中文翻译。有些词不需要与简体中文完全一致,只要用户能正确理解其含义即可。很高兴在当前的提交中看到一些实现,但这还远远不够。

For Traditional Chinese, considering that the current user audience and reviewers are almost all mainland users, you can put it aside for now and localize it with more professional tools later.对于繁体中文,考虑到目前的用户受众和评论者几乎都是大陆用户,你可以暂时把它放在一边,以后用更专业的工具进行本地化。

I imagine I will provide some input later, either as a review or a PR (against your branch), but there is no exact time yet.我想我稍后会提供一些意见,无论是作为评论还是 PR(针对您的分支),但目前还没有确切的时间。

Thanks for your suggestions.For now,the most import part of this work is to let PCL has the ability to switch between multiple languages.So the language you see now wouldn't be the final version,it still needs the work of community to improve translations. Thank you again for your continued attention to this work.

JingHai-Lingyun commented 3 months ago

Image 略

刻进代码里的。一改就爆炸

我有一个思路,此内容文本是在 VB 中实例化的,是否可以单独实现一个 ModI18N 以从 VB 操作层实现多语言?

tangge233 commented 3 months ago

我有一个思路,此内容文本是在 VB 中实例化的,是否可以单独实现一个 ModI18N 以从 VB 操作层实现多语言?

意思是在控件处修改展示文本?这样确实是可以

wudiwudidream commented 3 months ago

咳咳,我说句话(@Hex-Dragon)俗话说,不会套框架,自动调整总该不会吧????

tangge233 commented 2 months ago

image image

只剩下一些界面了(胜利的曙光.jpg)

wudiwudidream commented 2 months ago

优秀啊,只是startup log那边再优化一下就行

tangge233 commented 2 months ago

优秀啊,只是startup log那边再优化一下就行

那个是日志输出,没必要支持语言切换了(不然工作量要翻几倍的,悲)

Deep-Dark-Forest commented 2 months ago

繁体中文能否使用 ChatGPT 之类的东西进行翻译,实现地方化表达?(

wudiwudidream commented 2 months ago

可以,你得问你楼上

tangge233 commented 2 months ago

繁体中文能否使用 ChatGPT 之类的东西进行翻译,实现地方化表达?(

之后的翻译工作不出意外是要用 crowdin 进行的,这个 PR 里的翻译都是测试用的,不是最终版本

wudiwudidream commented 2 months ago

我有个建议,将VB翻译成C,开发就方便多了

FlameFire26 commented 2 months ago

image

有朝一日PCL也走进国际市场了

hejiehao commented 2 months ago

我有个建议,将VB翻译成C,开发就方便多了

翻译成 C 的过程就有亿点点不方便了

tangge233 commented 2 months ago

有朝一日PCL也走进国际市场了

  • 左侧“资源”翻译丢失(?)
  • “设置”一般都用Settings吧
  • “版本设置”的Config感觉不太合适,Version settings 或者单 Settings也许可以(?)

那个“资源”在合并 main 分支后忘记修改了,下个 commit 就弄好了。 至于“设置”的翻译上面已经讨论过了

wudiwudidream commented 2 months ago

运行的时候是需要翻译成C,汇编到计算机懂的语言

tangge233 commented 2 months ago

运行的时候是需要翻译成C,汇编到计算机懂的语言

如果是新提议,请去开一个 Issues 讨论哦

wudiwudidream commented 2 months ago

哪个?

wudiwudidream commented 2 months ago

sulingjiang 你知道汇编是什么吗?

JingHai-Lingyun commented 2 months ago

@wudiwudidream

本 Pull Request 讨论的是 PCL 启动器内文本进行国际化 如果你想要讨论有关其他内容,请新开一个 Discussion 或 Issue 帖子,谢谢合作

wudiwudidream commented 2 months ago

OK,谈论的是这个问题,我的意思是将PCL的VB代码转换成C/C++代码以便快速开发扩展以便支持自动调整界面的功能

hejiehao commented 2 months ago

改错别字,以便

请善用 Edit

wudiwudidream commented 2 months ago

哈哈,太久没用github生疏

Deep-Dark-Forest commented 2 months ago

@wudiwudidream 请不要在此 PR 内继续发表无关评论,否则评论区将被锁定,感谢配合

wudiwudidream commented 2 months ago

已经提醒三次了

LTCatt commented 2 months ago

@wudiwudidream 如果你不懂相关技术,可以不评论。GitHub 不是水区,也不是民科吧,没有实现意义的建议我们只能做水帖处理,如果继续这样之后只能封禁了。

3gf8jv4dv commented 2 months ago

I did not expect that so many things would happen…

繁体中文能否使用 ChatGPT 之类的东西进行翻译,实现地方化表达?(

Yes, but it still needs to be proofread by humans in the end. After all, conversion tools cannot be 100% accurate. OpenCC and Fanhuaji are also good choices.

那个是日志输出,没必要支持语言切换了(不然工作量要翻几倍的,悲)

If you want to do internationalization, it is recommended that the log be in English.

之后的翻译工作不出意外是要用 crowdin 进行的,这个 PR 里的翻译都是测试用的,不是最终版本

Can Crowdin allow existing translations to be uploaded directly and then voted on? If so, it might reduce the workload.

  • “设置”一般都用Settings吧
  • “版本设置”的Config感觉不太合适,Version settings 或者单 Settings也许可以(?)

至于“设置”的翻译上面已经讨论过了

I have objections to this term. Actually the term Settings is used in many software.

Justin-22222 commented 2 months ago

台灣繁中我應該可....但我不會編程

JingHai-Lingyun commented 2 months ago

如果可以的話後續我們應該會開設專門用於翻譯的渠道,到時候您來協助我們即可

Chiloven945 commented 2 months ago

image

有朝一日PCL也走进国际市场了

  • 左侧“资源”翻译丢失(?)
  • “设置”一般都用Settings吧
  • “版本设置”的Config感觉不太合适,Version settings 或者单 Settings也许可以(?)

之前也想说的,因为这个东西能翻译为Settings, Configuration, Options, Properties, Preference 去谷歌上找了一些参考:

https://stackoverflow.com/questions/2074384/options-settings-properties-configuration-preferences-when-and-why

Tricky, this, as there's no one single consistent style followed by all applications. As you say they are (broadly) synonyms. In truth it doesn't really matter so long as your expected audience understands what you mean. The biggest difference is between Properties, which usually affect a component or object, and the others, which affect the whole application. Following an approximate lead from Visual Studio and other Microsoft products:


因此我建议是对于游戏版本的设置可以翻译为Properties,其他地方Settings即可。不过都是后话,这个问题值得商榷。 做一些解释:用Properties的原因之一是因为上文,也有因为字数长度等原因。直接使用Version Settings太长了,只用Settings也有可能与标题栏的Settings冲突。 ~Configuration我的锅,我想说的是可以作为一个备选的(~

Silverteal commented 2 months ago

目前普遍的本地化工作方式有以下几种:

相比之下最后一种应该最具有可行性。 不过这些都是以后需要考虑的事情。如果确有国际化的需要,首先要把 i18n 搞出来。包括最重要的从源代码分离文本,以及布局,字体和 RTL 等。有必要也可以先加入一个英文倍长的伪语言。


关于“设置”怎么翻译的问题,我个人推荐"Config"。长度适中,作为缩写也常用。 “启动”按字面意思翻译可能比较怪,可以参考 Microsoft Office,翻译成“Start”。


此外我建议把本地化文本打包进二进制文件,防止功能被滥用。如果已经是这样做的就当我没说。