sakura icon indicating copy to clipboard operation
sakura copied to clipboard

中国語を追加したい

Open EldersJavas opened this issue 4 years ago • 35 comments

中国語を追加したい issue

こんにちは、アドバイスしてください!


Sakura compatibility is great and very suitable for my current work. Therefore, my team and I hope to translate your software into Chinese.

Start: 14 Aug 2020

Target

CHS

  • [ ] 在中文操作系统上成功启动
  • [ ] 菜单和对话框以中文显示
  • [ ] 对应中文代码页
  • [ ] 支持中文键盘布局
  • [ ] 准备中文文件
  • [x] 使安装程序与中文兼容

JP

  • [ ] 中国語OSで起動できるようにする。
  • [ ] メニューやダイアログを中国語で表示できるようにする。
  • [ ] 中国語のコードページに対応する。
  • [ ] 中国語のキーボードレイアウトに対応する。
  • [ ] 中国語のドキュメントを用意する。
  • [x] インストーラーを中国語対応にする。

Log

14 Aug 2020: Issue start #1369 22 Nov 2020: Install Files PR Open #1469 1 Feb 2021: #1469 Merge

connect

#1469

EldersJavas avatar Aug 14 '20 11:08 EldersJavas

@EldersJavas feel free to ask questions.

m-tmatma avatar Aug 14 '20 13:08 m-tmatma

@EldersJavas さん 好きなように翻訳してもらって構わないです。

言語(Language) Caption Note
英語(en-US) &Copy to Clipboard this is common phrase(rephrased).
日本語(ja-JP) 情報をコピー(&C) this is original.
中国語(zh-CN) 复制到剪贴板(&C) this is an example.

たぶん、聞きたいことは (&C) って何? だと思うんですけど、説明しづらい概念なので訳例だけ載せてみます。

具体的に訊きたいことがあれば、気軽に書き込んでみてください。

berryzplus avatar Aug 14 '20 18:08 berryzplus

Thanks everybody.There are my questions and some uncertain answers.

1. Head File

The localization software I use will extract all quoted strings, so some header file codes are extracted.

Such as #define APSTUDIO_HIDDEN_SYMBOLS\r\n,#undef APSTUDIO_HIDDEN_SYMBOLS\r\n.

Obviously, we cannot translate it and should be locked immediately.

2. Some attributes

Such as button,msctls_updown32,SysListView32,SysListView32.

Also,we cannot translate.

3. Copyright Information

Such as Original Author: Take-san(竹パンダ) さん,

We must translate into "作者: Take-san(竹パンダ) さん",We cannot modify the words after the colon.

4. ”&“ notation

Thank you very much @berryzplus ,As you said,We should translate as Japanese instead English.

But my Japanese is not as good as English, so I temporarily use English as the source language, sry. I will definitely compare the source code and Japanese text in future translations.

5. Font and Fontstyle

This is a difficult problem.

English use Tahoma.

Japanese use MS Pゴシック.

Sorry,I don't know how to choose a suitable font.Please give me some advice about choosing.Maybe Tahoma can show Chinese,too.

My current compilation conditions cannot compile sakura correctly. So I can only wait for the translation to be completed before testing the effect.

If I have mistake, please point it out.I will change as fast as I can.

In the word,Thanks everybody.Please advise.

EldersJavas avatar Aug 15 '20 04:08 EldersJavas

Such as #define APSTUDIO_HIDDEN_SYMBOLS\r\n,#undef APSTUDIO_HIDDEN_SYMBOLS\r\n.

Right. The strings in TEXTINCLUDE part should not be translated.

Such as button,msctls_updown32,SysListView32,SysListView32.

Right. These strings don't depend on the locale. So, they should not be translated. Also SysTabControl32, msctls_trackbar32, msctls_hotkey32 and (some of) Static.

Copyright Information

Sakura Editor was originally written by Take-san, and now it is maintained by Sakura-Editor Project. That's why the string is "Original Author" instead of "Author". In Japanese, "Author" is translated as "作者", and "Original Author" is translated as "原作者". How about in Chinese?

”&“ notation

I think Chinese software also uses "&" notation in a similar way with Japanese software.

Font and Fontstyle

Maybe, "SimSun" or "NSimSun" is the default font for simplified Chinese? https://en.wikipedia.org/wiki/List_of_CJK_fonts

k-takata avatar Aug 15 '20 05:08 k-takata

Such as #define APSTUDIO_HIDDEN_SYMBOLS\r\n,#undef APSTUDIO_HIDDEN_SYMBOLS\r\n.

Right. The strings in TEXTINCLUDE part should not be translated.

Such as button,msctls_updown32,SysListView32,SysListView32.

