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

write program to validate language translations have correct format specifiers #3835

Open
krader1961 opened this Issue Feb 9, 2017 · 2 comments

Comments

Projects
None yet
2 participants
@krader1961
Contributor

krader1961 commented Feb 9, 2017

Issue #3834 was the result of a typo in the German language translation -- a %s was used in the translated message where %d was needed. While fixing that I noticed, and fixed, several similar errors; e.g., %s where it should have been %ls. We should write a program, probably in Python, to automate validating the translated strings have the same format specifiers.

@krader1961 krader1961 added this to the fish-future milestone Feb 9, 2017

@faho

This comment has been minimized.

Show comment
Hide comment
@faho

faho Feb 9, 2017

Member

As I've noted in f27407b, GNU's msgfmt (which we use to build the translations) has various "--check" flags, among them "--check-format".

This should probably be enabled.

TBD remains how this works on macOS, and if that option can just always be enabled in the build or if it should be part of the tests.

Member

faho commented Feb 9, 2017

As I've noted in f27407b, GNU's msgfmt (which we use to build the translations) has various "--check" flags, among them "--check-format".

This should probably be enabled.

TBD remains how this works on macOS, and if that option can just always be enabled in the build or if it should be part of the tests.

@krader1961

This comment has been minimized.

Show comment
Hide comment
@krader1961

krader1961 Feb 9, 2017

Contributor

I installed the gettext package on Ubuntu and ran msgfmt --check-format de.po. It did find the error on line 338. But it didn't catch any of the other five format errors I found. And there may be errors I didn't find because I was doing it by eyeballing the text. So running msgfmt --check-format is better than nothing but not by much.

Contributor

krader1961 commented Feb 9, 2017

I installed the gettext package on Ubuntu and ran msgfmt --check-format de.po. It did find the error on line 338. But it didn't catch any of the other five format errors I found. And there may be errors I didn't find because I was doing it by eyeballing the text. So running msgfmt --check-format is better than nothing but not by much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment