expo / vector-icons

https://icons.expo.fyi
MIT License
647 stars 114 forks source link

[Web] Issues when using Google Translate #293

Open pepyta opened 3 months ago

pepyta commented 3 months ago

Description

Some of our users reported an issue where the icons randomly turned into emojis after translating the site with Google Translate from English to Hungarian.

Possible solution

Adding notranslate to every icons' classlist would solve the issue, but I think that this should be addressed on the library level.

Screenshots

Original icons After Google Translate
Képernyőfotó 2024-03-14 - 8 59 12 Képernyőfotó 2024-03-14 - 8 59 20

Example code

import Icon from "@expo/vector-icons/MaterialCommunityIcons";

const HomeScreen = () => {
    return (
        <Icon
            name={"campfire"}
        />
    );
};

export default HomeScreen;

HTML output (before Google Translate)

<div dir="auto" class="css-text-146c3p1 r-userSelect-lrvibr" style="font-size: 24px; color: rgb(0, 0, 0); font-family: material-community; font-weight: normal; font-style: normal;">󰖙</div>

HTML output (after Google Translate)

<div dir="auto" class="css-text-146c3p1 r-userSelect-lrvibr" style="font-size: 24px; color: rgb(0, 0, 0); font-family: material-community; font-weight: normal; font-style: normal;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">💖</font></font></div>