Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

[Feature] Emoji names internationalization #75

Closed
qortex opened this issue Jul 23, 2020 · 24 comments
Closed

[Feature] Emoji names internationalization #75

qortex opened this issue Jul 23, 2020 · 24 comments
Labels
enhancement New feature or request
Milestone

Comments

@qortex
Copy link

qortex commented Jul 23, 2020

Would be nice to have the names of the emojis with a customizable language (French for me).

Maybe it's available in the emojis source packages?

@joeattardi
Copy link
Owner

Unfortunately, I haven't seen this data available anywhere. The Emoji data file from Unicode that I use to generate the data is only in English. Plus, with over 1,500 emojis, that would be a lot of localized names to include in the bundle - which would make it even bigger than it already is. I don't think this is practical to do at this point.

I suppose I could add an extension point to change the displayed name of emojis, they could do it on their own, but that's a lot of strings to translate 😄

Will flag this as a possible future enhancement, as there may be other use cases where people would want to change the display names of certain emojis.

@joeattardi joeattardi added the enhancement New feature or request label Jul 23, 2020
@Armaldio
Copy link

Armaldio commented Sep 1, 2020

Hello,

Popping into the thread to say that I have this package that generate internationalized emoji names directly from the official repo

https://github.com/Armaldio/localize-emoji-db

Any contribution to the package is welcome too!

@roderickhsiao
Copy link
Contributor

roderickhsiao commented Sep 2, 2020

Thanks for the library!

I think what we can support locale data without increasing the main bundle is let user to provide the data

  1. build time generated locale data
  2. export those data like emoji-button/locale-data/fr.js
  3. when initialized the component
import frEmojiData from 'emoji-button/locale-data/fr';
const emojiButton = new EmojiButton({
  localeData: frEmojiData
});
  1. use en as default but replace with custom passed in data (will need to pass emojiData from constructor and pass along sub component such as EmojiArea...)

in this case it won't be included in main bundle and user decide which locale data to display/search.

For locale data, we are using https://www.unicode.org/Public/emoji/12.0/emoji-test.txt, wonder we could probably use the English file generated here as a based and use @Armaldio 's cldr data to replace the emoji name . Would probably need https://github.com/Armaldio/localize-emoji-db to abstract tts name out in addition to keyword as emoji-button currently is using tts naming for the emoji name. (probably publish another package).

Happy to help generate all those data by locale if this direction is good :)

@bmarsaud
Copy link

bmarsaud commented Oct 25, 2020

Thanks a lot for this library!

As a workaround, is it currently possible to modify the emoji list used by the package?
I suppose that changing the name attribute of each emoji would be transparent for the whole code.

@roderickhsiao
Copy link
Contributor

roderickhsiao commented Dec 8, 2020

@qortex @bmarsaud let me know if the new function supports works for you :)
https://emoji-button.js.org/docs/customData

@ovari
Copy link
Contributor

ovari commented May 1, 2021

Emoji names internationalization has been done in LibreOffice, cf. Add translation support for short names of Emoji and other symbols. @laszlonemeth can you please provide a link that has the translations of emoji's for other locales used in LibreOffice? Perhaps these translations can be used in this repo?

This would also help with localising Jami as it uses this repo, cf. https://git.jami.net/savoirfairelinux/jami-client-qt/-/issues/115#note_28054. Jami currently has 94 languages https://www.transifex.com/savoirfairelinux/jami

Thank you

@ovari
Copy link
Contributor

ovari commented May 1, 2021

@ovari
Copy link
Contributor

ovari commented May 1, 2021

@joeattardi can the headings and fields in your emoji picker please be translatable?

  1. Search emojis…
  2. Recent emojis
  3. Smileys & emotions
  4. People & body
  5. Animals & nature
  6. Food & drink
  7. Activities
  8. Travel & places
  9. Objects
  10. Symbols
  11. Flags
  12. Popups when hovering on an emoji

Cf. https://git.jami.net/savoirfairelinux/jami-client-qt/-/issues/381

@joeattardi do you prefer that a new issue is created about the heading and field in your emoji picker?

Thank you once again

@joeattardi
Copy link
Owner

@ovari Headings, category names, etc.are able to be translated now, see https://emoji-button.js.org/docs/i18n

As for the emoji names themselves, I am currently in the midst of a big refactoring effort for the upcoming 5.0 release, as of now I do plan on having localization data as part of that release. Stay tuned!

@ovari
Copy link
Contributor

ovari commented May 16, 2021

Thank you @joeattardi for your comment at #75 (comment).

Does that related to 5d6eefb?

Where and how do we add the strings to https://emoji-button.js.org/docs/i18n/ for the hu (Hungarian - magyar) locale?

Should 3-character ellipses (...) be replaced by 1-character ellipses ()? For example, should
Search emojis...
be replaced by
Search emojis…
?

Thank you

@joeattardi
Copy link
Owner

Here's an update on i18n.

