summaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
authorMert Tumer <merttumer@outlook.com>2018-09-18 15:56:39 +0300
committerTomaž Vajngerl <quikee@gmail.com>2018-10-06 09:27:33 +0200
commit897b393ee516f1d731996ac9058edb828d1f8caf (patch)
tree0909201998a50d27c2fdac745e8558047f85c1c1 /android
parent315e585f283e6e4a5f1ac11e7d17a638d04e82b0 (diff)
Extract hardcoded strings to string resource file on Android Viewer
Change-Id: Ie2276ac162062e7365c9605f98fe03e5011ba6cb Signed-off-by: Mert Tumer <merttumer@outlook.com> Reviewed-on: https://gerrit.libreoffice.org/60688 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'android')
-rw-r--r--android/source/res/values/arrays.xml22
-rw-r--r--android/source/res/values/strings.xml14
-rw-r--r--android/source/res/xml/libreoffice_preferences.xml14
-rw-r--r--android/source/src/java/org/libreoffice/FormattingController.java8
-rw-r--r--android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java20
-rw-r--r--android/source/src/java/org/libreoffice/UNOCommandsController.java2
-rw-r--r--android/source/src/java/org/libreoffice/storage/external/DirectoryBrowserFragment.java2
7 files changed, 49 insertions, 33 deletions
diff --git a/android/source/res/values/arrays.xml b/android/source/res/values/arrays.xml
index 671424bfd13b..f2326764aa76 100644
--- a/android/source/res/values/arrays.xml
+++ b/android/source/res/values/arrays.xml
@@ -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>
diff --git a/android/source/res/values/strings.xml b/android/source/res/values/strings.xml
index 17e52316bdb4..457d10b40af8 100644
--- a/android/source/res/values/strings.xml
+++ b/android/source/res/values/strings.xml
@@ -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>
diff --git a/android/source/res/xml/libreoffice_preferences.xml b/android/source/res/xml/libreoffice_preferences.xml
index 2b3d9dde2f57..3bc04d769278 100644
--- a/android/source/res/xml/libreoffice_preferences.xml
+++ b/android/source/res/xml/libreoffice_preferences.xml
@@ -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"
diff --git a/android/source/src/java/org/libreoffice/FormattingController.java b/android/source/src/java/org/libreoffice/FormattingController.java
index 7fe538c0e555..691c3d06513f 100644
--- a/android/source/src/java/org/libreoffice/FormattingController.java
+++ b/android/source/src/java/org/libreoffice/FormattingController.java
@@ -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]){
diff --git a/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java b/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java
index b3e00fc40840..20135beb1084 100644
--- a/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java
+++ b/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java
@@ -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();
diff --git a/android/source/src/java/org/libreoffice/UNOCommandsController.java b/android/source/src/java/org/libreoffice/UNOCommandsController.java
index e61d3266ac1c..9453b3bd07b7 100644
--- a/android/source/src/java/org/libreoffice/UNOCommandsController.java
+++ b/android/source/src/java/org/libreoffice/UNOCommandsController.java
@@ -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) {
diff --git a/android/source/src/java/org/libreoffice/storage/external/DirectoryBrowserFragment.java b/android/source/src/java/org/libreoffice/storage/external/DirectoryBrowserFragment.java
index cf71691cce2a..18165650a617 100644
--- a/android/source/src/java/org/libreoffice/storage/external/DirectoryBrowserFragment.java
+++ b/android/source/src/java/org/libreoffice/storage/external/DirectoryBrowserFragment.java
@@ -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());