Skip to content

Commit 1606304

Browse files
author
queenkjuul
committed
Fix Localization
1 parent 6bbaaf5 commit 1606304

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

cinnamon-screensaver.pot

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: PACKAGE VERSION\n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2024-11-21 10:28-0600\n"
11+
"POT-Creation-Date: 2024-11-22 04:11-0600\n"
1212
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language-Team: LANGUAGE <[email protected]>\n"
@@ -104,6 +104,10 @@ msgstr ""
104104
msgid "You have the Caps Lock key on."
105105
msgstr ""
106106

107+
#: src/weather.py:102
108+
msgid "in"
109+
msgstr ""
110+
107111
#. This is the first line of text for the backup-locker, explaining how to switch to tty
108112
#. and run 'cinnamon-unlock-desktop' command. This appears if the screensaver crashes.
109113
#: backup-locker/cs-backup-locker.c:306

src/util/openweathermap.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,12 @@ def __init__(self):
9090

9191
def GetWeather(self, loc: LocationData):
9292
lang = self.locale_to_owm_lang(Pango.language_get_default().to_string())
93-
pref = Pango.language_get_preferred()
93+
pref = list(
94+
map(
95+
lambda p: self.locale_to_owm_lang(p.to_string()),
96+
Pango.language_get_preferred(),
97+
)
98+
)
9499
if lang not in OWM_SUPPORTED_LANGS:
95100
for locale in pref:
96101
if self.locale_to_owm_lang(locale) in OWM_SUPPORTED_LANGS:

src/weather.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,18 @@ def update_weather(self):
9999

100100
weather_data = self.weather_provider.GetWeather(self.location)
101101

102+
in_str = " " + _("in") + " "
103+
102104
temp = (
103105
weather_data.temp_f()
104106
if settings.get_weather_units() == "imperial"
105107
else weather_data.temp_c()
106108
)
107109
temp_string = str(round(temp))
108110
default_message = (
109-
weather_data.condition.main + " in " + weather_data.location.city
111+
weather_data.condition.description.title()
112+
+ in_str
113+
+ weather_data.location.city.capitalize()
110114
)
111115

112116
markup = '<b><span font_desc="%s" foreground="#CCCCCC">%s</span></b>\n ' % (

0 commit comments

Comments
 (0)