Right. These strings don't depend on the locale. So, they should not be translated. Also SysTabControl32, msctls_trackbar32, msctls_hotkey32 and (some of) Static.

Copyright Information

Sakura Editor was originally written by Take-san, and now it is maintained by Sakura-Editor Project. That's why the string is "Original Author" instead of "Author". In Japanese, "Author" is translated as "作者", and "Original Author" is translated as "原作者". How about in Chinese?

”&“ notation

I think Chinese software also uses "&" notation in a similar way with Japanese software.

Font and Fontstyle

Maybe, "SimSun" or "NSimSun" is the default font for simplified Chinese? https://en.wikipedia.org/wiki/List_of_CJK_fonts

Thanks a lot.I originally thought that the current author is still Mr.Take-san.I will change it.

You are right, SimSun is the default font for Chinese,Should we pack it into software?

And,If we call the font,do we need to use SimSun or 宋体?

Thank you again.

EldersJavas avatar Aug 15 '20 05:08 EldersJavas

My current compilation conditions cannot compile sakura correctly.

What errors do you have? If you can share your rc file, we can give you advice. You can send a work-in-progress pull request or just share the branch name that you are working on.

This code also contains localization texts for the installer. https://github.com/sakura-editor/sakura/blob/d22a90ad92eb7c38c6e80e01e0930afa62d97aec/installer/sakura-common.iss#L48-L114

If you have done translation of sakura_lang_rc.rc, I think you should translate it too.

m-tmatma avatar Aug 15 '20 09:08 m-tmatma

Should we pack it into software?

Do you mean distributing SimSun with Sakura Editor? Then, don't do that. SimSun is not a free font, so you cannot distribute it. (And it is the default font on Chinese Windows, so you don't need to do that.)

And,If we call the font,do we need to use SimSun or 宋体?

Not sure. The best way is to create a dialog box with the resource editor on Visual Studio and check the font name.

k-takata avatar Aug 15 '20 12:08 k-takata

@m-tmatma thanks for your reminder.I must translate it.

@k-takata Thanks a lot.I asked my friends for help,He think that SimSun is OK.

I will try calling it on Microsoft Windows®.

And another questions,Can I Compile Sakura on msys2?My VS environment isn't working:(

EldersJavas avatar Aug 15 '20 17:08 EldersJavas

And another questions,Can I Compile Sakura on msys2?My VS environment isn't working:(

Yes, it is a known issue. It can compile on MinGW, but doesn't work.

k-takata avatar Aug 15 '20 21:08 k-takata

And another questions,Can I Compile Sakura on msys2?My VS environment isn't working:(

Our main build environment is MS VS. You should establish MS VS build environment.

To compile sakura, you need to install MS VS with additional components.

We have .vsconfig in the top folder. You can install the additional components using the .vsconfig.

This is the instructions (in Japanese) https://github.com/sakura-editor/sakura#vsconfig-%E3%81%AB%E9%96%A2%E3%81%97%E3%81%A6

vs_community__XXXXX.exe --config <path to .config>

where vs_community__XXXXX.exe is an installer for VS2017 or VS2019

If you are using VS2019, you can easily install additional components by opening a sln file and clicking the popup explained below . https://devblogs.microsoft.com/setup/configure-visual-studio-across-your-organization-with-vsconfig/

m-tmatma avatar Aug 16 '20 02:08 m-tmatma

this is sample project for sakura lang dll for chinese. sakura_lang_zh_CH.zip a sample is based on sakura_lang_en_US, modified minimal to be able to use as a chinese resource dll.

here is requirements to build.

  • the resource script depends /resource contents then you should place sakura_lang_zh_CH under top of git-cloned directory.
  • the resource script depends /sakura_core/Funccode_define.h generated by main-build, then you should run build-sln.bat Win32 Debug before chinese resource build.
  • you should modify STR_SELLANG_LANGID string properly. (see a sample.)
  • you should modify ``STR_SELLANG_NAME string properly.(see a sample.)
  • you should write chinese resource in Unicode(UTF-8).
  • you should compile the resource script as a Japanese resource.(not a chinese resource!!)

berryzplus avatar Aug 16 '20 07:08 berryzplus

@berryzplus

  • you should compile the resource script as a Japanese resource.(not a chinese resource!!)

D you mean that compiling it as Japanese resource' is setting Culture to 0x0411?

https://github.com/sakura-editor/sakura/blob/5f489bc9b60a987937e19a1ab627ee8f67783cdf/sakura_lang_en_US/sakura_lang_en_US.vcxproj#L82-L86

I tried to set Culture of sakura_lang_en_US.dll to 0x0409 (English US). But it seems that there is no problems.

Do you remember the reason why we set that to 0x0411?

m-tmatma avatar Aug 16 '20 10:08 m-tmatma

