- Issue created by @fchometon
- Merge request !477Issue #3452986: Update jquery.intl-tel-input to v23.0.10 and add option for i18n → (Open) created by fchometon
- last update
6 months ago 535 pass, 1 fail - last update
6 months ago 536 pass - Status changed to Needs review
6 months ago 12:54pm 12 June 2024 - Status changed to Needs work
5 months ago 7:16pm 20 June 2024 - 🇧🇷Brazil renatog Campinas
On webform.element.telephone.js#L51 is used: "localization"
var localization = $telephone.attr('data-webform-telephone-international-i18n');
On /src/Plugin/WebformElement/Telephone.php#L194 is used: "localisation"
'#title' => $this->t('Code language for localisation of country names'),
Please correct me if I'm mistaken but seems that both are correct depending the region, like British English and American English, right?
If yes, it's ok but I'd suggest to choose one to be consistent and avoid mixing both. As the same approach of Drupal Coding Standards → that allows more than one option but recommends to choose one and avoid mixing:
Variables should be named using lowercase, and words should be separated either with uppercase characters (example: $lowerCamelCase) or with an underscore (example: $snake_case). Be consistent; do not mix camelCase and snake_case variable naming inside a file.
If possible I'd suggest "localization" that is already in use at webform.install.update.inc#L2355
- last update
5 months ago 536 pass - Status changed to Needs review
5 months ago 1:53pm 21 June 2024 - last update
5 months ago 536 pass I've noticed that the build path for the index.js file is not correct, there is a '/' missing in the
Telephone.php
file (line 129).It would also be beneficial, as we are trying to translate countries for accessability reasons, to always translate them to the current language of the page (especially when a language switch is available).
This could also be a checkbox 'use site default language' and hide the field for the langcode when checked.I hope this is helpful feedback.
~ Josh
I've created a (temporary) patch that fixes the issues mentioned in my previous comment and adds default behavior to use the current site language as the render language when the langcode field is not explicitly set.
- Status changed to Needs work
3 months ago 3:23pm 19 August 2024 - 🇵🇱Poland bronismateusz
I applied the patch to my site, but the country flags stopped showing before the phone number, so something is wrong.
- Status changed to RTBC
3 months ago 7:57pm 21 August 2024 - 🇵🇱Poland bronismateusz
@Sneezycheesy Sorry for the confusion, I checked everything again today and the patch works great. Also, I upgraded the version in your patch to the latest version equal to 24.1.1.
- 🇵🇱Poland bronismateusz
I found the source of the problems from comment #8. The Webform module tries to load a translation file for the `intl-tel-input` library based on the selected language. However, if the selected language is not supported by the library, the module cannot load the necessary file, leading to missing translations and potential errors. I have therefore added the loading of the English version in such a situation.
- Status changed to Needs work
3 months ago 12:22pm 22 August 2024 - 🇨🇦Canada Liam Morland Ontario, CA 🇨🇦
Please make the changes on the merge request. This allows tests to be run.
- 🇺🇾Uruguay jjose.quevedo
Hi folks, I've attached a patch for the webform.element.telephone.js file, adding additional options to the telephone element component.
- First commit to issue fork.