Tencent / VasSonic

VasSonic is a lightweight and high-performance Hybrid framework developed by tencent VAS team, which is intended to speed up the first screen of websites working on Android and iOS platform.
Other
11.81k stars 1.61k forks source link

how to change default language !? #232

Closed hnguyenworkstation closed 6 years ago

hnguyenworkstation commented 6 years ago

Hello,

First of all, thank you for such an amazing library for web services. I would like to know how to change the default language of VasSonic WebViewClient (or WebSetting..). All contents in the website that loaded from VasSonic are rendered as Chinese. I have tried to dig into the wiki but haven't found a way yet.

Please let me know if there is a way or workaround for this. Thanks in advance!

marlonlu commented 6 years ago

please support more detail about this question. VasSonic doesn't change any setting of webview or use any Chinese charset encoding such as GBK, unless the website indicate from header "Content-Type"

hnguyenworkstation commented 6 years ago

31743478_1426463544124139_7345489292820480_n

@marlonlu Thanks for your response. As you may see in the bottom, the footer content is rendered as Chinese. When I load the webpage as Default mode, it shows in English as normal. I am not sure which attribute in Sonic mode changes that.

marlonlu commented 6 years ago

please paste your url and android logcat here.

hnguyenworkstation commented 6 years ago

url=https://sites.google.com/view/qada-zone/policy

