Skip to content
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

IBX-8502: Added unsupported locale fallback #171

Merged
merged 3 commits into from
Aug 20, 2024

Conversation

reithor
Copy link
Contributor

@reithor reithor commented Jul 9, 2024

🎫 Issue IBX-8502

Issue seems to come from the fact that Intl does not support 3 letter region subtags:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl

A locale identifier is a string that consists of:
# A language subtag with 2–3 or 5–8 letters
# A script subtag with 4 letters Optional
# A region subtag with either 2 letters or 3 digits Optional (!)
# One or more variant subtags (all of which must be unique), each with either 5–8 alphanumerals or a digit followed by 3 alphanumerals Optional
# One or more BCP 47 extension sequences Optional
# A private-use extension sequence Optional

PR adds a fallback to eng-GB for locales not supported by Intl.

@reithor
Copy link
Contributor Author

reithor commented Jul 11, 2024

Notes:

  • I searched for other occurrencies of Intl.Locale in our code - found nothing
  • I also searched for meta[name="LanguageCode"], found some places but only base-ckeditor.js is applying Intl.Locale
Targets
    Occurrences of 'meta[name="LanguageCode"]' in Directory \\wsl$\Ubuntu\var\www\html\ddev\CS-11600\vendor\ibexa\
Found Occurrences in Directory \\wsl$\..\vendor\ibexa\  (´8 usages found)
    Usage in string constants  (7 usages found)
        vendor\ibexa\admin-ui\src\bundle\Resources\public\js\scripts  (1 usage found)
            embedded.item.actions.js  (1 usage found)
                9 const metaLanguageCode = document.querySelector('meta[name="LanguageCode"]')?.content;
        vendor\ibexa\fieldtype-richtext\src\bundle\Resources\public\js\CKEditor\core  (1 usage found)
            base-ckeditor.js  (1 usage found)
                131 locale  = new Intl.Locale(doc.querySelector('meta[name="LanguageCode"]').content);
        vendor\ibexa\fieldtype-richtext\src\bundle\Resources\public\js\CKEditor\embed  (1 usage found)
            embed-base-ui.js  (1 usage found)
                22 const languageCode = document.querySelector('meta[name="LanguageCode"]').content;
        vendor\ibexa\fieldtype-richtext\src\bundle\Resources\public\js\CKEditor\link\ui  (1 usage found)
            link-form-view.js  (1 usage found)
                379 const languageCode = document.querySelector('meta[name="LanguageCode"]').content;
        vendor\ibexa\fieldtype-richtext\src\bundle\Resources\public\js\CKEditor\upload-image  (1 usage found)
            upload-image-command.js  (1 usage found)
                8 const languageCode = document.querySelector('meta[name="LanguageCode"]').content;
        vendor\ibexa\form-builder\src\bundle\Resources\public\js\config-form\fields  (1 usage found)
            location.js  (1 usage found)
                4 const languageCode = doc.querySelector('meta[name="LanguageCode"]').content;
        vendor\ibexa\taxonomy\src\bundle\Resources\public\js  (2 usages found)
            select.parent.js  (1 usage found)
                15 const languageCode = doc.querySelector('meta[name="LanguageCode"]').content;
            tag.content.js  (1 usage found)
                14 const languageCode = doc.querySelector('meta[name="LanguageCode"]').content;

@dew326
Copy link
Contributor

dew326 commented Aug 8, 2024

@reithor any progress on that?

@reithor
Copy link
Contributor Author

reithor commented Aug 9, 2024

@reithor any progress on that?

@dew326 - missed message from @GrabowskiM , will take care of that now.

@reithor reithor requested a review from GrabowskiM August 9, 2024 07:21
@reithor reithor requested a review from konradoboza August 14, 2024 07:41
@reithor
Copy link
Contributor Author

reithor commented Aug 14, 2024

@dew326 this needs also approval from one maintainer ? @alongosz or @konradoboza ?

@dew326
Copy link
Contributor

dew326 commented Aug 14, 2024

I'm the maintainer of this package as well. We are good. You can pass it to QA.

@reithor reithor force-pushed the ibx-8502-added-unsupported-locale-fallback branch from f112c1a to 3591606 Compare August 19, 2024 09:38
Copy link

sonarcloud bot commented Aug 19, 2024

@dew326 dew326 merged commit 369f36f into 4.6 Aug 20, 2024
21 checks passed
@dew326 dew326 deleted the ibx-8502-added-unsupported-locale-fallback branch August 20, 2024 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants