Changeset 214036 in webkit


Ignore:
Timestamp:
Mar 16, 2017 4:55:13 AM (7 years ago)
Author:
Carlos Garcia Campos
Message:

[UNIX] Implement currentSearchLocaleID() and currentTextBreakLocaleID()
https://bugs.webkit.org/show_bug.cgi?id=169745

Reviewed by Yusuke Suzuki.

Add a common implementation for Unix based ports using setlocale.

  • wtf/PlatformGTK.cmake:
  • wtf/PlatformJSCOnly.cmake:
  • wtf/text/gtk/TextBreakIteratorInternalICUGtk.cpp: Removed.
  • wtf/text/unix/TextBreakIteratorInternalICUUnix.cpp: Renamed from Source/WTF/wtf/text/jsconly/TextBreakIteratorInternalICUJSCOnly.cpp.

(WTF::currentSearchLocaleID):
(WTF::currentTextBreakLocaleID):

Location:
trunk/Source/WTF
Files:
1 added
2 deleted
3 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r214035 r214036  
     12017-03-16  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [UNIX] Implement currentSearchLocaleID() and currentTextBreakLocaleID()
     4        https://bugs.webkit.org/show_bug.cgi?id=169745
     5
     6        Reviewed by Yusuke Suzuki.
     7
     8        Add a common implementation for Unix based ports using setlocale.
     9
     10        * wtf/PlatformGTK.cmake:
     11        * wtf/PlatformJSCOnly.cmake:
     12        * wtf/text/gtk/TextBreakIteratorInternalICUGtk.cpp: Removed.
     13        * wtf/text/unix/TextBreakIteratorInternalICUUnix.cpp: Renamed from Source/WTF/wtf/text/jsconly/TextBreakIteratorInternalICUJSCOnly.cpp.
     14        (WTF::currentSearchLocaleID):
     15        (WTF::currentTextBreakLocaleID):
     16
    1172017-03-16  Carlos Garcia Campos  <cgarcia@igalia.com>
    218
  • trunk/Source/WTF/wtf/PlatformGTK.cmake

    r213214 r214036  
    1515    UniStdExtras.cpp
    1616
    17     text/gtk/TextBreakIteratorInternalICUGtk.cpp
     17    text/unix/TextBreakIteratorInternalICUUnix.cpp
    1818)
    1919
  • trunk/Source/WTF/wtf/PlatformJSCOnly.cmake

    r214025 r214036  
    33
    44    generic/WorkQueueGeneric.cpp
     5)
    56
    6     text/jsconly/TextBreakIteratorInternalICUJSCOnly.cpp
    7 )
     7if (WIN32)
     8    list(APPEND WTF_SOURCES
     9        text/win/TextBreakIteratorInternalICUWin.cpp
     10    )
     11else ()
     12    list(APPEND WTF_SOURCES
     13        text/unix/TextBreakIteratorInternalICUUnix.cpp
     14    )
     15endif ()
    816
    917if (LOWERCASE_EVENT_LOOP_TYPE STREQUAL "glib")
  • trunk/Source/WTF/wtf/text/unix/TextBreakIteratorInternalICUUnix.cpp

    r214035 r214036  
    11/*
    2  * Copyright (C) 2007 Alp Toker <alp@atoker.com>
     2 * Copyright (C) 2017 Igalia S.L.
    33 *
    44 * This library is free software; you can redistribute it and/or
     
    2121#include "TextBreakIteratorInternalICU.h"
    2222
     23#include <locale.h>
     24
    2325namespace WTF {
    2426
    2527const char* currentSearchLocaleID()
    2628{
    27     // FIXME: Should use system locale.
     29    if (auto* localeDefault = setlocale(LC_MESSAGES, nullptr))
     30        return localeDefault;
    2831    return "";
    2932}
     
    3134const char* currentTextBreakLocaleID()
    3235{
    33     // FIXME: Should use system locale.
     36    if (auto* localeDefault = setlocale(LC_MESSAGES, nullptr))
     37        return localeDefault;
    3438    return "en_us";
    3539}
Note: See TracChangeset for help on using the changeset viewer.