Remove hardcoded strings to proper translation

This commit is contained in:
Alibek Omarov 2018-03-01 21:50:13 +03:00
parent 57847a7dd3
commit 4e58654c10
4 changed files with 99 additions and 73 deletions

View file

@ -215,7 +215,7 @@
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="3dp"
android:text="Pixel Format"
android:text="@string/pixel_format"
android:textAppearance="?android:attr/textAppearanceMedium" />
<Spinner
android:layout_height="wrap_content"
@ -234,8 +234,8 @@
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:text="enableResizeWorkaround"
android:textOff="Keyboard does not resize screen"
android:textOn="Keyboard resizes screen" />
android:textOff="@string/resize_off"
android:textOn="@string/resize_on" />
<CheckBox
android:id="@+id/check_updates"
android:layout_width="match_parent"
@ -245,7 +245,7 @@
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:text="@string/update_button" />
<CheckBox
<!--<CheckBox
android:id="@+id/check_betas"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -253,7 +253,7 @@
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:text="@string/update_to_beta" />
android:text="@string/update_to_beta" />-->
<CheckBox
android:id="@+id/immersive_mode"
android:layout_width="match_parent"

View file

@ -1,26 +1,72 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name" translatable="false">Xash3D</string>
<string name="launcher_name" translatable="false">Xash3D</string>
<string name="launcher_name_test" translatable="false">Xash3D (test)</string>
<string name="app_name" translatable="false">Xash3D FWGS</string>
<string name="launcher_name" translatable="false">Xash3D FWGS</string>
<string name="launcher_name_test" translatable="false">Xash3D FWGS Test</string>
<string name="version_string" translatable="false">v0.19.1</string>
<string name="launch_button">Launch Xash3D!</string>
<string name="cmd_args_text">Command line arguments(experts only)</string>
<!-- Generic -->
<string name="cancel">Cancel</string>
<string name="ok">Ok</string>
<string name="next">Next</string>
<string name="prev">Previous</string>
<string name="skip">Skip</string>
<string name="finish">Finish</string>
<string name="exit">Exit</string>
<string name="text_res_path">Path to game resources</string>
<string name="touch_set">Controls settings</string>
<string name="text_shortcut">Xash3D shortcut</string>
<string name="text_shortcut_test">Xash3D_test shortcut</string>
<!-- Generic -->
<!-- Launcher(tabs) -->
<string name="text_tab1">Normal</string>
<string name="text_tab2">Advanced</string>
<!-- Launcher(tabs) -->
<!-- Launcher(normal) -->
<string name="text_res_tittle2">Normal settings</string>
<string name="volume">Volume buttons mode</string>
<string name="use_volume">Default action</string>
<string name="no_volume">Use in game</string>
<string name="select_folder">Select game data location</string>
<string name="create_shortcut_button">Create mod shortcut</string>
<!-- Launcher(normal) -->
<!-- Launcher(advanced) -->
<string name="text_res_tittle3">Advanced settings</string>
<string name="cmd_args_text">Command line arguments(experts only)</string>
<string name="pixel_format">Pixel format</string>
<string name="resize_off">Keyboard does not resize screen</string>
<string name="resize_on">Keyboard resizes screen</string>
<string name="update_button">Check updates on start</string>
<!--<string name="update_to_beta">Update to unstable version if available</string>-->
<string name="immersive_mode">Enable Immersive Mode(fullscreen, KitKat or higher)</string>
<string name="resolution">Fixed screen resolution (experimental)</string>
<string name="resolution_scale">Scale screen keeping aspect ratio</string>
<string name="resolution_custom">Specify custom screen width and height</string>
<string name="resolution_result">Resolution: </string>
<string name="resolution_mod_warn">Use with caution! Some games does not support too low resolution, in case of bugs increase resolution to 640x480 or higher.\n
Resolution lower than 320x240 is not allowed.</string>
<!-- Launcher(advanced) -->
<!-- Launcher(buttons) -->
<string name="about_button">About</string>
<string name="launch_button">Launch Xash3D FWGS!</string>
<!-- Launcher(buttons) -->
<!-- Shorcut -->
<string name="text_shortcut">Xash3D FWGS shortcut</string>
<string name="text_shortcut_test">Xash3D FWGS Test shortcut</string>
<string name="shortcut_button_save">Save shortcut</string>
<string name="gamedir">Mod directory</string>
<string name="pkgname">Mod package name (experts only)</string>
<string name="shortcut_name">Shortcut name</string>
<!-- Shorcut -->
<string name="about_main" translatable="false">Xash3D Android</string>
<string name="about_copyright">FWGS is not affiliated with Valve or any of their partners. All copyrights reserved to their respective owners.</string>
<!-- About -->
<string name="about_main" translatable="false">Xash3D FWGS</string>
<string name="about_copyright">Flying With Gauss is not affiliated with Valve or any of their partners. All copyrights reserved to their respective owners.</string>
<!-- Seems Android skips any line breaks and tabs here. -->
<string name="about_authors" translatable="false">
Port to Android by FWGS team: \n
Port to Android by Flying With Gauss team: \n
&#8226; a1batross\n
&#8226; mittorn \n
&#8226; nicknekit\n
@ -37,28 +83,16 @@
&#8226; <a href="http://moddb.com/game/xash3d-android">ModDB</a>\n
&#8226; <a href="https://github.com/FWGS">GitHub</a>
</string>
<string name="about_button">About</string>
<string name="create_shortcut_button">Create mod shortcut</string>
<string name="select_folder">Select game data location</string>
<string name="text_tab1">Normal</string>
<string name="text_tab2">Advanced</string>
<string name="text_res_tittle2">Normal settings</string>
<string name="text_res_tittle3">Advanced settings</string>
<string name="volume">Volume buttons mode</string>
<string name="use_volume">Default action</string>
<string name="no_volume">Use in game</string>
<string name="folder">Set current folder</string>
<string name="update_button">Check updates on start</string>
<string name="update_to_beta">Update to unstable version if available</string>
<!-- About -->
<!-- Update -->
<string name="update_message">%s is available! Download it now!</string>
<string name="update">Update</string>
<string name="cancel">Cancel</string>
<string name="ok">Ok</string>
<string name="no_updates">No updates was found</string>
<string name="checking_updates">Working...</string>
<string name="immersive_mode">Enable Immersive Mode(fullscreen, KitKat or higher)</string>
<!-- Update -->
<!-- Write check -->
<string name="write_failed">Write test has failed</string>
<string name="ask_about_new_basedir_msg">Move your game files somewhere else, for example Android/data/in.celest.xash3d.hl or internal memory. At next run I will ask you about folder again.</string>
<!-- These strings must be concat with a "ask_about_new_basedir" string -->
@ -66,17 +100,22 @@
<string name="lollipop_write_fail_msg">Due to writing politics of newer Android versions, you can\'t use this storage. </string>
<string name="kitkat_write_fail_msg">Due to writing politics of Android 4.4, you can\'t use this storage. </string>
<string name="readonly_fs_fail_msg">Seems you have read-only filesystem. </string>
<!-- /Write check -->
<string name="resolution">Fixed screen resolution (experimental)</string>
<string name="resolution_scale">Scale screen keeping aspect ratio</string>
<string name="resolution_custom">Specify custom screen width and height</string>
<string name="resolution_result">Resolution: </string>
<string name="resolution_mod_warn"><img src="https://ya.ru/favicon.ico" /> <br />Use with caution! Some games does not support too low resolution, in case of bugs increase resolution to 640x480 or higher.\n
Resolution lower than 320x240 is not allowed.</string>
<!-- Tutorial -->
<string name="firstrun">Open installation guide</string>
<string name="next">Next</string>
<string name="prev">Prev</string>
<string name="skip">Skip</string>
<string name="finish">Finish</string>
<string name="exit">Exit</string>
<!-- /Tutorial -->
<!-- FPicker -->
<string name="folder">Set current folder</string>
<string name="parent_directory">Parent directory</string>
<string name="chosen_path">Chosen path:</string>
<string name="current_dir">Current directory:</string>
<plurals name="item_plurals">
<item quantity="zero">No items</items>
<item quantity="one">%d item</item>
<item quantity="other">%d items</item>
</plurals>
<!-- /FPicker -->
</resources>