Thanks for everyone's support! I am so touched!

Today,We translated about 12% . 26% has been completed so far.

Our plan is to translate about 10% every day, and it is expected to be completed before August 25.

Maybe it's impossible , But We will fight on night and day.

I am communicating with several friends who are professional in C++, and they can help me set up a compilation environment.

sakura_lang_zh_CH.zip

@berryzplus Thanks for your package. I have forked Sakura and pull request some source. Here

Hope you can check sakura_lang_rc.rc,thanks a lot.

I will update the latest translated version everyday.

We have .vsconfig in the top folder. You can install the additional components using the .vsconfig.

@m-tmatma Thanks remind, I will definitely try to do it.




If you can help us translate, please join our translation project. Here

Thanks again.

EldersJavas avatar Aug 16 '20 11:08 EldersJavas

D you mean that compiling it as Japanese resource' is setting Culture to 0x0411?

そうです。ビルド設定で日本語のみをビルドするように指定しているので、日本語リソースとして作成する必要があります。windowsのリソース文字列はunicode(UTF-16LE)で埋め込まれる仕様なので、自称「日本語リソース」に中国語が入っていても問題ありません。

サクラエディタが各国語リソースの作成に日本語(0x411)を要求すること自体については、おかしい、という見解を何度か出しています。単純には直せない設計的課題なので、当座は我慢してもらうしかないっす。

berryzplus avatar Aug 16 '20 11:08 berryzplus

@EldersJavas

And another questions,Can I Compile Sakura on msys2?My VS environment isn't working:(

