sugarizer icon indicating copy to clipboard operation
sugarizer copied to clipboard

Country flag doesn't display in ColorMyWorld on Windows

Open llaske opened this issue 10 months ago • 6 comments

On Windows countries flags don't appear in popup when there is a click on the country. The country code is displayed instead.

Image

Works on other OS.

llaske avatar Feb 26 '25 21:02 llaske

Let me work on this issues

the problem lies with the icons in /activities/ColorMyWorld.activity/lib/flag.js

IN WINDOWS

Image

IN LINUX

Image

open up the flag.js in github (browser) in windows you see the country code but in linux its icons

t-aswath avatar Feb 27 '25 06:02 t-aswath

""" Flag emojis often don't work properly on Windows because Microsoft has deliberately chosen not to include support for them in their standard emoji font, meaning that when you try to display a flag emoji, it won't render correctly, usually appearing as the country code letters instead of the visual flag image; this decision is likely due to the complexities of representing all country flags accurately and potentially sensitive political issues surrounding certain flags. """

source: google

t-aswath avatar Feb 27 '25 06:02 t-aswath

My idea on fixing this problem will be to use country images Have a folder /flag which as all the flags and use that to render the flags in the humane.log

Found 2 sources for flags

  1. https://hampusborgos.github.io/country-flags/
  2. https://flagpedia.net/download or share your preferred source

if this fix is ok for you please reply with the source that you prefer i will start to work on it

t-aswath avatar Feb 27 '25 06:02 t-aswath

On Windows countries flags don't appear in popup when there is a click on the country. The country code is displayed instead.

Image

Works on other OS.

There could be 2 solutions:

  1. To fetch the flags online ( Example api : https://flagcdn.com/ )
  2. Another approach using SVG flags instead of emoji flags which will work consistently across all platforms including Windows.

Ig the second approach will be better as it will maintain a consistency on all the platforms the only issue in this approach that i can feel is that this might increase the number of svgs to handle to a greater extent, but if this is fine with you it can be worked upon.

What are you thougts on this @llaske ?

AdityaKrSingh26 avatar Feb 27 '25 09:02 AdityaKrSingh26

I've read this notice regarding the Microsoft decision to not include flag emoji. So we have no choice to use images instead.

Three important things however:

  • Images should use a free/libre/open source licence, it seems to be the case for Flagpedia : https://flagpedia.net/terms
  • Images should be host in the activity. Sugarizer must be able to run without Internet access
  • Images should be small: we don't want to add megabytes of images

llaske avatar Feb 27 '25 20:02 llaske

Noted working on it

t-aswath avatar Feb 27 '25 20:02 t-aswath

Merged in https://github.com/llaske/sugarizer/pull/1758

llaske avatar Mar 10 '25 19:03 llaske