[libgweather] timezone: Fix timezone names being empty
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgweather] timezone: Fix timezone names being empty
- Date: Mon, 11 Dec 2017 10:19:17 +0000 (UTC)
commit 40dadbd36e60c7cdf8b383739a64b4a4978dfc11
Author: Bastien Nocera <hadess hadess net>
Date: Mon Dec 11 10:40:55 2017 +0100
timezone: Fix timezone names being empty
1. Launch "test_locations"
2. Enter the name of a city in a country with multiple timezones
3. See that the menu entries are called "(null)" followed by a GMT offset
As we changed the way that the xml file is translated (we look localised
names up at run-time, instead of merging them in one big XML), we
shouldn't have "name" as a tag, but "_name" so the timezone names are
marked for translation.
https://bugzilla.gnome.org/show_bug.cgi?id=791469
data/locations.dtd | 2 +-
libgweather/gweather-timezone.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/data/locations.dtd b/data/locations.dtd
index 02984cb..d1a2c35 100644
--- a/data/locations.dtd
+++ b/data/locations.dtd
@@ -13,7 +13,7 @@
<!ELEMENT named-timezone (%name;, timezones, tz-hint, code)>
<!ELEMENT timezones (timezone+) >
-<!ELEMENT timezone (_name?, name*, obsoletes*) >
+<!ELEMENT timezone (_name?, obsoletes*) >
<!ATTLIST timezone
id CDATA #REQUIRED >
<!ELEMENT obsoletes (#PCDATA) >
diff --git a/libgweather/gweather-timezone.c b/libgweather/gweather-timezone.c
index a513fd9..96d0f9d 100644
--- a/libgweather/gweather-timezone.c
+++ b/libgweather/gweather-timezone.c
@@ -200,7 +200,7 @@ parse_timezone (GWeatherParser *parser)
continue;
}
- if (!strcmp ((const char *) xmlTextReaderConstName (parser->xml), "name"))
+ if (!strcmp ((const char *) xmlTextReaderConstName (parser->xml), "_name"))
name = _gweather_parser_get_localized_value (parser);
else {
if (xmlTextReaderNext (parser->xml) != 1)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]