Merge pull request #1142 from mfietz/issue/1139-option-label

Localize option label
This commit is contained in:
Tom Hennen 2015-08-29 08:20:20 -04:00
commit 0d212e1c0e
2 changed files with 8 additions and 18 deletions

View File

@ -8,7 +8,6 @@ import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
@ -51,23 +50,13 @@ public class OpmlImportFromPathActivity extends OpmlImportBaseActivity {
final TextView txtvHeaderExplanation3 = (TextView) findViewById(R.id.txtvHeadingExplanation3);
Button butChooseFilesystem = (Button) findViewById(R.id.butChooseFileFromFilesystem);
butChooseFilesystem.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
chooseFileFromFilesystem();
}
});
butChooseFilesystem.setOnClickListener(v -> chooseFileFromFilesystem());
Button butChooseExternal = (Button) findViewById(R.id.butChooseFileFromExternal);
butChooseExternal.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
chooseFileFromExternal();
}
});
butChooseExternal.setOnClickListener(v -> chooseFileFromExternal());
int nextOption = 1;
int nextOption = 1;
String optionLabel = getString(R.string.opml_import_option);
intentPickAction = new Intent(Intent.ACTION_PICK);
intentPickAction.setData(Uri.parse("file://"));
@ -81,7 +70,7 @@ public class OpmlImportFromPathActivity extends OpmlImportBaseActivity {
}
}
if(txtvExplanation1.getVisibility() == View.VISIBLE) {
txtvHeaderExplanation1.setText("Option " + nextOption);
txtvHeaderExplanation1.setText(String.format(optionLabel, nextOption));
nextOption++;
}
@ -94,11 +83,11 @@ public class OpmlImportFromPathActivity extends OpmlImportBaseActivity {
findViewById(R.id.divider2).setVisibility(View.GONE);
butChooseExternal.setVisibility(View.GONE);
} else {
txtvHeaderExplanation2.setText("Option " + nextOption);
txtvHeaderExplanation2.setText(String.format(optionLabel, nextOption));
nextOption++;
}
txtvHeaderExplanation3.setText("Option " + nextOption);
txtvHeaderExplanation3.setText(String.format(optionLabel, nextOption));
}
@Override

View File

@ -358,6 +358,7 @@
<!-- OPML import and export -->
<string name="opml_import_txtv_button_lable">OPML files allow you to move your podcasts from one podcatcher to another.</string>
<string name="opml_import_option">Option %1$d</string>
<string name="opml_import_explanation_1">Choose a specific file path from the local filesystem.</string>
<string name="opml_import_explanation_2">Use an external applications like Dropbox, Google Drive or your favourite file manager to open an OPML file.</string>
<string name="opml_import_explanation_3">Many applications like Google Mail, Dropbox, Google Drive and most file managers can <i>open</i> OPML files <i>with</i> AntennaPod.</string> <string name="start_import_label">Start import</string>