Kaydet (Commit) 897b393e authored tarafından Mert Tumer's avatar Mert Tumer Kaydeden (comit) Tomaž Vajngerl

Extract hardcoded strings to string resource file on Android Viewer

Change-Id: Ie2276ac162062e7365c9605f98fe03e5011ba6cb
Signed-off-by: 's avatarMert Tumer <merttumer@outlook.com>
Reviewed-on: https://gerrit.libreoffice.org/60688Reviewed-by: 's avatarTomaž Vajngerl <quikee@gmail.com>
Tested-by: 's avatarTomaž Vajngerl <quikee@gmail.com>
üst 315e585f
......@@ -30,19 +30,19 @@
<item >1</item>
</string-array>
<string-array name="FilterTypeNames">
<item>Everything</item>
<item>Documents</item>
<item>Spreadsheets</item>
<item>Presentations</item>
<item>Drawings</item>
<item>@string/filter_everything</item>
<item>@string/filter_documents</item>
<item>@string/filter_spreadsheets</item>
<item>@string/filter_presentations</item>
<item>@string/filter_drawings</item>
</string-array>
<string-array name="SortModeNames">
<item >A-Z</item>
<item >Z-A</item>
<item >Oldest First</item>
<item >Newest First</item>
<item >Largest First</item>
<item >Smallest First</item>
<item >@string/sort_az</item>
<item >@string/sort_za</item>
<item >@string/sort_oldest</item>
<item >@string/sort_newest</item>
<item >@string/sort_largest</item>
<item >@string/sort_smallest</item>
</string-array>
......
......@@ -211,4 +211,18 @@
<string name="UNO_commands_string_parent_value_hint">Parent Value</string>
<string name="action_exportToPDF">Export To PDF</string>
<string name="action_print">Print</string>
<string name="tabhost_character">Character</string>
<string name="tabhost_paragraph">Paragraph</string>
<string name="tabhost_insert">Insert</string>
<string name="tabhost_style">Style</string>
<string name="alert_ok">OK</string>
<string name="alert_cancel">Cancel</string>
<string name="unable_to_go_further">Unable to go further.</string>
<string name="current_uno_command">Current UNO command</string>
<string name="pref_sort_summary">Select how to order files: A-Z, by size or by date.</string>
<string name="pref_viewmode_summary">View files as a grid or in a list.</string>
<string name="pref_file_explorer_title">File explorer layout</string>
<string name="pref_sort_title">File Order</string>
<string name="pref_filter_title">Default File Filter</string>
<string name="pref_filter_summary">Set which file filter should be used by default.</string>
</resources>
......@@ -4,22 +4,24 @@
android:title="@string/pref_category_explorer"
android:key="PREF_CATEGORY_EXPLORER">
<ListPreference
android:title="Default File Filter"
android:summary="Set which file filter should be used by default."
android:title="@string/pref_filter_title"
android:summary="@string/pref_filter_summary"
android:entries="@array/FilterTypeNames"
android:entryValues="@array/FilterTypeStringValues"
android:key="FILTER_MODE"/>
<ListPreference
android:summary="Select how to order files: A-Z, by size or by date."
android:summary="@string/pref_sort_summary"
android:key="SORT_MODE"
android:title="File Order" android:entries="@array/SortModeNames" android:entryValues="@array/SortModeStringValues"/>
android:title="@string/pref_sort_title"
android:entries="@array/SortModeNames"
android:entryValues="@array/SortModeStringValues"/>
<ListPreference
android:entries="@array/ViewModeNames"
android:entryValues="@array/ViewModeStringValues"
android:defaultValue="@integer/grid_view_integer"
android:title="File explorer layout"
android:title="@string/pref_file_explorer_title"
android:key="EXPLORER_VIEW_TYPE"
android:summary="View files as a grid or in a list." />
android:summary="@string/pref_viewmode_summary" />
<CheckBoxPreference
android:title="@string/pref_show_hidden_files"
android:key="ENABLE_SHOW_HIDDEN_FILES"
......
......@@ -279,8 +279,8 @@ class FormattingController implements View.OnClickListener {
npColNegative.setOnClickListener(negativeButtonClickListener);
insertTableBuilder.setView(numberPicker);
insertTableBuilder.setNeutralButton("Cancel", null);
insertTableBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
insertTableBuilder.setNeutralButton(R.string.alert_cancel, null);
insertTableBuilder.setPositiveButton(R.string.alert_ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
......@@ -346,7 +346,7 @@ class FormattingController implements View.OnClickListener {
private void deleteTable() {
AlertDialog.Builder deleteBuilder = new AlertDialog.Builder(mContext);
deleteBuilder.setTitle(R.string.select_delete_options);
deleteBuilder.setNeutralButton("Cancel",null);
deleteBuilder.setNeutralButton(R.string.alert_cancel,null);
final int[] selectedItem = new int[1];
deleteBuilder.setSingleChoiceItems(mContext.getResources().getStringArray(R.array.deleterowcolumns), -1, new DialogInterface.OnClickListener() {
@Override
......@@ -354,7 +354,7 @@ class FormattingController implements View.OnClickListener {
selectedItem[0] = which;
}
});
deleteBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
deleteBuilder.setPositiveButton(R.string.alert_ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
switch (selectedItem[0]){
......
......@@ -232,24 +232,24 @@ public class LibreOfficeMainActivity extends AppCompatActivity implements Settin
TabHost host = findViewById(R.id.toolbarTabHost);
host.setup();
TabHost.TabSpec spec = host.newTabSpec("Character");
TabHost.TabSpec spec = host.newTabSpec(getString(R.string.tabhost_character));
spec.setContent(R.id.tab_character);
spec.setIndicator("Character");
spec.setIndicator(getString(R.string.tabhost_character));
host.addTab(spec);
spec = host.newTabSpec("Paragraph");
spec = host.newTabSpec(getString(R.string.tabhost_paragraph));
spec.setContent(R.id.tab_paragraph);
spec.setIndicator("Paragraph");
spec.setIndicator(getString(R.string.tabhost_paragraph));
host.addTab(spec);
spec = host.newTabSpec("Insert");
spec = host.newTabSpec(getString(R.string.tabhost_insert));
spec.setContent(R.id.tab_insert);
spec.setIndicator("Insert");
spec.setIndicator(getString(R.string.tabhost_insert));
host.addTab(spec);
spec = host.newTabSpec("Style");
spec = host.newTabSpec(getString(R.string.tabhost_style));
spec.setContent(R.id.tab_style);
spec.setIndicator("Style");
spec.setIndicator(getString(R.string.tabhost_style));
host.addTab(spec);
LinearLayout bottomToolbarLayout = findViewById(R.id.toolbar_bottom);
......@@ -753,13 +753,13 @@ public class LibreOfficeMainActivity extends AppCompatActivity implements Settin
input.setInputType(InputType.TYPE_CLASS_TEXT);
builder.setView(input);
builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
builder.setPositiveButton(R.string.alert_ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
mTileProvider.renamePart( input.getText().toString());
}
});
builder.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
builder.setNegativeButton(R.string.alert_cancel, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
......
......@@ -63,7 +63,7 @@ class UNOCommandsController implements View.OnClickListener {
private void showCommandDialog() {
try {
AlertDialog dialog = new AlertDialog.Builder(mActivity)
.setTitle("Current UNO command")
.setTitle(R.string.current_uno_command)
.setMessage(mRootJSON.toString(2))
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
......
......@@ -124,7 +124,7 @@ public class DirectoryBrowserFragment extends Fragment {
private void changeDirectory(File destination) {
if(destination == null) {
Toast.makeText(getActivity(), "Unable to go further.", Toast.LENGTH_SHORT)
Toast.makeText(getActivity(), R.string.unable_to_go_further, Toast.LENGTH_SHORT)
.show();
} else {
Fragment fragment = DirectoryBrowserFragment.newInstance(destination.toURI().toString());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment