kdelibs/kdelibs-4.8.4-kjs-locale.patch
2012-07-12 14:38:19 +02:00

19 lines
785 B
Diff

diff -up kdelibs-4.8.4/khtml/ecma/kjs_navigator.cpp.me kdelibs-4.8.4/khtml/ecma/kjs_navigator.cpp
--- kdelibs-4.8.4/khtml/ecma/kjs_navigator.cpp.me 2012-06-06 22:49:52.542044112 +0200
+++ kdelibs-4.8.4/khtml/ecma/kjs_navigator.cpp 2012-07-12 11:52:50.973049316 +0200
@@ -261,7 +261,13 @@ JSValue *Navigator::getValueProperty(Exe
case BrowserLanguage:
case Language:
case UserLanguage:
- return jsString(KGlobal::locale()->language());
+ {
+ QString l = KGlobal::locale()->language();
+ if ( l.contains(QLatin1Char('_')) )
+ return jsString(l.replace(QLatin1Char('_'), QLatin1Char('-')));
+ else
+ return jsString(l + QLatin1Char('-') + KGlobal::locale()->country().toUpper());
+ }
case UserAgent:
return jsString(userAgent);
case Platform: