Red Mak Red Mak - 2 months ago 29
iOS Question

ios: localize emoji name (kCFStringTransformToUnicodeName)

i have an app that will display some emojis and the correspondent name.
i'm using kCFStringTransformToUnicodeName to get the name.
but i want to localize the name like macOS, as you can see in the attached picture, macOS localize "Grinning Face" to "visage avec large sourire".

could you tell me how to localize these names and if there's no API, where can i found the localization files used by macOS.
thank you.

enter image description here

Answer

There is no api for this job. Unicode character name is standardized only in English.

The macOS use localization files to achieve this.

You can find the location of The CharacterPalette app:

  1. Option+click on the  Apple menu and choose ‘System Information’ (called ‘System Profiler’ in earlier releases of OS X).

  2. From the side menu, look under ‘Software’ and choose “Applications”

My app's location looks like this:

enter image description here

Locate the CharacterPalette.app,right click -> show package,you can find the localization files :

enter image description here

But I can't open it correctly , the file is full of unreadable code.Maybe it's encrypted.

You may have to copy paste the names one by one.

Comments