Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can keep .po file comments ? #24

Open
XHXIAIEIN opened this issue Feb 5, 2022 · 4 comments · May be fixed by #26
Open

Can keep .po file comments ? #24

XHXIAIEIN opened this issue Feb 5, 2022 · 4 comments · May be fixed by #26

Comments

@XHXIAIEIN
Copy link

XHXIAIEIN commented Feb 5, 2022

Currently, if convert to Excel, and converted back from a PO-file, all the comment information will disappears. I wish they could keep them all in new PO-file .

@XHXIAIEIN XHXIAIEIN reopened this Feb 5, 2022
@JensMertelmeyer
Copy link
Contributor

It should keep comments. See #12
Can you post an example? Where does it get lost? When converting from Excel to po?

@XHXIAIEIN
Copy link
Author

XHXIAIEIN commented Feb 7, 2022

Yes. When converting from Excel to po.

Step1:source.po

#: main.caption
msgid "Happy New Year"
msgstr ""

#: main.btnok.caption
msgctxt "main.btnok.caption"
msgid "OK"
msgstr ""

#: main.btnnext.caption
msgctxt "main.btnnext.caption"
msgid "Next"
msgstr ""

#: main.btnback.caption
msgctxt "main.btnback.caption"
msgid "Back"
msgstr ""

#: main.password.hint
msgid "Almost before we knew it, we had left the ground."
msgstr ""

#: main.password.text
msgid "2022"
msgstr ""

#: main.label1.caption
msgid "Password"
msgstr ""

Step2:command

 po-to-xls -o texts.xlsx -c reference source.po

Step3:texts.xlsx

Message context Message id References source
  Happy New Year main.caption 新年快乐
main.btnok.caption OK main.btnok.caption 确定
main.btnnext.caption Next main.btnnext.caption 继续
main.btnback.caption Back main.btnback.caption 返回
  Almost before we knew it, we had left the ground. main.password.hint 几乎在我们意识到之前,我们已经离开了地面。
  2022 main.password.text 2022
  Password main.label1.caption 输入密码

Step4:command

xls-to-po source texts.xlsx export.po

Step5:export.po

# This file was generated from texts.xlsx
msgid ""
msgstr ""
"PO-Revision-Date: 2022-02-07 22:25+0800\n"
"Language: source\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: xls-to-po 1.0\n"

msgid "Happy New Year"
msgstr "新年快乐"

msgctxt "main.btnok.caption"
msgid "OK"
msgstr "确定"

msgctxt "main.btnnext.caption"
msgid "Next"
msgstr "继续"

msgctxt "main.btnback.caption"
msgid "Back"
msgstr "返回"

msgid "Almost before we knew it, we had left the ground."
msgstr "几乎在我们意识到之前,我们已经离开了地面。"

msgid "2022"
msgstr "2022"

msgid "Password"
msgstr "输入密码"

expected

so, I would prefer it to be this way:

#: main.caption
msgid "Happy New Year"
msgstr "新年快乐"

#: main.btnok.caption
msgctxt "main.btnok.caption"
msgid "OK"
msgstr "确定"

#: main.btnnext.caption
msgctxt "main.btnnext.caption"
msgid "Next"
msgstr "继续"

#: main.btnback.caption
msgctxt "main.btnback.caption"
msgid "Back"
msgstr "返回"

#: main.password.hint
msgid "Almost before we knew it, we had left the ground."
msgstr "几乎在我们意识到之前,我们已经离开了地面。"

#: main.password.text
msgid "2022"
msgstr "2022"

#: main.label1.caption
msgid "Password"
msgstr "输入密码"

@hansu
Copy link

hansu commented Apr 2, 2022

I have the same problem

zbyna pushed a commit to zbyna/po-xls that referenced this issue May 25, 2022
```#: reference...```
were not created in output po file.
@zbyna zbyna linked a pull request May 25, 2022 that will close this issue
@zbyna
Copy link

zbyna commented May 26, 2022

I have created #26 which fixes this issue.

Before (even if) this will be merged it is possible to install po-xls from my fork with:
pip install git+https://github.com/zbyna/po-xls.git#egg=poxls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants