Add support for monolingual output in resx2po
I a trying to convert a bunch of resx files.
E.g. Strings.resx Strings.it.resx
The output is: Strings.po with #: InserireTessera msgid "Insert card" msgstr ""
It should be: #: InserireTessera msgid "InserireTessera" msgstr "Insert card"
Strings.it.po #: InserireTessera msgid "Inserire tessera" msgstr ""
It should be: #: InserireTessera msgid "InserireTessera" msgstr "Inserire tessera"
If msgids do not match the output is useless.
Any progress on this? I have the same problem.
@danielklecha I used https://github.com/GioviQ/resgenEx
The correct usage is:
resx2po -i Strings.it.resx -t Strings.resx -o it.po
@nijel I got different output but it's still wrong. I have resx generated by VS2022 and I want to convert it to PO file. Part of the resx file:
<data name="RegisterAsNewUser" xml:space="preserve">
<value>Register as a new user</value>
</data>
Command:
resx2po -i Areas.Identity.Pages.Account.Login.resx -t Areas.Identity.Pages.Account.Login.resx -o Areas.Identity.Pages.Account.Login.en.po
Part of the po file:
#: RegisterAsNewUser
msgid "Register as a new user"
msgstr "Register as a new user"
There should be key in msgid but it contains value.
No, there should be the srouce string in the msgid, gettext is bilingual format here.
@nijel Oh... Ok. I use different convention... You use english sentences as key, so you don't need en.po file. I use keys with cammel case, so I need en.resx or en.po files.
I cannot use you tool but everything is working correctly with bilingual format.
resx2po can certainly be extended to support format you need, patches are welcome :-).
it's possible to add the context with msgctxt instead of placing it as a comment with #:
<data name="RegisterAsNewUser" xml:space="preserve">
<value>Register as a new user</value>
</data>
msgctxt "RegisterAsNewUser"
msgid "Register as a new user"
msgstr "Register as a new user"