For v5, I am using the emojibase-data library to generate the Emoji Button data files. (https://www.npmjs.com/package/emojibase-data)

This new data source contains localized category and emoji names for the following locales:

https://github.com/milesj/emojibase/tree/master/packages/data

Basically, for v5, you will import a particular locale from a new package, @emoji-button/emoji-data/emojis/<locale> and pass this to the picker you create. The data file you pass in will have all the localized names, which will be used in the picker UI.

I'm not sure about a time frame yet for a 5.0 release but work is in progress.

@joeattardi joeattardi added this to the 5.0 milestone Jun 4, 2021
@ovari
Copy link
Contributor

ovari commented Jun 9, 2021

Can programs, like Jami, include all the locales? Then if the locale is changed, the Emoji picker will show in the changed language (as long as the language is at https://github.com/milesj/emojibase/tree/master/packages/data).

@joeattardi
Copy link
Owner

When version 5 comes out, it will support localized emoji names for all languages in the Unicode CLDR:

https://github.com/unicode-org/cldr/tree/master/common/annotations

There are a lot of languages, however: unfortunately Unicode doesn't seem to provide localized names for the categories. And even if they did - Emoji Button has two additional, non-standard categories: Recents and Custom. No translations would be available for those, either

So you would have to provide translated category names for all the locales you wish to support, but the emoji names themselves will be good to go. Currently the language can only be specified when creating an EmojiButton instance, but I can see if there's a (performant) way to update the language of an existing picker Otherwise, if the language needs to change, you can just destroy the old picker and create a new one with the updated language.

You can see the progress of v5 here: https://github.com/joeattardi/emoji-button/projects/3

@ovari
Copy link
Contributor

ovari commented Jun 10, 2021

Thank you for your comment and link to your progress.

In English, there is no plural of recent. Should Recents be Recent, i.e. without the trailing s? Maybe there could be a comment to let translators know that Recent is the plural form, if languages do have a plural form.

Can the Hungarian translations of Categories, Recent and Custom provided below be merged into your project so that all downstream projects using your program get them?

CategoriesKategóriák
https://www.microsoft.com/en-us/language/Search?&searchTerm=categories&langID=382&Source=true&productid=0

RecentLegutóbbiak
https://www.microsoft.com/en-us/language/Search?&searchTerm=Recent&langID=382&Source=true&productid=0

CustomEgyéni
https://www.microsoft.com/en-us/language/Search?&searchTerm=Custom&langID=382&Source=true&productid=undefined

Other language translations can be found at Microsoft Language Portal Terminology Search.

What do you think?

Thank you

@ovari
Copy link
Contributor

ovari commented Jun 10, 2021

@Armaldio do translations of Categories, Recent (plural form) and Custom need to be added to your package?

If so, would that mean that the translations would then be available in the Emoji picker?

Thank you

@joeattardi
Copy link
Owner

Sorry, I misspoke. The actual English label is "Recent Emojis".

@ovari
Copy link
Contributor

ovari commented Jun 18, 2021

Sorry, I misspoke. The actual English label is "Recent Emojis".

Hungarian translation:
Recent EmojisLegutóbbi hangulatjelek

@joeattardi
Copy link
Owner

This is fixed in the upcoming 5.0.0 release. Will close the issue upon release.

@ovari
Copy link
Contributor

ovari commented Apr 18, 2022

@joeattardi, thank you for your comment.

Where can we provide the Hungarian translations for:

  1. The strings in https://github.com/joeattardi/picmo/blob/main/src/i18n/lang-en.ts;
  2. Categories, Recent Emojis and Custom; and
  3. Any other strings that need localization?

Thank you

@joeattardi
Copy link
Owner

Currently all the strings you see in lang-en.ts are all of them.

See https://picmojs.com/docs/usage/i18n for more details about translations.

You just need to create a module that exports translated strings for those message keys. You can then import that module and pass it as the i18n option.

(A PR adding the language bundle is appreciated as well!:) )

@joeattardi
Copy link
Owner

This issue is resolved in v5.0.0-beta.6.

@ovari
Copy link
Contributor

ovari commented May 1, 2022

Currently all the strings you see in lang-en.ts are all of them.

See https://picmojs.com/docs/usage/i18n for more details about translations.

You just need to create a module that exports translated strings for those message keys. You can then import that module and pass it as the i18n option.

(A PR adding the language bundle is appreciated as well!:) )

We would be honored to provide the Hungarian translations; however, if understood correctly there is some logic required.

Should a new issue be created about adding the logic to have the localization within your program?

If all that is required is for the Hungarian translations to be provided in a file somewhere in this repository, please advise the location so they can be provided.

Thank you

@lawrencemcn
Copy link

Hi, does anyone knows how to implement in DECIDIM the translation for

search: 'Search emojis...',
categories: {
recents: 'Recent Emojis',
smileys: 'Smileys & Emotion',
people: 'People & Body',
animals: 'Animals & Nature',
food: 'Food & Drink',
activities: 'Activities',
travel: 'Travel & Places',
objects: 'Objects',
symbols: 'Symbols',
flags: 'Flags',
custom: 'Custom'
},
notFound: 'No emojis found'

Thank you.

@joeattardi
Copy link
Owner

I don't know what DECIDIM but it's just a JSON file, so I guess I don't understand the question?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

7 participants