Title: [245688] trunk/Source/WTF
Revision
245688
Author
[email protected]
Date
2019-05-23 09:59:32 -0700 (Thu, 23 May 2019)

Log Message

[PlayStation] Implement platformUserPreferredLanguages.
https://bugs.webkit.org/show_bug.cgi?id=198149

Reviewed by Fujii Hironori.

* wtf/PlatformPlayStation.cmake:
* wtf/playstation/LanguagePlayStation.cpp: Added.
(WTF::platformUserPreferredLanguages):

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (245687 => 245688)


--- trunk/Source/WTF/ChangeLog	2019-05-23 16:53:01 UTC (rev 245687)
+++ trunk/Source/WTF/ChangeLog	2019-05-23 16:59:32 UTC (rev 245688)
@@ -1,3 +1,14 @@
+2019-05-23  Ross Kirsling  <[email protected]>
+
+        [PlayStation] Implement platformUserPreferredLanguages.
+        https://bugs.webkit.org/show_bug.cgi?id=198149
+
+        Reviewed by Fujii Hironori.
+
+        * wtf/PlatformPlayStation.cmake:
+        * wtf/playstation/LanguagePlayStation.cpp: Added.
+        (WTF::platformUserPreferredLanguages):
+
 2019-05-22  Myles C. Maxfield  <[email protected]>
 
         font-optical-sizing applies the wrong variation value

Modified: trunk/Source/WTF/wtf/PlatformPlayStation.cmake (245687 => 245688)


--- trunk/Source/WTF/wtf/PlatformPlayStation.cmake	2019-05-23 16:53:01 UTC (rev 245687)
+++ trunk/Source/WTF/wtf/PlatformPlayStation.cmake	2019-05-23 16:59:32 UTC (rev 245688)
@@ -5,6 +5,7 @@
     generic/RunLoopGeneric.cpp
     generic/WorkQueueGeneric.cpp
 
+    playstation/LanguagePlayStation.cpp
     playstation/UniStdExtrasPlayStation.cpp
 
     posix/FileSystemPOSIX.cpp

Added: trunk/Source/WTF/wtf/playstation/LanguagePlayStation.cpp (0 => 245688)


--- trunk/Source/WTF/wtf/playstation/LanguagePlayStation.cpp	                        (rev 0)
+++ trunk/Source/WTF/wtf/playstation/LanguagePlayStation.cpp	2019-05-23 16:59:32 UTC (rev 245688)
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2019 Sony Interactive Entertainment Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include <wtf/Language.h>
+
+#include <wtf/text/WTFString.h>
+
+namespace WTF {
+
+Vector<String> platformUserPreferredLanguages()
+{
+    Vector<String> languages;
+
+    char buffer[16];
+    if (!getenv_np("SYSTEM_LANGUAGE", buffer, sizeof(buffer)))
+        languages.append(buffer);
+
+    return languages;
+}
+
+} // namespace WTF
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to