Bug 469196 - Unable to add Ukraine timezone Europe/Kyiv
Summary: Unable to add Ukraine timezone Europe/Kyiv
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Digital Clock widget (other bugs)
Version First Reported In: 5.27.4
Platform: Other Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-04-30 13:34 UTC by Misha Labjuk
Modified: 2023-06-22 02:57 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 5.27.6
Sentry Crash Report:


Attachments
Invalid timezone name. Area and Region are missing. (244.96 KB, image/png)
2023-04-30 13:34 UTC, Misha Labjuk
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Misha Labjuk 2023-04-30 13:34:17 UTC
Created attachment 158569 [details]
Invalid timezone name. Area and Region are missing.

SUMMARY
Timezone Europe/Kyiv can't be added to digital clock. 

STEPS TO REPRODUCE
1.  Open Digital clock settings 
2.  Select Timezones page and press Add button


OBSERVED RESULT
Kyiv missed in the list of time-zones.

If you use "Ukraine" for search you will get  "Most of Ukraine" list element. It is a comment for Europe/Kyiv timezone.
Timezone without label will be added if  "Most of Ukraine" element selected

EXPECTED RESULT
Add Ukraine Europe/Kyiv timezone to clock.

SOFTWARE/OS VERSIONS
Operating System: Gentoo Linux
KDE Plasma Version: 5.27.4
KDE Frameworks Version: 5.104.0
Qt Version: 5.15.9
Kernel Version: 6.2.13-gentoo (64-bit)
Graphics Platform: Wayland

ADDITIONAL INFORMATION
Europe/Kyiv timezone can be selected as system timezone. Digital clock also shows unlabeled timezone in this case.
Comment 1 David Edmundson 2023-04-30 19:32:53 UTC
Timezone defintions are not provided by KDE, but from "zoneinfo"
Comment 2 Misha Labjuk 2023-04-30 22:36:04 UTC
(In reply to David Edmundson from comment #1)
> Timezone defintions are not provided by KDE, but from "zoneinfo"

Issue not with definition. Issue with localization.

Localization generated by  timezonesi18n_generate.rb  script from zoneinfo. 
If city name is missed during generation the name will be dropped at runtime without localization. 
Look!  It is awesome:
https://invent.kde.org/plasma/plasma-workspace/-/blob/master/applets/digital-clock/plugin/timezonesi18n.cpp#L24

I think it is fragile behavior. Not localized city name is much better than empty string. If you don't know how to translate the name better to keep it as is.
Comment 3 Bug Janitor Service 2023-05-01 01:24:31 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/2882
Comment 4 Oleksandr Natalenko 2023-05-16 15:36:18 UTC
Can also confirm this on Arch with 5.27.5.
Comment 5 Nate Graham 2023-05-16 19:13:56 UTC
Git commit 1f494a04c1654c32c9ba059f3331b370b64bae6b by Nate Graham, on behalf of Michael Labiuk.
Committed on 16/05/2023 at 19:13.
Pushed by ngraham into branch 'master'.

applets/digital-clock: Fix localization for TimeZoneModel

Translation for city name works only for names known by plasma-workspace at
build time. List of names generated by script timezonesi18n_generate.rb

If plasma-workspace is outdated and timezone provide new unknown name TimeZoneModel
will replace it by empty string.

Change behavior to ignore translation for unknown names and keep it as is.
FIXED-IN: 5.27.6

M  +11   -3    applets/digital-clock/plugin/timezonesi18n.cpp

https://invent.kde.org/plasma/plasma-workspace/commit/1f494a04c1654c32c9ba059f3331b370b64bae6b
Comment 6 Nate Graham 2023-05-16 19:18:33 UTC
Git commit adc559663bd5ac457b7ebb89857037c2572b5197 by Nate Graham, on behalf of Michael Labiuk.
Committed on 16/05/2023 at 19:18.
Pushed by ngraham into branch 'Plasma/5.27'.

applets/digital-clock: Fix localization for TimeZoneModel

Translation for city name works only for names known by plasma-workspace at
build time. List of names generated by script timezonesi18n_generate.rb

If plasma-workspace is outdated and timezone provide new unknown name TimeZoneModel
will replace it by empty string.

Change behavior to ignore translation for unknown names and keep it as is.
FIXED-IN: 5.27.6


(cherry picked from commit 1f494a04c1654c32c9ba059f3331b370b64bae6b)

M  +11   -3    applets/digital-clock/plugin/timezonesi18n.cpp

https://invent.kde.org/plasma/plasma-workspace/commit/adc559663bd5ac457b7ebb89857037c2572b5197
Comment 7 Brad Cowie 2023-06-22 02:57:07 UTC
I updated the TZ localisation table for the digital clock plugin to match the timezones available in tzdata version 2022g in MR 2518:

https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/2518

This didn't get cherry-picked back into plasma-workspace 5.27 at the time, but perhaps it could be now to additionally help with this issue?