Hello there,

Please let me know if it is a duplicate. I would like to propose the 
support of `--add-location` of `xgettext` in Django makemessages, in order 
to provide a fine-grain control of the metadata of .po files.

At present, Django makemessages support `--no-location` to completely 
suppress the `#: file:line` lines. 

Quote from https://www.gnu.org/software/gettext/manual/gettext.html:

‘--add-location=type’ 
>
> Generate ‘#: filename:line’ lines (default). 
>
> The optional type can be either ‘full’, ‘file’, or ‘never’. If it is not 
> given or ‘full’, it generates the lines with both file name and line 
> number. If it is ‘file’, the line number part is omitted. If it is ‘never’, 
> it completely suppresses the lines (same as --no-location). 
>


After consulting the Git history of GNU gettext on Savannah, I found it 
added in March 2014:


commit 90c76fda268779b80c2fa969b8efddbb4aa5da1e
> Author: Daiki Ueno <EMAIL ADDRESS>
> Date:   Mon Mar 24 18:43:01 2014 +0900
>
>     Extend --add-location option to suppress line number output
>     
>     The --add-location option of msgattrib, msgcat, msgcomm, msgconv,
>     msgen, msgfilter, msggrep, msgmerge, msguniq, and xgettext
>     commands now takes an optional argument 'never', 'full', or
>     'file', to control the format of "#: ..."  comments.
>     
>     The default catalog reader changed to always remember file
>     positions so the line number part can be suppressed in output
>     phase rather than input phase.
>
>

Why adding this: it will help a lot the version control of .po files. It 
will exclude many noises that can simply be triggered by a line 
addition/deletion. By keeping file names but not line numbers, this would 
be a good compromise between developers who find this metadata noisy and 
translators who may rely on this information.

Please kindly comment. Thank you!

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/f0405b21-aee9-415a-9772-296353678da6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to