""" 05-04 10:45:57.418 23355-23615/com.app.qadazone.android D/OpenGLRenderer: endAllActiveAnimators on 0x75dec78800 (RippleDrawable) with handle 0x75c7bdfe20 05-04 10:45:57.418 23355-23355/com.app.qadazone.android D/ViewRootImpl@f26fbdf[MainMenuActivity]: mHardwareRenderer.destroy()#1 05-04 10:45:57.422 23355-23355/com.app.qadazone.android D/ViewRootImpl@f26fbdf[MainMenuActivity]: Relayout returned: oldFrame=[0,0][1080,1920] newFrame=[0,0][1080,1920] result=0x5 surface={isValid=false 0} surfaceGenerationChanged=true 05-04 10:45:57.428 23355-719/com.app.qadazone.android D/SonicSdk_SonicServer: session(sonic-demo-master_37381caae1c23ce1e6e6a9e9f8b2463d) server response cost = 155 ms. 05-04 10:45:57.429 23355-719/com.app.qadazone.android D/SonicSdk_SonicSession: session(18783) connection get header fields cost = 0 ms. 05-04 10:45:57.429 23355-719/com.app.qadazone.android D/SonicSdk_SonicSession: session(18783) connection set cookies cost = 0 ms. 05-04 10:45:57.429 23355-719/com.app.qadazone.android I/SonicSdk_SonicSession: session(18783) handleFlow_Connection: respCode = 200, cost 158 ms. 05-04 10:45:57.429 23355-719/com.app.qadazone.android I/SonicSdk_SonicSession: session(18783) handleFlow_Connection: cacheOffline is true. 05-04 10:45:57.430 23355-719/com.app.qadazone.android I/SonicSdk_QuickSonicSession: session(18783) handleFlow_FirstLoad:hasCompletionData=false. 05-04 10:45:57.430 23355-23355/com.app.qadazone.android D/SonicSdk_SonicSession: session(18783) handleMessage: msg what = 6. 05-04 10:45:57.430 23355-719/com.app.qadazone.android D/SonicSdk_SonicEngine: onSessionStateChange:session(18783) from state 1 -> 2 05-04 10:45:57.430 23355-747/com.app.qadazone.android I/SonicSdk_QuickSonicSession: session(18783) have pending stream? -> true, cost 67ms. 05-04 10:45:57.430 23355-23355/com.app.qadazone.android I/SonicSdk_QuickSonicSession: session(18783) handleClientCoreMessage_FirstLoad:FIRST_LOAD_NO_DATA. 05-04 10:45:57.430 23355-23355/com.app.qadazone.android I/SonicSdk_SonicSession: session(18783) setResult: srcCode=1000, finalCode=1000. 05-04 10:45:57.430 23355-23355/com.app.qadazone.android E/SonicSdk_SonicSession: session(18783) setResult: notify fail as webCallback is not set, please wait! 05-04 10:45:57.447 23355-725/com.app.qadazone.android I/SonicSdk_SonicSessionStream: close: memory stream and socket stream, netStreamReadComplete=true, memStreamReadComplete=true 05-04 10:45:57.448 23355-725/com.app.qadazone.android I/SonicSdk_SonicSession: session(18783) onClose:offline->true , post separateAndSaveCache task. 05-04 10:45:57.456 23355-747/com.app.qadazone.android D/SonicSdk_SonicSession: onClientRequestResource called in TaskSchedulerFo. 05-04 10:45:57.456 23355-736/com.app.qadazone.android D/SonicSdk_SonicSession: onClientRequestResource called in TaskSchedulerFo. 05-04 10:45:57.456 23355-761/com.app.qadazone.android D/SonicSdk_SonicSession: onClientRequestResource called in TaskSchedulerFo. 05-04 10:45:57.456 23355-747/com.app.qadazone.android D/SonicSdk_SonicSession: onClientRequestResource called in TaskSchedulerFo. 05-04 10:45:57.458 23355-747/com.app.qadazone.android D/SonicSdk_SonicSession: onClientRequestResource called in TaskSchedulerFo. 05-04 10:45:57.513 23355-736/com.app.qadazone.android D/SonicSdk_SonicSession: onClientRequestResource called in TaskSchedulerFo. 05-04 10:45:57.528 23355-747/com.app.qadazone.android D/SonicSdk_SonicSession: onClientRequestResource called in TaskSchedulerFo. 05-04 10:45:57.697 23355-736/com.app.qadazone.android D/SonicSdk_SonicSession: onClientRequestResource called in TaskSchedulerFo. 05-04 10:45:57.720 23355-736/com.app.qadazone.android D/SonicSdk_SonicSession: onClientRequestResource called in TaskSchedulerFo. 05-04 10:45:57.803 23355-747/com.app.qadazone.android D/SonicSdk_SonicSession: onClientRequestResource called in TaskSchedulerFo. 05-04 10:45:57.846 23355-23355/com.app.qadazone.android D/ViewRootImpl@f26fbdf[MainMenuActivity]: Relayout returned: oldFrame=[0,0][1080,1920] newFrame=[0,0][1080,1920] result=0x5 surface={isValid=false 0} surfaceGenerationChanged=false 05-04 10:45:57.851 23355-23355/com.app.qadazone.android I/SonicSdk_SonicSession: session(18783) onClientPageFinished:url=https://sites.google.com/view/qada-zone/policy. 05-04 10:45:57.856 23355-736/com.app.qadazone.android D/SonicSdk_SonicSession: onClientRequestResource called in TaskSchedulerFo. 05-04 10:45:57.925 23355-747/com.app.qadazone.android D/SonicSdk_SonicSession: onClientRequestResource called in TaskSchedulerFo. 05-04 10:45:57.949 23355-747/com.app.qadazone.android D/SonicSdk_SonicSession: onClientRequestResource called in TaskSchedulerFo. 05-04 10:45:57.958 23355-747/com.app.qadazone.android D/SonicSdk_SonicSession: onClientRequestResource called in TaskSchedulerFo. 05-04 10:45:57.997 23355-747/com.app.qadazone.android D/SonicSdk_SonicSession: onClientRequestResource called in TaskSchedulerFo. 05-04 10:45:58.003 23355-747/com.app.qadazone.android D/SonicSdk_SonicSession: onClientRequestResource called in TaskSchedulerFo. 05-04 10:45:58.007 23355-23355/com.app.qadazone.android I/SonicSdk_SonicSession: session(18783) onClientPageFinished:url=https://sites.google.com/view/qada-zone/policy. 05-04 10:45:58.008 23355-747/com.app.qadazone.android D/SonicSdk_SonicSession: onClientRequestResource called in TaskSchedulerFo. 05-04 10:45:58.031 23355-747/com.app.qadazone.android D/SonicSdk_SonicSession: onClientRequestResource called in TaskSchedulerFo. 05-04 10:45:58.039 23355-736/com.app.qadazone.android D/SonicSdk_SonicSession: onClientRequestResource called in TaskSchedulerFo. 05-04 10:45:58.098 23355-736/com.app.qadazone.android D/SonicSdk_SonicSession: onClientRequestResource called in TaskSchedulerFo. 05-04 10:45:58.450 23355-23533/com.app.qadazone.android I/art: Starting a blocking GC Explicit 05-04 10:45:58.473 23355-736/com.app.qadazone.android D/SonicSdk_SonicSession: onClientRequestResource called in TaskSchedulerFo. 05-04 10:45:58.514 23355-736/com.app.qadazone.android D/SonicSdk_SonicSession: onClientRequestResource called in TaskSchedulerFo. 05-04 10:45:58.537 23355-23533/com.app.qadazone.android I/art: Explicit concurrent mark sweep GC freed 71289(4MB) AllocSpace objects, 31(1364KB) LOS objects, 40% free, 18MB/30MB, paused 1.317ms total 86.761ms 05-04 10:45:58.950 23355-710/com.app.qadazone.android D/SonicSdk_SonicSession: session(18783) onClose:htmlString size:35805 05-04 10:45:58.951 23355-710/com.app.qadazone.android I/SonicSdk_SonicUtils: separateTemplateAndData:sessionId(sonic-demo-master_37381caae1c23ce1e6e6a9e9f8b2463d) start, htmlString = <!DOCTYPE html> Githubissues.

  • Githubissues is a development platform for aggregating issues.