- Status changed to Needs review
over 1 year ago 1:41pm 28 March 2023 - Status changed to Needs work
over 1 year ago 1:01am 29 March 2023 - 🇺🇸United States cedewey Denver, CO
Hi @mukesh88, thanks for contributing your patch. To get this work accepted we need to address the fact that we should never use t() to translate variables.
If you can update your patch to account for that, that would be great. Thanks!
- Assigned to mukesh88
- First commit to issue fork.
- @kunal_sahu opened merge request.
- Status changed to Needs review
over 1 year ago 7:38am 29 March 2023 - Issue was unassigned.
- Status changed to Needs work
over 1 year ago 7:41am 29 March 2023 - 🇮🇳India kunal_sahu Karnataka
@mukesh88 Can you please look at this issue .
$ git apply -v 2955352-25.patch Checking patch maxlength.module... error: while searching for: $maxlength_js = $thirdPartySettings['maxlength']['maxlength_js_summary']; $element['summary']['#attributes']['data-maxlength'] = $maxlength_js; $maxlength_js_label = !empty($thirdPartySettings['maxlength']['maxlength_js_label_summary']) ? $thirdPartySettings['maxlength']['maxlength_js_label_summary'] : t('Content limited to @limit characters, remaining: <strong>@remaining</strong>'); $element['summary']['#attributes']['maxlength_js_label'][] = $maxlength_js_label; if (isset($thirdPartySettings['maxlength']['maxlength_js_enforce']) && $thirdPartySettings['maxlength']['maxlength_js_enforce']) { error: patch failed: maxlength.module:161 error: maxlength.module: patch does not apply
Thanks
- Status changed to Needs review
over 1 year ago 8:52am 29 March 2023 - 🇮🇳India kunal_sahu Karnataka
@mukesh88 Apologies , i was applying it to the wrong branch.
The patch looks good to me.
I think this issue can be now moved to RTBC.
/web/modules/contrib/maxlength-2955352 (2.1.x) $ git apply -v 2955352-25.patch Checking patch maxlength.module... Applied patch maxlength.module cleanly.
Thanks
@kunal_sahu if you have review the issue then you can moved to RTBC
- Assigned to joevagyok
- 🇺🇸United States cedewey Denver, CO
I tested this on our 2.1.x branch and I believe this is now working as expected. The tokens, @limit and @remaining and @count need to stay named as such, but I think that's ok. Otherwise, the other countdown message text if translated shows up as expected on the respective language's edit form.
- Status changed to Needs work
over 1 year ago 5:51pm 15 May 2023 - 🇺🇸United States cedewey Denver, CO
I misspoke. What I had done was change the countdown message to Spanish and displayed as such even in English interfaces. I went to the User Interface Translation admin page (/admin/config/regional/translate) and searched for "content limited" and the MaxLength countdown string was not available.
So, there is still work that needs to be done to make the countdown message translatable.
- Status changed to Closed: works as designed
over 1 year ago 2:36pm 2 August 2023 - 🇧🇬Bulgaria pfrenssen Sofia
I can confirm that the fix from 🐛 Config schema type for maxlength_js_label and maxlength_js_label_summary should be text Fixed has also solved this issue. I can also confirm as many said before that the approach in the current patch is wrong.
The confusion about how to translate this probably arises from the fact that there is no UI for translating field widget configuration yet. But there is a WIP patch in 🐛 Entity view/form mode formatter/widget settings have no translation UI Needs review that adds this UI.
I will close this as "Works as designed" since this is already working from the perspective of the MaxLength module.
Here are instructions to make it work:
- Apply the patch from 🐛 Entity view/form mode formatter/widget settings have no translation UI Needs review that works with your version of Drupal core. This patch will add the UI needed to add the translations.
- Clear the cache.
- Log in as admin.
- Go to Configuration > Regional and Language > Configuration translation.
- In the list, find the row that contains the "form display" configuration for the entity type that has the field you want to translate. For example if you are using nodes, find "Content form display". Click "List" in this row.
- Click "Translate" next to the bundle name that has the field you want to translate.
- Now press "Add" or "Edit" for the language you want to translate to.
- Next up look in the "Field widgets" section and find the configuration for the field you want to translate. Note that this UI is still a work in progress and might not be very intuitive.
- Expand the "Third party settings" fieldset and edit the translation.
- Press "Save translation" at the bottom of the form.
Here is how the UI looks:
- 🇺🇸United States cedewey Denver, CO
Thanks Pieter, this is very helpful. I've updated the task description with this resolution and am crediting you as the author of this fix. Much appreciated!
- 🇩🇪Germany markdc Hamburg
I also wish to express my thanks @pfrenssen
This solution is certainly the way forward.