hi!

I generated po file! I installed translate-toolkit to Cygwin like this.

$ cd setup/
$ ll res/ja/res.rc
-rw-r--r-- 1 leiqunni leiqunni 42915 11月 20 16:59 res/ja/res.rc <- My original 
file.
$ make rc2po
(or  rc2po -t res/en/res.rc -i res/ja/res.rc -o po/ja/res.po --charset=UTF-8)
$ ll po/ja/res.po
-rw-r--r-- 1 leiqunni leiqunni 53462 11月 20 16:57 po/ja/res.po <- Generated.
$ make po2rc
$ make
$ ll setup.exe
-rwxr-xr-x 1 leiqunni leiqunni 41222592 11月 20 16:59 setup.exe <- Excute binary

I confirmed that this executable binary works correctly
and has been translated into Japanese.

There are two problems.
1. po2rc has incorrect option string in Makefile.
po2rc -t res/en/res.rc --charset-output=utf-8
-> po2rc -t res/en/res.rc --charset=utf-8

2. I installed translate-toolkit 3.14.1 and the rc2po failed due to an error.
It was probably a bug, and I was able to run it after fixing line 192 of this 
file.

/usr/local/lib/python3.9/site-packages/translate/storage/rc.py

$ diff -u rc.py rc.py.org
--- rc.py       2024-11-20 17:24:14.060730600 +0900
+++ rc.py.org   2024-11-20 17:25:49.211402500 +0900
@@ -189,7 +189,7 @@
         join_string=" ",
     )

-    combined_constants = delimited_list(constant, "|")
+    combined_constants = delimited_list(constant, "|", min=2)

     concatenated_string = OneOrMore(quoted_string)

I have attached the git diff to the generated po/ja/res.po file.

I have a question. This time I translated the .rc file directly,
but do I usually create a .po file, translate it,
and then create the .rc file?

________________________________
差出人: Jon Turney <jon.tur...@dronecode.org.uk>
送信日時: 2024年11月17日 1:11
宛先: 武田洋幸 <leiqu...@gmail.com>
CC: cygwin-apps@cygwin.com <cygwin-apps@cygwin.com>
件名: Re: Japanese translation res.rc patch

On 27/10/2024 10:49, Brian Inglis via Cygwin-apps wrote:
> Ya Takeda-san,
>
> You may wish to consider installing Cygwin package po4a https://
> po4a.org/ which does the same job under Cygwin.

No, this is bad advice.

> On 2024-10-26 22:33, 武田洋幸 via Cygwin-apps wrote:
>> Sorry for the late submission. This is a patch from the latest
>> repository.

Thanks very much. I applied this.

I generated a test build, which can be found at:

https://cygwin.com/setup/setup-2.932-30-g33a7aa.x86_64.exe

Please let know if there are any problems with that.

Thanks again.

>> I also wanted to create the po/ja/res/po files, so I installed the
>> Translate Toolkit on Ubuntu in WSL, but I didn't know how to use
>> rc2po.

It should be as simple as:

1) Add python3 to your cygwin installation using cygwin's setup
2) Use 'pip3 install translate-toolkit'
3) Update the po/ja/res.po file using your preferred po file editor
3) Use 'make po2rc' to regenerate the res/ja/res.rc file
4) Use 'make' to build a setup executable including your translation changes

If possible, could you generate any future changes including patches
against the po file (and using git format-patch), as that would save me
a bit of time.

>> I didn't know what a template file was.

po2rc uses the res/en/res.rc as a template, replacing the translatable
strings with those from a given po/<LANG>/res.po file to generate the
res/<LANG>/res.rc file.

I hope that makes sense.  Please ask if you need more clarification.

Attachment: head_diff.7z
Description: head_diff.7z

Reply via email to