-
Notifications
You must be signed in to change notification settings - Fork 129
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
Allow specifying the priority for PO import/exports in the flags
.
#1341
Conversation
803cde2
to
c017b82
Compare
Clever idea using flags! Looking at the docs of gettext and it doesn't seem like there's a specific syntax defined but most of them are in kebab-case with the exception of the range flag. I guess Having some tests would be nice and shouldn't be that hard to write. Here's the example for |
3c19e00
to
5f02ecd
Compare
While I had read a few gettext pages for the flags field, but I didn't spot anything that suggested a valid set of characters, only that it split by PR updated, and a test included, even if I did write it without running it locally.. with a PHP Syntax error originally.. :) |
Argh, naming is hard… Since it seems using a colon is fine maybe go with that version? |
Tell me about it...
I too had thought about that... I ultimately went with not-prefixed so that it would be a more natural flag in exported files in other tools, Seeing But I also don't know how 3rd party tools will process flags, or if they even will display it? seems like it's more likely that other tools simply won't do anything when it see's these flags, and if it'll never be displayed, it doesn't matter if it's readable or not.. just concise/easy to parse/accurate.
I had also thought about cramming the priority into the Comment section for that purpose, but ultimately decided that using the "internal" translation flags seemed more appropriate than a human-readable area.. |
f868e94
to
7514e02
Compare
Fixes #1340
This allows for the .po file to contain a
high-priority
flag, removing the need for external code to update the database afterwards.Note: This does not reset the priority to
normal
unlessnormal-priority
is explicitly added.The flags looked at are therefor:
low-priority
,normal-priority
,high-priority
, andhidden-priority
I went with the format ofpriority=TEXT
due to the way I started down this rabbit hole.Potentially this could be changed to just beinglow-priority
,normal-priority
,high-priority
,hidden-priority
instead, actual flags rather than a key-value pair. I'm creating this for code-review on the approach.Notests included, but it does work (at least on WordPress.org)