Use locale when no argument is provided #6

Open
opened 2025-03-08 17:47:14 -05:00 by jcubic · 3 comments
jcubic commented 2025-03-08 17:47:14 -05:00 (Migrated from github.com)

I expected that it will show my country based on locale.

My locale is:

pl_PL.utf8

The second value is the country, like in en_GB for UK (probably from Great Britain).

The list of countries from ISO 3166-1 can be found on Wikipedia.

PS: This tool is super cool. Thanks for creating it.

I expected that it will show my country based on locale. My locale is: pl_PL.utf8 The second value is the country, like in en_GB for UK (probably from Great Britain). The list of countries from ISO 3166-1 can be found on [Wikipedia](https://en.wikipedia.org/wiki/ISO_3166-1#Naming_and_code_construction). PS: This tool is super cool. Thanks for creating it.
nik-rev commented 2025-03-08 17:58:16 -05:00 (Migrated from github.com)

Using locale as a fallback when there is no internet connection or when it takes too long to make a network requset sounds like a concept we can explore

If your locale is different than your country, then the result will be inaccurate though

Are you suggesting displaying 2 flags? 1 for the locale 1 for the country (if they are different)

Using locale as a fallback when there is no internet connection or when it takes too long to make a network requset sounds like a concept we can explore If your locale is different than your country, then the result will be inaccurate though Are you suggesting displaying 2 flags? 1 for the locale 1 for the country (if they are different)
jcubic commented 2025-03-08 19:39:30 -05:00 (Migrated from github.com)

I'm suggesting to display locale flag when no argument provided, when argument is provided I expect to see the flag from argument.

Right now when there are no argument it throws:

Error: reqwest::Error { kind: Decode, source: Error("missing field `continent`", line: 1, column: 67) }
I'm suggesting to display locale flag when no argument provided, when argument is provided I expect to see the flag from argument. Right now when there are no argument it throws: ``` Error: reqwest::Error { kind: Decode, source: Error("missing field `continent`", line: 1, column: 67) } ```
nik-rev commented 2025-03-08 20:49:31 -05:00 (Migrated from github.com)

I'm suggesting to display locale flag when no argument provided, when argument is provided I expect to see the flag from argument.

Right now when there are no argument it throws:

Error: reqwest::Error { kind: Decode, source: Error("missing field `continent`", line: 1, column: 67) }

Yeah this is odd, because what actually happens when no argument is supplied (or is supposed to) is that your location is determined from your public IP and that is fetched from an API

But yes, I will make it so that it uses the locale if we can't get the information about the country and there is some sort of error

> I'm suggesting to display locale flag when no argument provided, when argument is provided I expect to see the flag from argument. > > Right now when there are no argument it throws: > > ``` > Error: reqwest::Error { kind: Decode, source: Error("missing field `continent`", line: 1, column: 67) } > ``` Yeah this is odd, because what actually happens when no argument is supplied (or is supposed to) is that your location is determined from your public IP and that is fetched from an API But yes, I will make it so that it uses the locale if we can't get the information about the country and there is some sort of error
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nik-rev/countryfetch#6
No description provided.