traccar / traccar-web

Traccar GPS Tracking System
https://www.traccar.org
Apache License 2.0
787 stars 1.09k forks source link

Add country flags to language select #1164

Closed jguthrie100 closed 10 months ago

jguthrie100 commented 10 months ago

I thought it might be nice to include country flags within the language select dropdown..

image

tananaev commented 10 months ago
  1. How do we deal with languages that are used in multiple countries?
  2. Can we use Unicode symbols instead of including another library?
jguthrie100 commented 10 months ago

Sure, I can change it to use emojis/unicode.

For multiple countries, I just used the main country (apart from English, where I used the UK, but could make it USA)

I was thinking of even listing multiple flags for certain languages, but it might look a bit cluttered!

tananaev commented 10 months ago

Yeah, let's do emojis and set the English to the USA flag as the more common.

jguthrie100 commented 10 months ago

Apparently Windows doesn't have support for flag emojis? I don't have windows so I can't check..

https://answers.microsoft.com/en-us/windows/forum/all/flag-emoji/85b163bc-786a-4918-9042-763ccf4b6c05

tananaev commented 10 months ago

It's not working on windows even with a custom font, like roboto?

jguthrie100 commented 10 months ago

My understanding that Microsoft have left all unicode flags out of Windows in order to avoid issues around supporting various countries (i.e. whether to include Palestine/Israel flags etc)

tananaev commented 10 months ago

Can you update the pr and I'll try.

jguthrie100 commented 10 months ago

Have you tested it on Windows? I just heard back from someone that it only shows the unicode letters..

tananaev commented 10 months ago

Doesn't work on Windows, but I've added this check: https://github.com/traccar/traccar-web/commit/c36d1bed4a8781b2307fe2bfcdd1c6d4ddd00d64.

jguthrie100 commented 10 months ago

Is it not worth just including the tiny library so the majority Windows users can see flags too?

tananaev commented 10 months ago

OK, let's do it.