Closed trikko closed 6 years ago
xgettext utility should be able to find certain symbols to create .pot file from source file. By default these symbols are gettext and ngettext. Surely It can be changed via xgettext parameters, but using opCall means that project's author will need to find all MoFile instances names and pass them to xgettext. Not convenient at all.
As for overload, xgettext seems to require different symbols to distinguish between simple translation and translation that considers plural forms.
E.g. with this file
translate("Hello, world");
translate("File", "Files", 4);
and xgettext path-to-file --keyword=translate:1 --keyword=translate:1,2
It does not produce template for plural form of Files
I found out that xgettext can support overloads too https://www.gnu.org/software/gettext/manual/html_node/xgettext-Invocation.html (overloaded function calls in C++)
xgettext --keyword=translate:1 --keyword=translate:1,2,3t
I'm still not sure if it's really needed in the library. I would like to stick to xgettext defaults. Those who needs such kind of overload can make a wrapper and they will need to pass additional options to xgettext anyway.
Closing. I hope my explanation on why the proposed changes are not desirable is clear.
OpCall:
Overload, why not (maybe for opcall syntax only?):