The Wayback Machine - https://web.archive.org/web/20200603223336/https://github.com/git-cola/git-cola/issues/1019
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

Consult , How to iterate the. po file? #1019

Open
625781186 opened this issue Dec 1, 2019 · 4 comments
Open

Consult , How to iterate the. po file? #1019

625781186 opened this issue Dec 1, 2019 · 4 comments

Comments

@625781186
Copy link

@625781186 625781186 commented Dec 1, 2019

Please advise how to update the .po file every time the git-cola. pot file content changes without overwriting the previous translation.

@625781186
Copy link
Author

@625781186 625781186 commented Dec 1, 2019

May be use msgmerge ?

@davvid
Copy link
Member

@davvid davvid commented Dec 1, 2019

My bad, I should probably be generating the git-cola.pot file more often. I believe the workflow is that we are supposed to periodically run make pot to update the git-cola.pot file, commit the result, and then run make po to update the .po files with new/missing translations.

The Makefile defines the make targets/commands, and the files that implement the build_mo (make mo) and build_pot (make pot) commands via setup.py are provided by extras/build_mo.py and extras/build_pot.py.

Let me know if that makes sense. We should document what setup.py is doing under the hood and document the high-level workflow before closing this issue. We should close this issue with a commit that updates README.md with a Translation section that documents the workflow. We'll also document the underlying msgmerge and msgcat commands that are used by the makefile targets so that someone could run the steps manually and see that it's just the standard gettext tools and workflows under the hood.

Thanks for the report.

@625781186
Copy link
Author

@625781186 625781186 commented Dec 2, 2019

Thanks ,
I already know how to do it.
But there are some mistakes :
image

https://github.com/git-cola/git-cola/blob/master/extras/build_pot.py
Line 121 may be need add encoding="utf8"

@davvid
Copy link
Member

@davvid davvid commented Dec 12, 2019

Maybe in the open(src, 'rU') line, try making it say open(src, 'rb') so that it opens it in binary, and then change the read line to be content = f.read().decode('utf-8'). Please let me know if that works and we'll get that patched ASAP.

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

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.