Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rework var formats to match gettext var formats #48

Closed
willkg opened this issue Dec 1, 2014 · 1 comment
Closed

rework var formats to match gettext var formats #48

willkg opened this issue Dec 1, 2014 · 1 comment

Comments

@willkg
Copy link
Member

willkg commented Dec 1, 2014

The format for variables in a given string can be encoded in the #, (pound comma) comments in th e.po file on a msgid by msgid basis.

http://www.gnu.org/software/gettext/manual/html_node/PO-Files.html#PO-Files

Two things:

  1. we should use the same names that gettext does (e.g. c-format, python-format, etc) when specifying variable formats
  2. dennis should be clever enough to have a default to use when no #, is specified for that msgid and to use the #, flags specified by the msgid when available

I think the immediate fix is this:

  1. change "Var" to "Format" (and cleanup related things)
  2. split "pysprintf" into "c-format" (e.g. %s) and "python-format" (e.g. %(foo)s)
  3. change "pyformat" into "python-brace-format" (e.g. {foo})

This probably affects lint rules, too.

Also, we should cover this in the dennis documentation with links to the gettext docs.

@willkg
Copy link
Member Author

willkg commented Jan 7, 2015

I'm going to do c-format in another bug since there are some transposition things it does that I need to look into. That's issue #58.

Handling #, is covered in bug #59.

@willkg willkg closed this as completed in 713288b Jan 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant