Skip to content

Renaming the cities of Ukraine #12

Open
rublin wants to merge 3 commits into
nayarsystems:masterfrom
rublin:master
Open

Renaming the cities of Ukraine #12
rublin wants to merge 3 commits into
nayarsystems:masterfrom
rublin:master

Conversation

@rublin

@rublin rublin commented Oct 17, 2023

Copy link
Copy Markdown

@cleveHEX

cleveHEX commented Nov 4, 2023

Copy link
Copy Markdown

I believe this is not a correct place for this, the script uses /usr/share/zoneinfo, which belongs to https://www.iana.org/time-zones. I think any changes there would be overwritten.

Edit: I also believe this change is never going to happen, as this would break all existing users, as programs depend on names.

@vshymanskyy

Copy link
Copy Markdown

No, the list of names is hard-coded in gen-tz.py.
Besides that, stating that Europe/Simferopol is MSK-3 is basically neglecting the international law.

@vshymanskyy

vshymanskyy commented Mar 21, 2024

Copy link
Copy Markdown

Instead of hard-coding the list of timezones, one could just do:

import os
import glob
import natsort

ZONES_DIR = "/usr/share/zoneinfo/"

def zone_info_filter(zones):
    return [f for f in zones if (
        os.path.isfile(ZONES_DIR + f) and
        not os.path.islink(ZONES_DIR + f) and
        not f.startswith("right")
    )]

ZONES = glob.glob("*/**", root_dir=ZONES_DIR, recursive=True)
ZONES = zone_info_filter(ZONES)
# Sort naturally
ZONES = natsort.realsorted(ZONES)
# Move Etc down
ZONES.sort(key=lambda x: x.startswith("Etc/"))

You'll notice that:

  • "Kiev" gets replaced with "Kyiv"
  • " Zaporozhye" and "Simferopol" are completely removed
  • Among some other subtle changes

It basically means that the timezone files included in this repository are rather outdated

@vshymanskyy

vshymanskyy commented Mar 21, 2024

Copy link
Copy Markdown

@nayarsystems what do you think?

Here's the relevant PR: #13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants