stable
Clone or download
request #9837: Provide a way to have pluralized textual messages For example in a recent development, when you enter a TQL query with one invalid field, the error message will be: Fields 'assignd_to' don't exist Which is grammatically wrong since there is only one field. A more correct form would be: Field 'assignd_to' doesn't exist .tab format does not support pluralization, however gettext does; hopefully gettext is available since request #9657. This commit uses the above concrete example as a way to bootstrap pluralization. This means that starting this commit we can use gettext in tracker plugin (in addition of proftpd) \o/. To test, enter "assignd_to = 'toto'" in a report in expert mode. You should get a pluralized message. Try with more than one invalid field. Try with both unsupported fields and non existing fields. Try an invalid query "azd" or a deep query (limit = 1 in site admin ยป tracker ยป report). All those error messages are now given by gettext. Now plugins are whitelisted in a po/mo generation and not anymore hard coded. By the way, only plugins is concerned by the current work. Core will be done when needed in a dedicated commit. This is a follow-up of change Iab49e258a52e875509fc6de81c7fe8c6c7de684b Change-Id: I50bfc21edba2c66cad8e59ae4da5a444091db99b
Modified Files
Name | ||||
---|---|---|---|---|
M | plugins/tracker/include/Tracker/Report/Query/Advanced/Grammar/InvalidFieldsCollection.php | +2 | โ34 | Go to diff View file |
M | plugins/tracker/include/Tracker/Report/Tracker_Report.class.php | +29 | โ25 | Go to diff View file |
M | plugins/tracker/include/trackerPlugin.class.php | +1 | โ0 | Go to diff View file |
M | plugins/tracker/site-content/en_US/tracker.tab | +0 | โ4 | Go to diff View file |
A | plugins/tracker/site-content/fr_FR/LC_MESSAGES/tuleap-tracker.po | +25 | โ0 | Go to diff View file |
M | plugins/tracker/site-content/fr_FR/tracker.tab | +0 | โ4 | Go to diff View file |
A | plugins/tracker/site-content/tuleap-tracker.pot | +20 | โ0 | Go to diff View file |
M | tools/utils/generate-mo.sh | +14 | โ4 | Go to diff View file |
M | tools/utils/generate-po.sh | +68 | โ22 | Go to diff View file |