jamulus icon indicating copy to clipboard operation
jamulus copied to clipboard

CLI --serverinfo: Add named country support in addition to Qt Country IDs

Open hoffie opened this issue 2 years ago • 2 comments

Currently, --serverinfo requires users to specify Qt Country IDs. This is not user-friendly. With Qt6, --serverinfo will require users to specify Qt5 Country IDs, even if they are on Qt6. This is really not user-friendly.

Has this feature been discussed and generally agreed?

The ugliness of the status quo, especially when adding support for Qt6, has been officially stated by @pljones here: https://github.com/jamulussoftware/jamulus/pull/2299#pullrequestreview-876366907 :)

Describe the solution you'd like

--serverinfo should support named countries, e.g. --serverinfo 'FooServer;FooCity;FooCountry We should still keep support for the numerical IDs for compatibility.

hoffie avatar Feb 08 '22 21:02 hoffie

The current Locale -> Country letter method could possibly be used in reverse: take a two letter country code (de or zw), then look up the Locale based on the language (EN-us, DE-de, etc) to get the Qt Locale and hence the related country code for the "current" Qt. Then magic mapping gets that into the wire format, as per #2299.

If I've understood it correctly. I could be wrong...

pljones avatar Feb 08 '22 22:02 pljones

--serverinfo should support named countries, e.g. --serverinfo 'FooServer;FooCity;FooCountry We should still keep support for the numerical IDs for compatibility.

For FooCountry, I think we should use the international standard abbreviations, rather than names, as defined in ISO-3316. Either the 2-letter or 3-letter variants (we could accept both). It then becomes independent of language, which could complicate things if we tried to interpret country names (e.g. Germany/Deutschland/Allemagne, Holland/Netherlands/Nederland, Belgium/Belgien/Belgie)

softins avatar Feb 08 '22 23:02 softins

After updating to 3.9.0 and Qt6, the country of my server changed without any changes to the config, apparently it is using Qt6 Country IDs now. I fixed it by updating to the new code in this list: https://doc.qt.io/qt-6/qlocale.html#Country-enum

Agree it would be more user friendly to specify country names/codes.

acerix avatar Aug 25 '22 22:08 acerix

After updating to 3.9.0 and Qt6, the country of my server changed without any changes to the config, apparently it is using Qt6 Country IDs now.

Thanks for the report! This is unintended. I've opened #2809 to investigate this with rather high priority as it would be a regression.

hoffie avatar Aug 26 '22 07:08 hoffie

I've prepared a branch which adds support for two-letter ISO country codes here: hoffie@serverinfo-two-letter-country-codes

Will submit after #2829 is merged as the branch is based on that PR.

hoffie avatar Aug 30 '22 21:08 hoffie