From: Leandro R. <lea...@gm...> - 2014-11-02 17:45:43
|
2014-10-28 9:21 GMT+01:00 Sietse Brouwer <sbb...@gm...>: > Hello all, > > I've written a pofilter check for consistency of Python's {}-style > placeholders between original and translation. Is there any interest > in merging this into the main development branch? Details below. Yes, thanks for the contribution. Once we have time to review it we will merge it after it passes our scrutiny. We will try our best for this to be merged in before next release. Bye > Python has two ways to do string formatting with placeholders: > > 1. with `%s or %(name)s`-style placeholders, a.k.a. printf style; > 2. with `{}`, `{0}` or `{name}`-style placeholders. This system is > described in PEP > 3101. [1] > > [1] http://legacy.python.org/dev/peps/pep-3101/ > (NB: the 'legacy' bit refers to the site, not the PEP' > > Translations involving %s can be checked with pofilter's > 'printf' filter; but I couldn't find any way to check translations > involving {}-style placeholders, so I added a filter to pofilter. > Added tests and documentation to the filter, and now I > think I've got somethin ready to be contributed upstream. > > The pull request: > https://github.com/translate/translate/pull/133 > > Link to the documentation I wrote: > https://github.com/sietse/translate/blob/pythonbrace/docs/commands/pofilter_tests.rst#pythonbraceformat > > The code: > https://github.com/sietse/translate/blob/pythonbrace/translate/filters/checks.py#L895 > > The documentation: > pythonbraceformat Checks whether python brace format strings match. > > Kind regards, > > Sietse Brouwer > > ------------------------------------------------------------------------------ > _______________________________________________ > Translate-devel mailing list > Tra...@li... > https://lists.sourceforge.net/lists/listinfo/translate-devel |