diff --git a/.gitignore b/.gitignore index 663a3330..930bd691 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,9 @@ proguard/ # Gradle stuff build .gradle + +# Eclipse project files +.classpath +.project +.settings/ +project.properties diff --git a/src/com/uberspot/a2048/MainActivity.java b/src/com/uberspot/a2048/MainActivity.java index 1a8c610b..74bf7230 100644 --- a/src/com/uberspot/a2048/MainActivity.java +++ b/src/com/uberspot/a2048/MainActivity.java @@ -1,6 +1,8 @@ package com.uberspot.a2048; +import java.util.Locale; + import android.annotation.SuppressLint; import android.app.Activity; import android.content.SharedPreferences; @@ -92,9 +94,11 @@ protected void onCreate(Bundle savedInstanceState) { // If there is a previous instance restore it in the webview if (savedInstanceState != null) { + // TODO: If app was minimized and Locale language was changed, we need to reload webview with changed language mWebView.restoreState(savedInstanceState); } else { - mWebView.loadUrl("file:///android_asset/2048/index.html"); + // Load webview with current Locale language + mWebView.loadUrl("file:///android_asset/2048/index.html?lang=" + Locale.getDefault().getLanguage()); } Toast.makeText(getApplication(), R.string.toggle_fullscreen, Toast.LENGTH_SHORT).show();