Handle C locale.

Fixes:
JS ERROR: RangeError: invalid language tag: C
formatTemperature@/home/phil/.local/share/gnome-shell/extensions/openweather-extension@jenslody.de/extension.js:1343:16
wrapper@resource:///org/gnome/gjs/modules/_legacy.js:82:22
parseWeatherCurrent@/home/phil/.local/share/gnome-shell/extensions/openweather-extension@jenslody.de/openweathermap_org.js:319:23
_asyncReadyCallback@/home/phil/.local/share/gnome-shell/extensions/openweather-extension@jenslody.de/extension.js:553:13
wrapper@resource:///org/gnome/gjs/modules/_legacy.js:82:22
merge-requests/228/head
Philippe Troin 6 years ago
parent 7ea4ce7a12
commit c24218f4f7
  1. 4
      src/extension.js

@ -155,7 +155,9 @@ const OpenweatherMenuButton = new Lang.Class({
// Get locale, needed for toLocaleString, workaround for gnome-shell 3.24
this.locale = GLib.get_language_names()[0];
if (this.locale.indexOf('_') != -1)
if (this.locale == 'C')
this.locale = 'en';
else if (this.locale.indexOf('_') != -1)
this.locale = this.locale.split("_")[0];
// Create user-agent string from uuid and (if present) the version

Loading…
Cancel
Save