summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Lundblad <ml@update.uu.se>2021-01-30 23:14:17 +0100
committerMarcus Lundblad <ml@update.uu.se>2021-02-09 21:58:24 +0100
commitfeebfa1e90df0fd6a97ce63119db16255f351601 (patch)
tree5f72165181b28476954536f3bf11abe430b1c99e
parentbba4760a1eb170633dad0deb6181dd48151cf1a9 (diff)
downloadgnome-maps-wip/mlundblad/capitalize-opening-hours.tar.gz
translations: Upper case first character of day intervalwip/mlundblad/capitalize-opening-hours
Upper case the first character of day interval for opening hours. This makes sure the first character in each row in the opeing hours table is upper case even in languages where day names are not generally "proper noun"-cased when just embedded inside a string.
-rw-r--r--src/translations.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/translations.js b/src/translations.js
index 732b55a9..be16f0d4 100644
--- a/src/translations.js
+++ b/src/translations.js
@@ -25,6 +25,7 @@ const C_ = imports.gettext.dgettext;
const GLib = imports.gi.GLib;
const Time = imports.time;
+const Utils = imports.utils;
/* Translate an opening time specification tag value.
* from OSM into a "two-dimensional" (array-of-arrays) grid of human-readable
@@ -80,7 +81,8 @@ function _translateOpeningHoursPart(string) {
let timeIntervalSpec =
_translateOpeningHoursTimeIntervalList(splitString[1].trim());
- return [dayIntervalSpec, timeIntervalSpec];
+ return [Utils.firstToLocaleUpperCase(dayIntervalSpec),
+ timeIntervalSpec];
} else {
// for an unknown format, just output the raw value
return [string];