Check for supported locale in Emoji picker#11079
Conversation
ahukkanen
left a comment
There was a problem hiding this comment.
Nice catch!
I added a recommendation how we could fetch the supported locales directly from the source (i.e. emojibase).
And just for clarity, this locale is used to describe each emoji picture as shown here:

The UI translations (e.g. emoji categories and so) are shipped already with the Decidim locales.
Meanwhile looking at this I also noticed that the emoji data is loaded from a CDN. I created a new issue about that (see #11082), we can handle that separately.
|
This is a bug that only happens in v0.28.0.dev, so we don't need to backport it. Maybe we should change the I'm thinking on a new procedure for making easier signaling these kind of exclusions for #11065. Also, focusing in the CHANGELOG, this isn't relevant to implementers, as it's a bug introduced (and solved) in v0.28.0.dev itself, so it makes sense to not add it there. |
|
@andreslucena As a follow-up I think it might be good to try to get the locale data for Catalan also included in the emojibase packages. I believe they are pulling the datasets for the translations from CLDR from this repository: To me it seems that there is emoji data available for Catalan as well: I don't know their criteria for adding a new locale as it is not documented there (or I didn't find it). But maybe it could be suggested? |
Regarding this I think a separate label is good for signaling this, as I've seen you've already added. I have added the |
|
I also found this issue where the maintainer said the following:
I asked a question there on what are the requirements and what is the process for suggesting a new locale: |
Yes, that was my reasoning too 👍🏽
👏🏽 👏🏽 |
* redesign/sync-develop-2: (150 commits) Adapt tests to redesign Fix stylelint offenses Fix linter offenses Fix sanitizer Recover deleted translation Recover test fix Fix method definition and syntax Check for supported locale in Emoji picker (#11079) Fix configuration param and documentation links in CSP (#11098) Show all projects if none is selected when the voting has finished (#11090) Add Content Security Policy support (#10700) Replace `bootstrap-tagsinput` npm package with `tom-select` (#11076) Avoid password change to be requested when user registration mode is disabled (#11070) Lock sass-embedded to 1.62 (#11074) Add a button to send a newsletter to the admin (#10896) Fixing more tests Fixing more specs Fixing most of the failings specs Fixing most of the failings specs Bump doorkeeper from 5.5.4 to 5.6.6 (#11002) ...
* Check for supported locale in Emoji picker * Apply suggestion from code review * Add spec * Fix spellchecker offense * Fix spec
🎩 What? Why?
While working in Emojis, I found that we added i18n supported (yay!) but it fails if the locale isn't supported by our library providers (
@picmo/popup-pickerandemojibase).The solution is to check if it's supported by them and if not fallback to English (as it used to work until now).
Sadly I couldn't find any API to get this list, so we're hardcoding the supported locales :/
📌 Related Issues
@joeattardi/emoji-buttonto@picmo/popup-picker#9667Testing
📷 Screenshots
Before
After
Mind that in this case emojipicker getting the correct locale but the problem is in emojibase that doesn't support catalan.