RESOLVED FIXED Bug 131435
[EFL][WK2] Add API to set preferred languages
https://bugs.webkit.org/show_bug.cgi?id=131435
Summary [EFL][WK2] Add API to set preferred languages
Ryuan Choi
Reported 2014-04-09 06:11:52 PDT
Service provider may check thst "Accept-Language". This API will be used to change preference of "Acceept-Language"
Attachments
Patch (5.32 KB, patch)
2014-04-09 07:07 PDT, Ryuan Choi
no flags
Patch (5.42 KB, patch)
2014-04-09 18:29 PDT, Ryuan Choi
no flags
Patch (5.62 KB, patch)
2014-04-09 19:30 PDT, Ryuan Choi
no flags
Ryuan Choi
Comment 1 2014-04-09 07:07:16 PDT
Jinwoo Song
Comment 2 2014-04-09 17:52:46 PDT
Comment on attachment 228958 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=228958&action=review > Source/WebKit2/UIProcess/API/efl/ewk_context.cpp:573 > + if (languages) { Why don't you make an early return when the language parameter is null? > Source/WebKit2/UIProcess/API/efl/ewk_context.h:437 > + * @param languages the list of preferred languages (char * as data) s/char */char* ? Move this line below the description. > Source/WebKit2/UIProcess/API/efl/ewk_context.h:440 > + * header that will be included in the network requests Put a period at the end of the sentence. > Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_context.cpp:276 > + ASSERT_STREQ("en-US", s_acceptLanguages.utf8().data()); The default locale may be different from the system environment.
Ryuan Choi
Comment 3 2014-04-09 18:20:51 PDT
Comment on attachment 228958 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=228958&action=review >> Source/WebKit2/UIProcess/API/efl/ewk_context.cpp:573 >> + if (languages) { > > Why don't you make an early return when the language parameter is null? Null is used to clear user preferred langague. I will mention it in doxygen. >> Source/WebKit2/UIProcess/API/efl/ewk_context.h:437 >> + * @param languages the list of preferred languages (char * as data) > > s/char */char* ? > Move this line below the description. OK. >> Source/WebKit2/UIProcess/API/efl/ewk_context.h:440 >> + * header that will be included in the network requests > > Put a period at the end of the sentence. OK >> Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_context.cpp:276 >> + ASSERT_STREQ("en-US", s_acceptLanguages.utf8().data()); > > The default locale may be different from the system environment. If I am right, run-efl-tests will change the locale for non-english user. Isn't it enough?
Ryuan Choi
Comment 4 2014-04-09 18:29:48 PDT
Gyuyoung Kim
Comment 5 2014-04-09 18:53:05 PDT
Comment on attachment 229010 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=229010&action=review > Source/WebKit2/ChangeLog:8 > + Application may need to change the list of "Accept-Language". According to this description, this APIs may not be used by application. I'm not sure we have to add new APIs without clear reason. > Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_context.cpp:243 > +static String s_acceptLanguages; I prefer to use a primitive type in out of WebKit. Because it may occur symbol visibility problem when running layout test. In this case, "const char*" looks proper that String.
Ryuan Choi
Comment 6 2014-04-09 19:17:16 PDT
(In reply to comment #5) > (From update of attachment 229010 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=229010&action=review > > > Source/WebKit2/ChangeLog:8 > > + Application may need to change the list of "Accept-Language". > > According to this description, this APIs may not be used by application. I'm not sure we have to add new APIs without clear reason. > Some contents providers can check Accept-Language field of request header and send different contents to the applications. http://www.w3.org/International/questions/qa-lang-priorities.en.php So, good browsers have the power to change it. > > Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_context.cpp:243 > > +static String s_acceptLanguages; > > I prefer to use a primitive type in out of WebKit. Because it may occur symbol visibility problem when running layout test. > > In this case, "const char*" looks proper that String. OK, I will.
Jinwoo Song
Comment 7 2014-04-09 19:23:15 PDT
Comment on attachment 228958 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=228958&action=review >>> Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_context.cpp:276 >>> + ASSERT_STREQ("en-US", s_acceptLanguages.utf8().data()); >> >> The default locale may be different from the system environment. > > If I am right, run-efl-tests will change the locale for non-english user. > > Isn't it enough? If then, that's fine.
Ryuan Choi
Comment 8 2014-04-09 19:30:18 PDT
Gyuyoung Kim
Comment 9 2014-04-09 19:31:13 PDT
Comment on attachment 229016 [details] Patch LGTM
WebKit Commit Bot
Comment 10 2014-04-09 21:05:20 PDT
Comment on attachment 229016 [details] Patch Clearing flags on attachment: 229016 Committed r167062: <http://trac.webkit.org/changeset/167062>
WebKit Commit Bot
Comment 11 2014-04-09 21:05:27 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.