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

Add format tag to .pot: #, java-format #22

Open
Ahnfelt opened this issue May 23, 2019 · 5 comments
Open

Add format tag to .pot: #, java-format #22

Ahnfelt opened this issue May 23, 2019 · 5 comments

Comments

@Ahnfelt
Copy link

Ahnfelt commented May 23, 2019

The current implementation doesn't seem to add the #, java-format flag as documented here:

https://www.gnu.org/software/gettext/manual/html_node/PO-Files.html#The-Format-of-PO-Files

Tools like Poedit understand this flag and displays it to translators:

billede

Translation tools may also use this to validate that all placeholders are used in the translation, and that they are syntactically well formed.

@ngocdaothanh
Copy link
Member

scala-xgettext doesn't enforce a specific text format.
It only extracts texts.
Users can freely choose format they want.

@Ahnfelt
Copy link
Author

Ahnfelt commented May 27, 2019

Hmm, if you don't add format tags - then how do you make tools like Poedit report errors like the following?

Screen Shot 2019-05-27 at 11 19 08

Note that I'm using #, c-format - the #, java-format was the wrong tag to use for printf-style format strings.

@ngocdaothanh
Copy link
Member

Do you have a proposal how to automatically add that info?

@Ahnfelt
Copy link
Author

Ahnfelt commented May 29, 2019

Perhaps an optional tag parameter at the end of the method name configuration?

scalacOptions += "-P:xgettext:t:tf:c-format"

This would cause all strings extracted from calls to the tf method to get the #, c-format tag.

@ngocdaothanh
Copy link
Member

I guess that's the best we can do.
Please create a pull request.

Note that there are several existing options, as listed in README:
https://github.com/xitrum-framework/scala-xgettext/blob/master/README.rst

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

No branches or pull requests

2 participants