I found a bug that compilation fails with VS2019 16.7.1 (#1373) and fixed it with #1374. Please get the latest upstream master if you're using VS2019.

F.Y.I https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/configuring-a-remote-for-a-fork https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/syncing-a-fork

m-tmatma avatar Aug 16 '20 11:08 m-tmatma

サクラエディタが各国語リソースの作成に日本語(0x411)を要求すること自体については、おかしい、という見解を何度か出しています。単純には直せない設計的課題なので、当座は我慢してもらうしかないっす。

これはどこかに ticket 化されてました?

m-tmatma avatar Aug 16 '20 11:08 m-tmatma

@EldersJavas

If you can help us translate, please join our translation project. Here

I don't have enough knowledge on translating Chinese. So I can't help translation itself.

@berryzplus

I checked https://docs.transifex.com/projects/open-source-project

  • This software is licenced under zlib license.
  • zlib license is one of OSI-approved licenses.
  • We have LICENSE on the repository.

Then we can use the service without any fee. We should create a repository on transifex and manage localization messages on it.

What do you think?

m-tmatma avatar Aug 16 '20 12:08 m-tmatma

A new question

My environment is VS2019 latest

In .vsconfig, it told me to install Windows 10 SDK 1809 (10.0.17763.0)

But when I compile, VS told me to install Windows 10 SDK 1903 (10.0.18362.1)

It's my questions? or .vsconfig is old?

(and,In VS2019,there aren't have microsoft.visualstudio.componentgroup.nativedesktop.win81)

EldersJavas avatar Aug 16 '20 16:08 EldersJavas

Sakura_lang_zh_CN.dll compile successfully!

check1

about

Thanks everyone,there still have some difficult questions, I'll bring them up in the morning.

Now , I need to sleep :)

EldersJavas avatar Aug 16 '20 17:08 EldersJavas

サクラエディタが各国語リソースの作成に日本語(0x411)を要求すること自体については、おかしい、という見解を何度か出しています。単純には直せない設計的課題なので、当座は我慢してもらうしかないっす。

これはどこかに ticket 化されてました?

過去の英語リソース関連のissueを見ると、コメントで書いてあると思います。

解決の目途が立たないので個別issueは作ってなかったと思います。

berryzplus avatar Aug 17 '20 03:08 berryzplus

What do you think?

いいんじゃないでしょうか。

世界の人口比率から見て、中国語のほかにはポルトガル語とかやりたいなぁと思っています。

システム的になんとかしたい、というのと翻訳は別なので、先行で進めてもよいかもしれないです。

berryzplus avatar Aug 17 '20 03:08 berryzplus

In .vsconfig, it told me to install Windows 10 SDK 1809 (10.0.17763.0)

But when I compile, VS told me to install Windows 10 SDK 1903 (10.0.18362.1)

It's my questions? or .vsconfig is old?

(and,In VS2019,there aren't have microsoft.visualstudio.componentgroup.nativedesktop.win81)

in vs2019, Windows 10 SDK 1903 (10.0.18362.1) is required. this is default selected SDK.

.vsconfig is not correct.

.vsconfig を直したいと思っています。ごめんなさい。

windows 8.1 SDKは、不要です。

berryzplus avatar Aug 17 '20 03:08 berryzplus

2020-08-17 REPORT

Today's Project Progress

1.Translation progress reached 35%. 2.Fixed some problems with compiling the DLL file.(but when I edit in VS, It isn't compiled.)

Still question

1.Encoding.I regretted to use VS to save .rc files.Because VS save files as an unknown encoding.I try to find but there is no encoding that shows it correctly. Here 2.Because of encoding. I can't compile.I don't know why. error

Tomorrow's Plan

1.Finish 50% 2.slove today's questions.


in vs2019, Windows 10 SDK 1903 (10.0.18362.1) is required. this is default selected SDK. .vsconfig is not correct. .vsconfig を直したいと思っています。ごめんなさい。

@berryzplus OK , I know . Do we need to modify it ?

EldersJavas avatar Aug 17 '20 16:08 EldersJavas

1.Encoding.I regretted to use VS to save .rc files.Because VS save files as an unknown encoding.I try to find but there is no encoding that shows it correctly. Here

These two lines are wrong: https://github.com/AsdLocalization/sakura/blob/bb292b78ce91404312b40dcd725618485f656b08/sakura_lang_zh_Hans/sakura_lang_rc.rc#L26-L27 They should be

LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED
#pragma code_page(65001)

and the file should be saved in UTF-8.

This line seems also wrong: https://github.com/AsdLocalization/sakura/blob/bb292b78ce91404312b40dcd725618485f656b08/sakura_lang_zh_Hans/sakura_lang_rc.rc#L3170 I think it should be

    STR_SELLANG_LANGID      "0x0804"

See https://docs.microsoft.com/en-us/windows/win32/msi/localizing-the-error-and-actiontext-tables

k-takata avatar Aug 17 '20 16:08 k-takata

サクラエディタが各国語リソースの作成に日本語(0x411)を要求すること自体については、おかしい、という見解を何度か出しています。単純には直せない設計的課題なので、当座は我慢してもらうしかないっす。

バージョンリソースの部分で https://github.com/sakura-editor/sakura/blob/e59dad0385f8c34cf960a8e8b31a93e072546618/sakura_lang_en_US/sakura_lang_rc.rc#L2152 と https://github.com/sakura-editor/sakura/blob/e59dad0385f8c34cf960a8e8b31a93e072546618/sakura_lang_en_US/sakura_lang_rc.rc#L2168 で 411 になっているところがおかしい気がします。 英語ならば 409 になっているべきです。(これを直せば十分なのかは分かりませんが)

k-takata avatar Aug 17 '20 17:08 k-takata

2020-08-18 REPORT

Today's Project Progress

  1. Sorry everybody. sakura_lang_rc.rc has been corrupted by VS and cannot be restored.Because when VS saves a file, it only saves the file in system's encoding. So, sakura_lang_rc.rc is saved GB2312. But Sakura requires the file to be parsed in UTF-8. Then, VS forces all Chinese characters to be converted to "?" mark. I try editing as @k-takata said but It is not save back.これは血の教訓である。Now, I have to recover the original files. So, I lost about 9%.
  2. By 11 o 'clock, the progress was about 40%.

I'm sorry that I didn't finish today's task. I will stay up late to finish it tonight.

Also,I will never use VS to edit files again.

Still question

For various reasons, it is not compiled today. Therefore, there is no problem for the moment.

Tomorrow's Plan

  1. Finish 60%
  2. COMPILE SUCCESSFULLY

@k-takata Thank you all the time.

I have modified the file according to your way.

EldersJavas avatar Aug 18 '20 15:08 EldersJavas

@EldersJavas Take it easy. You don't need to hurry. You can do it in your pace.

But if you're doing this in your job, it may be an issue for you.

m-tmatma avatar Aug 18 '20 22:08 m-tmatma

August REPORT


ご協力ありがとうございました。

現在、進捗状況の90%を達成しています。作業環境でも使用できます。

来週も最初のバージョンを維持してリリースします。

私はいくつかの新しい質問を続けます。

Thank you all the time.

EldersJavas avatar Aug 31 '20 01:08 EldersJavas

阁下好,翻译进度如何了很期待,需要帮助吗?

vshai avatar Oct 12 '20 08:10 vshai

Sorry.Due to some working conditions, the project has not been translated for a long time.

Sakura's software ontology translation has been unable to compile due to the problems.I'm trying to compile in the JIS coding environment.Currently, the last compiled file sakura_lang_zh_CN.dll is translated about 30%. You can download and test it. sakura_lang_zh_CN.zip

Now I pull sakura-common.iss .

#1469

@vshai Thank a lot. You can see there

EldersJavas avatar Nov 22 '20 03:11 EldersJavas