View file

@ -85,10 +85,7 @@ public class FPicker extends Activity {
while( dirs == null )
{
String parent = folder.getParent();
if (parent != null)
folder = new File(parent);
else
folder = new File(Environment.getExternalStorageDirectory().toString());
folder = new File( parent != null ? parent : Environment.getExternalStorageDirectory().toString() );
dirs = folder.listFiles();
}
@ -102,6 +99,7 @@ public class FPicker extends Activity {
boolean isXashDir = false;
File[] fbuf = ff.listFiles();
int buf = 0;
if( fbuf != null && fbuf.length < 20 )
{
buf = fbuf.length;
@ -112,33 +110,22 @@ public class FPicker extends Activity {
}
}
String num_item = String.valueOf(buf);
if(buf == 0)
num_item = "Some items";
else
num_item +=" items";
if( isXashDir )
{
dir.add(new Item(ff.getName(), num_item, date_modify, ff.getAbsolutePath(), R.drawable.ic_launcher));
}
else
{
dir.add(new Item(ff.getName(), num_item, date_modify, ff.getAbsolutePath(), R.drawable.folder));
}
String num_item = res.getQuantityString(R.plurals.item_plurals, buf, buf);
dir.add(new Item(ff.getName(), num_item, date_modify, ff.getAbsolutePath(), isXashDir ? R.drawable.ic_launcher : R.drawable.folder ));
}
}
Collections.sort(dir);
if(folder.getPath().length() > 1)
dir.add(0, new Item( "..", "Parent Directory", "", folder.getParent(), R.drawable.folder));
dir.add(0, new Item( "..", R.string.parent_directory, "", folder.getParent(), R.drawable.folder));
return dir;
}
protected void onPostExecute(List<Item> dir)
{
setTitle("Current Dir: "+folder.getName());
setTitle(R.string.current_dir + " " +folder.getName());
adapter = new FileArrayAdapter(FPicker.this,R.layout.row,dir);
delta = (ListView)findViewById(R.id.FileView);
@ -159,7 +146,7 @@ public class FPicker extends Activity {
public void onFileClick(View v)
{
Toast.makeText(this, "Chosen path : " + currentDir, Toast.LENGTH_SHORT).show();
Toast.makeText(this, R.string.chosen_path + " " + currentDir, Toast.LENGTH_SHORT).show();
Intent intent = new Intent();
intent.putExtra("GetPath",currentDir.toString());
setResult(RESULT_OK, intent);

View file

@ -28,7 +28,7 @@ public class LauncherActivity extends Activity {
static ToggleButton useVolume;
static ToggleButton resizeWorkaround;
static CheckBox checkUpdates;
static CheckBox updateToBeta;
//static CheckBox updateToBeta;
static CheckBox immersiveMode;
static SharedPreferences mPref;
static Spinner pixelSpinner;
@ -136,7 +136,7 @@ public class LauncherActivity extends Activity {
useVolume = (ToggleButton) findViewById( R.id.useVolume );
resPath = (EditText) findViewById( R.id.cmdPath );
checkUpdates = (CheckBox)findViewById( R.id.check_updates );
updateToBeta = (CheckBox)findViewById( R.id.check_betas );
//updateToBeta = (CheckBox)findViewById( R.id.check_betas );
pixelSpinner = (Spinner) findViewById( R.id.pixelSpinner );
resizeWorkaround = (ToggleButton) findViewById( R.id.enableResizeWorkaround );
tvResPath = (TextView) findViewById( R.id.textView_path );
@ -196,7 +196,7 @@ public class LauncherActivity extends Activity {
});
useVolume.setChecked(mPref.getBoolean("usevolume",true));
checkUpdates.setChecked(mPref.getBoolean("check_updates",true));
updateToBeta.setChecked(mPref.getBoolean("check_betas", false));
//updateToBeta.setChecked(mPref.getBoolean("check_betas", false));
updatePath(mPref.getString("basedir", FWGSLib.getDefaultXashPath() ) );
cmdArgs.setText(mPref.getString("argv","-dev 3 -log"));
pixelSpinner.setSelection(mPref.getInt("pixelformat", 0));
@ -274,7 +274,7 @@ public class LauncherActivity extends Activity {
if( !XashConfig.GP_VERSION && // disable autoupdater for Google Play
mPref.getBoolean("check_updates", true))
{
new CheckUpdate(true, updateToBeta.isChecked()).execute(UPDATE_LINK);
new CheckUpdate(true, false).execute(UPDATE_LINK);
}
changeButtonsStyle((ViewGroup)tabHost.getParent());
hideResolutionSettings( !enableResolutionChange );