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 @@ ...@@ -30,19 +30,19 @@
<item >1</item> <item >1</item>
</string-array> </string-array>
<string-array name="FilterTypeNames"> <string-array name="FilterTypeNames">
<item>Everything</item> <item>@string/filter_everything</item>
<item>Documents</item> <item>@string/filter_documents</item>
<item>Spreadsheets</item> <item>@string/filter_spreadsheets</item>
<item>Presentations</item> <item>@string/filter_presentations</item>
<item>Drawings</item> <item>@string/filter_drawings</item>
</string-array> </string-array>
<string-array name="SortModeNames"> <string-array name="SortModeNames">
<item >A-Z</item> <item >@string/sort_az</item>
<item >Z-A</item> <item >@string/sort_za</item>
<item >Oldest First</item> <item >@string/sort_oldest</item>
<item >Newest First</item> <item >@string/sort_newest</item>
<item >Largest First</item> <item >@string/sort_largest</item>
<item >Smallest First</item> <item >@string/sort_smallest</item>
</string-array> </string-array>
......
...@@ -211,4 +211,18 @@ ...@@ -211,4 +211,18 @@
<string name="UNO_commands_string_parent_value_hint">Parent Value</string> <string name="UNO_commands_string_parent_value_hint">Parent Value</string>
<string name="action_exportToPDF">Export To PDF</string> <string name="action_exportToPDF">Export To PDF</string>
<string name="action_print">Print</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> </resources>
...@@ -4,22 +4,24 @@ ...@@ -4,22 +4,24 @@
android:title="@string/pref_category_explorer" android:title="@string/pref_category_explorer"
android:key="PREF_CATEGORY_EXPLORER"> android:key="PREF_CATEGORY_EXPLORER">
<ListPreference <ListPreference
android:title="Default File Filter" android:title="@string/pref_filter_title"
android:summary="Set which file filter should be used by default." android:summary="@string/pref_filter_summary"
android:entries="@array/FilterTypeNames" android:entries="@array/FilterTypeNames"
android:entryValues="@array/FilterTypeStringValues" android:entryValues="@array/FilterTypeStringValues"
android:key="FILTER_MODE"/> android:key="FILTER_MODE"/>
<ListPreference <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: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 <ListPreference
android:entries="@array/ViewModeNames" android:entries="@array/ViewModeNames"
android:entryValues="@array/ViewModeStringValues" android:entryValues="@array/ViewModeStringValues"
android:defaultValue="@integer/grid_view_integer" android:defaultValue="@integer/grid_view_integer"
android:title="File explorer layout" android:title="@string/pref_file_explorer_title"
android:key="EXPLORER_VIEW_TYPE" android:key="EXPLORER_VIEW_TYPE"
android:summary="View files as a grid or in a list." /> android:summary="@string/pref_viewmode_summary" />
<CheckBoxPreference <CheckBoxPreference
android:title="@string/pref_show_hidden_files" android:title="@string/pref_show_hidden_files"
android:key="ENABLE_SHOW_HIDDEN_FILES" android:key="ENABLE_SHOW_HIDDEN_FILES"
......
...@@ -279,8 +279,8 @@ class FormattingController implements View.OnClickListener { ...@@ -279,8 +279,8 @@ class FormattingController implements View.OnClickListener {
npColNegative.setOnClickListener(negativeButtonClickListener); npColNegative.setOnClickListener(negativeButtonClickListener);
insertTableBuilder.setView(numberPicker); insertTableBuilder.setView(numberPicker);
insertTableBuilder.setNeutralButton("Cancel", null); insertTableBuilder.setNeutralButton(R.string.alert_cancel, null);
insertTableBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { insertTableBuilder.setPositiveButton(R.string.alert_ok, new DialogInterface.OnClickListener() {
@Override @Override
public void onClick(DialogInterface dialog, int which) { public void onClick(DialogInterface dialog, int which) {
...@@ -346,7 +346,7 @@ class FormattingController implements View.OnClickListener { ...@@ -346,7 +346,7 @@ class FormattingController implements View.OnClickListener {
private void deleteTable() { private void deleteTable() {
AlertDialog.Builder deleteBuilder = new AlertDialog.Builder(mContext); AlertDialog.Builder deleteBuilder = new AlertDialog.Builder(mContext);
deleteBuilder.setTitle(R.string.select_delete_options); deleteBuilder.setTitle(R.string.select_delete_options);
deleteBuilder.setNeutralButton("Cancel",null); deleteBuilder.setNeutralButton(R.string.alert_cancel,null);
final int[] selectedItem = new int[1]; final int[] selectedItem = new int[1];
deleteBuilder.setSingleChoiceItems(mContext.getResources().getStringArray(R.array.deleterowcolumns), -1, new DialogInterface.OnClickListener() { deleteBuilder.setSingleChoiceItems(mContext.getResources().getStringArray(R.array.deleterowcolumns), -1, new DialogInterface.OnClickListener() {
@Override @Override
...@@ -354,7 +354,7 @@ class FormattingController implements View.OnClickListener { ...@@ -354,7 +354,7 @@ class FormattingController implements View.OnClickListener {
selectedItem[0] = which; selectedItem[0] = which;
} }
}); });
deleteBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { deleteBuilder.setPositiveButton(R.string.alert_ok, new DialogInterface.OnClickListener() {
@Override @Override
public void onClick(DialogInterface dialog, int which) { public void onClick(DialogInterface dialog, int which) {
switch (selectedItem[0]){ switch (selectedItem[0]){
......
...@@ -232,24 +232,24 @@ public class LibreOfficeMainActivity extends AppCompatActivity implements Settin ...@@ -232,24 +232,24 @@ public class LibreOfficeMainActivity extends AppCompatActivity implements Settin
TabHost host = findViewById(R.id.toolbarTabHost); TabHost host = findViewById(R.id.toolbarTabHost);
host.setup(); 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.setContent(R.id.tab_character);
spec.setIndicator("Character"); spec.setIndicator(getString(R.string.tabhost_character));
host.addTab(spec); host.addTab(spec);
spec = host.newTabSpec("Paragraph"); spec = host.newTabSpec(getString(R.string.tabhost_paragraph));
spec.setContent(R.id.tab_paragraph); spec.setContent(R.id.tab_paragraph);
spec.setIndicator("Paragraph"); spec.setIndicator(getString(R.string.tabhost_paragraph));
host.addTab(spec); host.addTab(spec);
spec = host.newTabSpec("Insert"); spec = host.newTabSpec(getString(R.string.tabhost_insert));
spec.setContent(R.id.tab_insert); spec.setContent(R.id.tab_insert);
spec.setIndicator("Insert"); spec.setIndicator(getString(R.string.tabhost_insert));
host.addTab(spec); host.addTab(spec);
spec = host.newTabSpec("Style"); spec = host.newTabSpec(getString(R.string.tabhost_style));
spec.setContent(R.id.tab_style); spec.setContent(R.id.tab_style);
spec.setIndicator("Style"); spec.setIndicator(getString(R.string.tabhost_style));
host.addTab(spec); host.addTab(spec);
LinearLayout bottomToolbarLayout = findViewById(R.id.toolbar_bottom); LinearLayout bottomToolbarLayout = findViewById(R.id.toolbar_bottom);
...@@ -753,13 +753,13 @@ public class LibreOfficeMainActivity extends AppCompatActivity implements Settin ...@@ -753,13 +753,13 @@ public class LibreOfficeMainActivity extends AppCompatActivity implements Settin
input.setInputType(InputType.TYPE_CLASS_TEXT); input.setInputType(InputType.TYPE_CLASS_TEXT);
builder.setView(input); builder.setView(input);
builder.setPositiveButton("OK", new DialogInterface.OnClickListener() { builder.setPositiveButton(R.string.alert_ok, new DialogInterface.OnClickListener() {
@Override @Override
public void onClick(DialogInterface dialog, int which) { public void onClick(DialogInterface dialog, int which) {
mTileProvider.renamePart( input.getText().toString()); mTileProvider.renamePart( input.getText().toString());
} }
}); });
builder.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { builder.setNegativeButton(R.string.alert_cancel, new DialogInterface.OnClickListener() {
@Override @Override
public void onClick(DialogInterface dialog, int which) { public void onClick(DialogInterface dialog, int which) {
dialog.cancel(); dialog.cancel();
......
...@@ -63,7 +63,7 @@ class UNOCommandsController implements View.OnClickListener { ...@@ -63,7 +63,7 @@ class UNOCommandsController implements View.OnClickListener {
private void showCommandDialog() { private void showCommandDialog() {
try { try {
AlertDialog dialog = new AlertDialog.Builder(mActivity) AlertDialog dialog = new AlertDialog.Builder(mActivity)
.setTitle("Current UNO command") .setTitle(R.string.current_uno_command)
.setMessage(mRootJSON.toString(2)) .setMessage(mRootJSON.toString(2))
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) { public void onClick(DialogInterface dialog, int which) {
......
...@@ -124,7 +124,7 @@ public class DirectoryBrowserFragment extends Fragment { ...@@ -124,7 +124,7 @@ public class DirectoryBrowserFragment extends Fragment {
private void changeDirectory(File destination) { private void changeDirectory(File destination) {
if(destination == null) { 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(); .show();
} else { } else {
Fragment fragment = DirectoryBrowserFragment.newInstance(destination.toURI().toString()); 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