[UI] Multiple issues with Location filtering in Search #3847

Closed
opened 2026-02-05 09:19:51 +03:00 by OVERLORD · 13 comments
Owner

Originally created by @null-von-sushi on GitHub (Jul 10, 2024).

The bug

The issues

  1. When searching, the option to search by Country, State and and City is available. I am assuming this was designed to be USA-centric and follows America's definition of State, however it can be rather confusing elsewhere in the world.
    It almost looks like it means county, prefecture or province elsewhere as I get Taiwan and Kyoto in there as well, however it then stops making sense because it also shows Wales and England which are not provinces, states or anything else else, they are just countries. As for Taiwan, while Taiwan is officially a Province of the Republic of China, Taipei is not a province (assuming State should mean province or prefecture for Asian countries?).

  2. Additionally, Taiwan (officially the Republic of China, not to be confused with the People's Republic of China) is erroneously listed as 'Taiwan, Province of China' under 'Countries´. This is ambiguous at best but is more likely to come across as politically insensitive and insulting. I assume the currently phrasing is just the result of using a UN list of countries which unfortunately is not accurate due to political pressure from China. Feel free to look up the situation yourself, but the tl;dr is it's kinda like North and South Korea.).

Proposed solutions

Regarding point 1, I am genuinely not sure how to fix it as the issue is basically that different countries are split up differently, and that 1-size-fits-all does not work. I recommend only showing state if the country actually has useful subdivisions, and if so I would have the field 'State' renamed depending on the country.
I.e. USA shows state. I assume it works as intended for you.
If Selecting United Kingdom, it seems to show the other countries that make up the UK, so I would show state but have it labelled 'Specific country' or something like that. For Japan show it but have the label 'Prefecture'. etc.
Or just call it 'Region' for all countries. Technically that's ambiguous and would fit all countries I believe.

For point 2, the country listing should be updated to either be Taiwan or Republic of China (Taiwan) Taiwan (ROC), depending on how formal you want it to be. IF you call the USA 'America', then just having 'Taiwan' would be fine. If you have it listed as 'United States of America', I would recommend one of the two latter options. Personally I would have it as Taiwan (ROC) as would help people who are searching the list for a word starting with 'T'.

The OS that Immich Server is running on

TrueNAS

Version of Immich Server

v1.107.2

Version of Immich Mobile App

N/A

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

N/A

Your .env content

N/A

Reproduction steps

0. Ensure your immich instance has photos with exif data from outside the USA (such as Wales, England, Japan), as well as one from Taiwan.
1. Open the website of your immich instance
2. Click the settings icon next to the searchbar
3. Observe the mismatch between location name and the label 'State' when looking through the different options in 'State'.
4. Observe the issue in the name of Taiwan when looking at the list of countries.

Relevant log output

No response

Additional information

No response

Originally created by @null-von-sushi on GitHub (Jul 10, 2024). ### The bug # The issues 1) When searching, the option to search by Country, State and and City is available. I am assuming this was designed to be USA-centric and follows America's definition of State, however it can be rather confusing elsewhere in the world. It _almost_ looks like it means county, prefecture or province elsewhere as I get Taiwan and Kyoto in there as well, however it then stops making sense because it also shows Wales and England which are not provinces, states or anything else else, they are just countries. As for Taiwan, while Taiwan is officially a Province of the _Republic of China_, Taipei is not a province (assuming State should mean province or prefecture for Asian countries?). 2) Additionally, Taiwan (officially the Republic of China, not to be confused with the _People's Republic of China_) is erroneously listed as 'Taiwan, Province of China' under 'Countries´. This is ambiguous at best but is more likely to come across as politically insensitive and insulting. I assume the currently phrasing is just the result of using a UN list of countries which unfortunately is not accurate due to political pressure from China. Feel free to look up the situation yourself, but the tl;dr is it's kinda like North and South Korea.). # Proposed solutions Regarding point 1, I am genuinely not sure how to fix it as the issue is basically that different countries are split up differently, and that 1-size-fits-all does not work. I recommend only showing state if the country actually has useful subdivisions, and if so I would have the field 'State' renamed depending on the country. I.e. USA shows state. I assume it works as intended for you. If Selecting United Kingdom, it seems to show the other countries that make up the UK, so I would show state but have it labelled 'Specific country' or something like that. For Japan show it but have the label 'Prefecture'. etc. Or just call it 'Region' for all countries. Technically that's ambiguous and would fit all countries I believe. For point 2, the country listing should be updated to either be `Taiwan` or `Republic of China (Taiwan)` `Taiwan (ROC)`, depending on how formal you want it to be. IF you call the USA 'America', then just having 'Taiwan' would be fine. If you have it listed as 'United States of America', I would recommend one of the two latter options. Personally I would have it as `Taiwan (ROC)` as would help people who are searching the list for a word starting with 'T'. ### The OS that Immich Server is running on TrueNAS ### Version of Immich Server v1.107.2 ### Version of Immich Mobile App N/A ### Platform with the issue - [X] Server - [X] Web - [ ] Mobile ### Your docker-compose.yml content ```YAML N/A ``` ### Your .env content ```Shell N/A ``` ### Reproduction steps ```bash 0. Ensure your immich instance has photos with exif data from outside the USA (such as Wales, England, Japan), as well as one from Taiwan. 1. Open the website of your immich instance 2. Click the settings icon next to the searchbar 3. Observe the mismatch between location name and the label 'State' when looking through the different options in 'State'. 4. Observe the issue in the name of Taiwan when looking at the list of countries. ``` ### Relevant log output _No response_ ### Additional information _No response_
Author
Owner

@pyccl commented on GitHub (Aug 10, 2024):

Taiwan has always been a province of the People's Republic of China. There is no Republic of China and the United Nations does not recognize the Republic of China. So Taiwan can only appear in the province option of the People's Republic of China.

@pyccl commented on GitHub (Aug 10, 2024): Taiwan has always been a province of the People's Republic of China. There is no Republic of China and the United Nations does not recognize the Republic of China. So Taiwan can only appear in the province option of the People's Republic of China.
Author
Owner

@mertalev commented on GitHub (Aug 10, 2024):

Re: State boundaries and provincial boundaries, this is something we've struggled with. The boundaries in the data sources are generic (admin1, admin2, etc.) and a one-size-fits-all approach is tough when countries differ in how they organize administrative regions. We're open to suggestions on how to best approach filtering this. One thought I had was to have a single box for location, but have the dropdown present results from a mix of wider and more specific areas (without labeling them per se).

Re: Taiwan, we don't have a special treatment for it or any other location. We just use whatever comes from the data sources.

As for the data, the geodata is currently sourced from GeoNames (cities500.zip, admin1CodesASCII.txt, admin2Codes.txt) with a fallback to country boundaries with Natural Earth (Admin 0 – Countries). There's work toward changing how reverse geocoding works entirely, though, which will involve different data sources.

@mertalev commented on GitHub (Aug 10, 2024): Re: State boundaries and provincial boundaries, this is something we've struggled with. The boundaries in the data sources are generic (admin1, admin2, etc.) and a one-size-fits-all approach is tough when countries differ in how they organize administrative regions. We're open to suggestions on how to best approach filtering this. One thought I had was to have a single box for location, but have the dropdown present results from a mix of wider and more specific areas (without labeling them per se). Re: Taiwan, we don't have a special treatment for it or any other location. We just use whatever comes from the data sources. As for the data, the geodata is currently sourced from [GeoNames](https://download.geonames.org/export/dump) (`cities500.zip`, `admin1CodesASCII.txt`, `admin2Codes.txt`) with a fallback to country boundaries with [Natural Earth](https://www.naturalearthdata.com/downloads/10m-cultural-vectors/) (Admin 0 – Countries). There's work toward changing how reverse geocoding works entirely, though, which will involve different data sources.
Author
Owner

@null-von-sushi commented on GitHub (Aug 10, 2024):

Taiwan has always been a province of the People's Republic of China.

Please do not spread misinformation. The People's Republic of China has never controlled Taiwan.

There is no Republic of China

There is, it's the government of Taiwan, Kinmen, Penghu and the Matsu Islands.

and the United Nations does not recognize the Republic of China.

The United Nations is a political entity, and does not necessarily represent the reality on the ground. If you live in Paraguay, Tuvalu, Guatemala or even in Vatican City, does the People's Republic of China stop existing? (These countries have chosen to keep diplomatic recognition of Taiwan).

So Taiwan can only appear in the province option of the People's Republic of China.

This name is only used by the People's Republic of China and their propaganda, and does not represent the people of Taiwan, Kinmen, Matsu etc.

Countries should be labelled according to the reality on the ground, not wishful thinking of a certain people. You wouldn't have "America, colony of His Majesty the King" or something.

Now, regarding the data source, maybe I'm misunderstanding something, but it looks like it should be Taiwan, Republic of China for English too? Other entries for English include Taiwan R.O.C. and Taiwan ROC. There is an entry for Taiwan, Province of China, however it doesn't have a language tag associated with it. This is looking at the website. Looking at the zip files, all of them don't have any reference to "Province of China", however just Taiwan is found in admin1CodesASCII.txt.
Meanwhile, the Natural Earth sources I'll admit I'm not sure how to check, sorry, but looking at this post by them, they claim to show the defacto (reality) rather than dejure (what some laws say something technically should be), so unless you're using one of the versions they maintain that cater to a particular government's Point of View, Taiwan should also not appear as "Province of China" here?

Normally open source projects, like Open Street Map for example, will aim for defefacto instead of dejure, so how this situation in Immich came about without someone actively trying to use the wrong name, I have no idea...

@null-von-sushi commented on GitHub (Aug 10, 2024): > Taiwan has always been a province of the People's Republic of China. Please do not spread misinformation. The People's Republic of China has never controlled Taiwan. > There is no Republic of China There is, it's the government of Taiwan, Kinmen, Penghu and the Matsu Islands. > and the United Nations does not recognize the Republic of China. The United Nations is a political entity, and does not necessarily represent the reality on the ground. If you live in Paraguay, Tuvalu, Guatemala or even in Vatican City, does the People's Republic of China stop existing? (These countries have chosen to keep diplomatic recognition of Taiwan). > So Taiwan can only appear in the province option of the People's Republic of China. This name is only used by the People's Republic of China and their propaganda, and does not represent the people of Taiwan, Kinmen, Matsu etc. Countries should be labelled according to the reality on the ground, not wishful thinking of a certain people. You wouldn't have "America, colony of His Majesty the King" or something. Now, regarding the data source, maybe I'm misunderstanding something, but it looks like it should be `Taiwan, Republic of China` for English too? Other entries for English include `Taiwan R.O.C.` and `Taiwan ROC`. There is an entry for `Taiwan, Province of China`, however it doesn't have a language tag associated with it. This is looking at the website. Looking at the zip files, all of them don't have any reference to "Province of China", however just `Taiwan` is found in `admin1CodesASCII.txt`. Meanwhile, the Natural Earth sources I'll admit I'm not sure how to check, sorry, but looking at this [post by them]( https://www.naturalearthdata.com/about/disputed-boundaries-policy/), they claim to show the defacto (reality) rather than dejure (what some laws say something technically should be), so unless you're using one of the versions they maintain that cater to a particular government's Point of View, Taiwan should also not appear as "Province of China" here? Normally open source projects, like Open Street Map for example, will aim for defefacto instead of dejure, so how this situation in Immich came about without someone actively trying to use the wrong name, I have no idea...
Author
Owner

@alextran1502 commented on GitHub (Aug 10, 2024):

I think this issue comes up with all project that deals with geocoding information. My stands for Immich is that we use the widely used public dataset and I am not looking into wrangling that data. If there are improvements that can be made, please reach out to the public dataset maintainer

@alextran1502 commented on GitHub (Aug 10, 2024): I think this issue comes up with all project that deals with geocoding information. My stands for Immich is that we use the widely used public dataset and I am not looking into wrangling that data. If there are improvements that can be made, please reach out to the public dataset maintainer
Author
Owner

@null-von-sushi commented on GitHub (Sep 11, 2024):

@alextran1502 Can you please provide information on where exactly this data is being pulled from?
I have previously tried to look through those files and could not find that string.
Now I have switched to using the docker, and from what I can find the geocoding files you mentioned can be found in /build/geodata however even then I still cannot find that string. In case I simply am failing to search (they are rather large files after all), I tried deleting the files and restarting immich, however immich still displays the problematic string.

Please could you share with me what file is responsible for this?

@null-von-sushi commented on GitHub (Sep 11, 2024): @alextran1502 Can you please provide information on where exactly this data is being pulled from? I have previously tried to look through those files and could not find that string. Now I have switched to using the docker, and from what I can find the geocoding files you mentioned can be found in `/build/geodata` however even then I still cannot find that string. In case I simply am failing to search (they are rather large files after all), I tried deleting the files and restarting immich, however immich still displays the problematic string. Please could you share with me what file is responsible for this?
Author
Owner

@alextran1502 commented on GitHub (Sep 11, 2024):

@null-von-sushi Here you go https://download.geonames.org/export/dump/

@alextran1502 commented on GitHub (Sep 11, 2024): @null-von-sushi Here you go https://download.geonames.org/export/dump/
Author
Owner

@null-von-sushi commented on GitHub (Sep 11, 2024):

I already checked the GeoNames files previously, and tried deleting them to no avail. The old strings still show...

I did a grep through the while docker container overnight and it only found /usr/src/app/node_modules/i18n-iso-countries but even after changing that and restarting the container it still shows up as the old string.

I wanted to check what the string was in other languages because more often than not only English and Mandarin will use the propaganda terms however changing the language to Czech had absolutely no impact on the location field; it seems to show the location in English no matter what.

So I am giving up. I am documenting this so that maybe someone else in the future can figure this out, but I am just gonna use PhotoPrism for now. Trying to fix this is too tiring ...

@null-von-sushi commented on GitHub (Sep 11, 2024): I already checked the GeoNames files previously, and tried deleting them to no avail. The old strings still show... I did a grep through the while docker container overnight and it only found `/usr/src/app/node_modules/i18n-iso-countries` but even after changing that and restarting the container it *still* shows up as the old string. I wanted to check what the string was in other languages because more often than not only English and Mandarin will use the propaganda terms however changing the language to Czech had absolutely no impact on the location field; it seems to show the location in English no matter what. So I am giving up. I am documenting this so that maybe someone else in the future can figure this out, but I am just gonna use PhotoPrism for now. Trying to fix this is too tiring ...
Author
Owner

@bo0tzz commented on GitHub (Sep 12, 2024):

Did you rerun metadata extraction after changing that file?

@bo0tzz commented on GitHub (Sep 12, 2024): Did you rerun metadata extraction after changing that file?
Author
Owner

@null-von-sushi commented on GitHub (Sep 12, 2024):

Did you rerun metadata extraction after changing that file?

Okay, that actually did work. Thank you so much.

Interestingly, outside of this issue, I guess users who originally install in English (as that is the default internet language), but then later decide to switch language for whatever reason, will also have to manually rerun 'extract metadata' in settings. Probably not the best UX, but I guess the amount of people who might switch isn't that high to begin with.

Either way, rerunning the job makes the new strings show up. Thank you very much again 🙏

@null-von-sushi commented on GitHub (Sep 12, 2024): > Did you rerun metadata extraction after changing that file? Okay, that actually did work. Thank you so much. Interestingly, outside of this issue, I guess users who originally install in English (as that is the default internet language), but then later decide to switch language for whatever reason, will also have to manually rerun 'extract metadata' in settings. Probably not the best UX, but I guess the amount of people who might switch isn't that high to begin with. Either way, rerunning the job makes the new strings show up. Thank you very much again :pray:
Author
Owner

@trftky commented on GitHub (Nov 21, 2024):

@null-von-sushi I use docker and have the same issue with you.

Can you show the exact steps you fix this "Province of China" issue?

@trftky commented on GitHub (Nov 21, 2024): @null-von-sushi I use docker and have the same issue with you. Can you show the exact steps you fix this "Province of China" issue?
Author
Owner

@null-von-sushi commented on GitHub (Nov 22, 2024):

@null-von-sushi I use docker and have the same issue with you.

Can you show the exact steps you fix this "Province of China" issue?

Sure. Hope this helps:

I don't use docker directly, so I am not sure what the exact commands for docker's CLI tools are.

  • First, find the immich-server container, and from within it copy /usr/src/app/node_modules/i18n-iso-countries/langs to a safe place on your Host PC (NOT inside the docker container!) This folder will need to be kept safe, and you cannot move it so chose a good place where it won´t bother you. For this example, I will assume you moved it to /docker-immich-langs/.
    So, assuming you used the same path, /docker-immich-langs/ should contain a bunch of JSON files. Each file corresponds to a language for the UI. So if you wanna change the name of a country, as it's called in English edit en.json and edit it to what you want. Careful not to break JSON formatting. English also has a second value that already says 'Taiwan', but for whatever reason it's not used. Just edit the first one to match what you want.
    image
    If you wanna edit Mandarin, you can edit zh.json (there's no seperate file for normal and simplified, everything seems to be in simplified? Anyway, Just search for TW and you'll find the right entry. You can also change the simplified text here if you want, while you're at it 🤷‍♂️
    image

  • Anyway, once you're done editing, save and find your immich-server in docker and edit the Volume mapping to bind mount /usr/src/app/node_modules/i18n-iso-countries/langs in the container to /docker-immich-langs/. Restart docker after.

  • Now, you open immich on your web browser, go to the Administration settings, go to Jobs in the sidebar and finally click 'all' on the Exctract Metadata job.
    image
    After this is done, your images should show the right location on your photos~
    image

@null-von-sushi commented on GitHub (Nov 22, 2024): > @null-von-sushi I use docker and have the same issue with you. > > Can you show the exact steps you fix this "Province of China" issue? Sure. Hope this helps: I don't use docker directly, so I am not sure what the exact commands for docker's `CLI` tools are. - First, find the `immich-server` container, and from within it copy `/usr/src/app/node_modules/i18n-iso-countries/langs` to a safe place on your Host PC (_NOT inside the docker container!_) This folder will need to be kept safe, and you cannot move it so chose a good place where it won´t bother you. For this example, I will assume you moved it to `/docker-immich-langs/`. So, assuming you used the same path, `/docker-immich-langs/` should contain a bunch of JSON files. Each file corresponds to a language for the UI. So if you wanna change the name of a country, as it's called in English edit `en.json` and edit it to what you want. Careful not to break JSON formatting. English also has a second value that already says 'Taiwan', but for whatever reason it's not used. Just edit the first one to match what you want. ![image](https://github.com/user-attachments/assets/e572f01d-937f-4f9d-91c4-7d2fb6239686) If you wanna edit Mandarin, you can edit `zh.json` (there's no seperate file for normal and simplified, everything seems to be in simplified? Anyway, Just search for `TW` and you'll find the right entry. You can also change the simplified text here if you want, while you're at it :man_shrugging: ![image](https://github.com/user-attachments/assets/51937309-f432-4c4c-aa21-6975784d7237) - Anyway, once you're done editing, save and find your `immich-server` in docker and edit the _Volume mapping_ to _bind mount_ `/usr/src/app/node_modules/i18n-iso-countries/langs` in the container to `/docker-immich-langs/`. Restart docker after. - Now, you open immich on your web browser, go to the Administration settings, go to Jobs in the sidebar and finally click 'all' on the Exctract Metadata job. ![image](https://github.com/user-attachments/assets/dc694086-05e5-454b-8b58-2a86eca14547) After this is done, your images should show the right location on your photos~ ![image](https://github.com/user-attachments/assets/6ee700e6-5f6c-4357-a465-94e5a134dfef)
Author
Owner

@trftky commented on GitHub (Nov 23, 2024):

@null-von-sushi, your instruction is pefect!
"Province of China" has replaced by "Taiwan (ROC)" now. Thanks for your help.

However, I am wondering why the location information is still in English, even though I had changed the Language and Region to Chinese(Taiwan) in Settings.

@trftky commented on GitHub (Nov 23, 2024): @null-von-sushi, your instruction is pefect! "Province of China" has replaced by "Taiwan (ROC)" now. Thanks for your help. However, I am wondering why the location information is still in English, even though I had changed the Language and Region to Chinese(Taiwan) in Settings.
Author
Owner

@null-von-sushi commented on GitHub (Nov 23, 2024):

Hmmm, I think the way it works is: the metadata scan uses the language you set at the time. So if you did everything in English, then switched to Mandarin in settings after, it'll still show English? I'm not at home so can't test, but try rerunning the metadata job after changing the language

@null-von-sushi commented on GitHub (Nov 23, 2024): Hmmm, I think the way it works is: the metadata scan uses the language you set at the time. So if you did everything in English, then switched to Mandarin in settings after, it'll still show English? I'm not at home so can't test, but try rerunning the metadata job after changing the language
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#3847