Change how Accept-Language header is processed.

pull/162/head
Fox2Code 2 years ago
parent ad3c9e249e
commit 1c3e197db7

@ -31,6 +31,8 @@ import com.fox2code.mmm.compat.CompatActivity;
import com.fox2code.mmm.utils.Http;
import com.fox2code.mmm.utils.IntentHelper;
import java.util.HashMap;
/**
* Per Androidacy repo implementation agreement, no request of this WebView shall be modified.
*/
@ -190,7 +192,10 @@ public class AndroidacyActivity extends CompatActivity {
this.webView.addJavascriptInterface(androidacyWebAPI =
new AndroidacyWebAPI(this, allowInstall), "mmm");
if (compatLevel != 0) androidacyWebAPI.notifyCompatModeRaw(compatLevel);
this.webView.loadUrl(url);
HashMap<String, String> headers = new HashMap<>();
headers.put("Accept-Language", this.getResources()
.getConfiguration().locale.toLanguageTag());
this.webView.loadUrl(url, headers);
}
@Override

@ -130,7 +130,7 @@ public class Http {
}
if (chain.request().header("Accept-Language") == null) {
request.header("Accept-Language", // Send system language to the server
Resources.getSystem().getConfiguration().locale.toLanguageTag());
mainApplication.getResources().getConfiguration().locale.toLanguageTag());
}
return chain.proceed(request.build());
});

@ -12,6 +12,14 @@
android:fillColor="@color/black" android:fillAlpha="0.25"
android:pathData="M20.5,11H19V7c0,-1.1 -0.9,-2 -2,-2h-4V3.5C13,2.12 11.88,1 10.5,1S8,2.12 8,3.5V5H4c-1.1,0 -1.99,0.9 -1.99,2v3.8H3.5c1.49,0 2.7,1.21 2.7,2.7s-1.21,2.7 -2.7,2.7H2V20c0,1.1 0.9,2 2,2h3.8v-1.5c0,-1.49 1.21,-2.7 2.7,-2.7 1.49,0 2.7,1.21 2.7,2.7V22H17c1.1,0 2,-0.9 2,-2v-4h1.5c1.38,0 2.5,-1.12 2.5,-2.5S21.88,11 20.5,11z"/>
</group>
<group android:scaleX="2"
android:scaleY="2"
android:translateX="31"
android:translateY="31">
<path
android:fillColor="@color/black" android:fillAlpha="0.25"
android:pathData="M20.5,11H19V7c0,-1.1 -0.9,-2 -2,-2h-4V3.5C13,2.12 11.88,1 10.5,1S8,2.12 8,3.5V5H4c-1.1,0 -1.99,0.9 -1.99,2v3.8H3.5c1.49,0 2.7,1.21 2.7,2.7s-1.21,2.7 -2.7,2.7H2V20c0,1.1 0.9,2 2,2h3.8v-1.5c0,-1.49 1.21,-2.7 2.7,-2.7 1.49,0 2.7,1.21 2.7,2.7V22H17c1.1,0 2,-0.9 2,-2v-4h1.5c1.38,0 2.5,-1.12 2.5,-2.5S21.88,11 20.5,11z"/>
</group>
<group android:scaleX="2"
android:scaleY="2"
android:translateX="30"

Loading…
Cancel
Save