> Am 09.06.2017 um 01:44 schrieb Bruno Haible <br...@clisp.org>: > > Hello, > >> Stack Overflow Discussion: >>> I am using xgettext with standard input because the input is not available >>> in a file. > > The GNU gettext documentation [1] explains that these references are useful > for a translator to understand the context of a certain message. (Admittedly > a translator who has an at least rough understanding of a programming > language.) > > You cannot give this service to a translator if the input is not available as > a > file.
The input comes from an actual file, but it's precompiled. The toolchain operates completely in-memory until the final files are emitted. I could write the memory contents to a file and then have xgettext load that file but it would mean hundreds of little files written just to be deleted after. > Therefore you should try to make the input available as a file, and make it > clear > to the translator where to find this source file. > > If you really can't do that, you can use the xgettext option '--no-location'. > >> I need an option added to the xgettext utility that would allow me to >> overwrite the filename used in the location line. Currently, when supplying >> the source code via stdin, it just says “#: standard input:123”, and I want >> to be able to control what it says instead of “standard input”. > > There is no point in introducing such an option. If the translator cannot > get the file mentioned in the references, the references are useless. My goal here is to provide the translator with the actual file and the filename I would like to provide is the real filename. > Bruno > > [1] > https://www.gnu.org/software/gettext/manual/html_node/C-Sources-Context.html >