Open Ahnfelt opened 5 years ago
scala-xgettext doesn't enforce a specific text format. It only extracts texts. Users can freely choose format they want.
Hmm, if you don't add format tags - then how do you make tools like Poedit report errors like the following?
Note that I'm using #, c-format
- the #, java-format
was the wrong tag to use for printf-style format strings.
Do you have a proposal how to automatically add that info?
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.
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
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:
Translation tools may also use this to validate that all placeholders are used in the translation, and that they are syntactically well formed.