Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renaming the cities of Ukraine #12

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

rublin
Copy link

@rublin rublin commented Oct 17, 2023

@cleveHEX
Copy link

cleveHEX commented Nov 4, 2023

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

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
Copy link

vshymanskyy commented Mar 21, 2024

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
Copy link

vshymanskyy commented Mar 21, 2024

@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