On 20/11/2024 08:34, 武田洋幸(leiqunni) via Cygwin-apps wrote:
hi!

Thanks for trying it out!

I'll update the README to include those instructions for future reference.

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

This is actually a local patch that I have made to translate-toolkit which I need to upstream (which is needed otherwise the output encoding for European languages is automatically chosen as cp1252, which isn't what's wanted).

(it seems I also have a couple of other local patches to deal with (i) correctly escaping a double-quote inside double quotes in a .rc file, and (ii) allowing rc2po to correctly extract the translations for multiple IDC_STATIC controls from a .rc file, which I also need to see about upstreaming)


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 didn't encounter any problem needing this.

Not sure what the error you saw was, but it's still present, maybe you need to report it at

https://github.com/translate/translate/issues


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?

Yeah, the usual workflow is to use the .pot file as a template (which is just the English translations) to create a .po file with the translations for a language, and then use that to create the .rc file.

(The idea is that (i) lets us leverage .po file translation tools, and (ii) avoids having to make the same change simultaneously in lots of translated resource files if we ever add/remove/move a control etc.)

Reply via email to