-
-
Notifications
You must be signed in to change notification settings - Fork 825
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
fix unit plural in contribution page #21944
Conversation
(Standard links)
|
It looks like all the .po files were autoupdated and now a lot of things have become untranslated, e.g. https://lab.civicrm.org/dev/translation/-/commit/5590912b2eb023c84975d86c51da68922c1c300b#21b169ad3734b06f683b854acd7a6621196eed52_30615_31048 |
@demeritcowboy sorry, I don't understand your comment and why checks are not passed. |
The month names used to be in report.po, but after the latest transifex update they are now in common-base.po and are no longer translated. fr_FR and es_MX need the month names to be retranslated in transifex. |
But what does that have to do with my pull request? |
It just explains the test fails. It's not caused by your PR. All the PRs will fail until those month names are updated in fr_FR and es_MX. I posted here since it's where I saw it first but you're right it's a more general test fail. |
jenkins, test this please |
jenkins retest this please strange error
|
return ts('year(s)'); | ||
|
||
default: | ||
throw new CRM_Core_Exception('Unknown unit: ' . $unit); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's worth noting that it's currently possible to edit the "Recurring Frequency Units" options from the "Administer" -> "Option Groups" area of the CiviCRM UI.
I can't think of any good reasons for adding or removing frequency units in this way, but there might be - if so it might be better to fallback to the exiting method of appending '(s)' if an unrecognised string is found, rather than throwing the exception.
Alternatively, maybe the "Recurring Frequency Units" option_group should be set to is_locked so that new options cannot be added. (and appreciate that's a seperate task, but maybe something to consider in tandem).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@braders see comments of this issue: I would have happily done so: return ts($unit . '(s)');
but we cannot put a variable in translation: https://docs.civicrm.org/dev/en/latest/translation/#best-practices.
Furthermore, the intervention is consistent with this. See also this comment.
test this please |
@masetto we (@kainuk, @BettyDolfing and I) are doing reviews of PR's. We tried to test this PR, with CiviCRM in Dutch, but we failed to do so. On the contribution page we get errors and the dropdown with frequencies is still in English. It might be that something unrelated on the test site is broken but it might also be that your commits breaks something else. We are not sure about that. Can you have another look at it? And maybe come up with instructions on how to test this? So we can reproduce the problem on dmaster.demo.civicrm.org and see whether your fix works. |
@jaapjansma I am sorry that you have had these problems, but they do not seem to be due to my changes. Them my contribution form appears like this: |
Also should squash the commits. |
I need to update my review. The |
I am really sorry about the typo.:thumbsdown: |
No worries but note it still crashes. I think because the hidden field has the translated value. |
In my tests it does not crash, I can't replicate it. |
When there's only one unit option, e.g. if only months is checked on the config page. |
On the test site here: http://core-21944-2pmad.test-1.civicrm.org:8001/civicrm/contribute/transact?reset=1&id=4
|
Right! I push a fix. |
Thanks @masetto looks good. Can you just squash commits and then this is ready to go. |
style fixes for compiling check fix a typo fix `recur_frequency_unit` hidden field value when there is only one unit option
test this please |
This is the proposal to solve the problem of translation of the plural of frequency units in contribution page.
See this issue.
If the solution is good, it should also be applied in the pledge page.