From ed21000b3bf569130c795a4115c130fdc277c72b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tomasz=20P=C3=B3=C5=82grabia?= <tomasz.polgrabia@gmail.com>
Date: Tue, 20 Sep 2016 21:11:26 +0200
Subject: [PATCH] Extracting strings to xml translation file to allow easy
 translation (i18n).

---
 .../res/layout/fragment_panoramio_shower.xml  | 10 ++--
 .../res/layout/fragment_wiki_locations.xml    |  2 +-
 app/src/main/res/layout/location_item.xml     |  2 +-
 .../main/res/layout/wiki_locations_item.xml   |  4 +-
 app/src/main/res/values/strings.xml           | 36 ++++++++++++
 app/src/main/res/xml/urban_expl_settings.xml  | 56 +++++++++----------
 6 files changed, 73 insertions(+), 37 deletions(-)

diff --git a/app/src/main/res/layout/fragment_panoramio_shower.xml b/app/src/main/res/layout/fragment_panoramio_shower.xml
index 8ddaac0..9d6c848 100644
--- a/app/src/main/res/layout/fragment_panoramio_shower.xml
+++ b/app/src/main/res/layout/fragment_panoramio_shower.xml
@@ -19,7 +19,7 @@
                           android:layout_height="wrap_content">
                 <TextView android:layout_width="wrap_content"
                           android:layout_height="wrap_content"
-                          android:text="Title: "/>
+                          android:text="@string/title_label"/>
 
                 <TextView android:id="@+id/photo_title"
                           android:layout_width="wrap_content"
@@ -30,7 +30,7 @@
                           android:layout_height="wrap_content">
                 <TextView android:layout_width="wrap_content"
                           android:layout_height="wrap_content"
-                          android:text="Author: "/>
+                          android:text="@string/author_label"/>
 
                 <TextView android:id="@+id/photo_author"
                           android:layout_width="wrap_content"
@@ -41,7 +41,7 @@
                           android:layout_height="wrap_content">
                 <TextView android:layout_width="wrap_content"
                           android:layout_height="wrap_content"
-                          android:text="Upload date: "/>
+                          android:text="@string/upload_date_label"/>
 
                 <TextView android:id="@+id/photo_upload"
                           android:layout_width="wrap_content"
@@ -52,7 +52,7 @@
                           android:layout_height="wrap_content">
                 <TextView android:layout_width="wrap_content"
                           android:layout_height="wrap_content"
-                          android:text="Location: "/>
+                          android:text="@string/location_label"/>
 
                 <TextView android:id="@+id/photo_location"
                           android:layout_width="wrap_content"
@@ -64,7 +64,7 @@
                           android:layout_height="wrap_content">
                 <TextView android:layout_width="wrap_content"
                           android:layout_height="wrap_content"
-                          android:text="Panoramio url"/>
+                          android:text="@string/panoramio_url"/>
 
                 <TextView android:id="@+id/photo_url"
                           android:layout_width="wrap_content"
diff --git a/app/src/main/res/layout/fragment_wiki_locations.xml b/app/src/main/res/layout/fragment_wiki_locations.xml
index 0f0aa8a..08f4a65 100644
--- a/app/src/main/res/layout/fragment_wiki_locations.xml
+++ b/app/src/main/res/layout/fragment_wiki_locations.xml
@@ -7,7 +7,7 @@
     <TextView android:id="@+id/wiki_current_location"
               android:layout_width="wrap_content"
               android:layout_height="wrap_content"
-              android:text="Location:"/>
+              android:text="@string/location_label"/>
 
     <ListView android:id="@+id/wiki_places"
               android:layout_width="match_parent"
diff --git a/app/src/main/res/layout/location_item.xml b/app/src/main/res/layout/location_item.xml
index f1473f8..492b619 100644
--- a/app/src/main/res/layout/location_item.xml
+++ b/app/src/main/res/layout/location_item.xml
@@ -14,6 +14,6 @@
             android:id="@+id/location_description"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:text="Test"/>
+            android:text="@string/test_string"/>
 
 </LinearLayout>
\ No newline at end of file
diff --git a/app/src/main/res/layout/wiki_locations_item.xml b/app/src/main/res/layout/wiki_locations_item.xml
index 83c7d27..71e132f 100644
--- a/app/src/main/res/layout/wiki_locations_item.xml
+++ b/app/src/main/res/layout/wiki_locations_item.xml
@@ -18,12 +18,12 @@
         <TextView android:id="@+id/wiki_locs_item_title"
                   android:layout_width="wrap_content"
                   android:layout_height="wrap_content"
-                  android:text="Fill Title" />
+                  android:text="@string/wiki_location_fill_title" />
 
         <TextView android:id="@+id/wiki_locs_item_distance"
                   android:layout_width="wrap_content"
                   android:layout_height="wrap_content"
-                  android:text="Fill Distance" />
+                  android:text="@string/wiki_location_fill_distance" />
 
 
     </LinearLayout>
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 8d503ce..85c9f02 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -107,4 +107,40 @@
     </string>
     <string name="refresh">Refresh</string>
     <string name="settings">Settings</string>
+    <string name="test_string">Test string</string>
+    <string name="wiki_location_fill_title">Fill Title</string>
+    <string name="wiki_location_fill_distance">Fill Distance</string>
+    <string name="panoramio_search_settings">Panoramio search settings</string>
+    <string name="panoramio_radiusx_title">Radius X</string>
+    <string name="panoramio_radiusx_summary">Radius X</string>
+    <string name="panoramio_radiusy_title">Radius Y</string>
+    <string name="panoramio_radiusy_summary">Radius Y</string>
+    <string name="panoramio_bulk_size_title">Panoramio bulk size</string>
+    <string name="panoramio_bulk_size_summary">Panoramio bulk size</string>
+    <string name="wiki_search_settings">Wiki search settings</string>
+    <string name="wiki_search_radius_title">Wiki search radius</string>
+    <string name="wiki_search_radius_summary">Wiki search radius[km]</string>
+    <string name="wiki_search_results_limit_title">Wiki search results limit</string>
+    <string name="wiki_search_results_limit_summary">Limit of wiki results</string>
+    <string name="location_tracking_settings">GPS tracking settings</string>
+    <string name="location_update_time_freq_title">GPS update frequency</string>
+    <string name="location_update_time_freq_summary">Update time of GPS location in minutes</string>
+    <string name="location_update_distance_freq_title">GPS distance frequency</string>
+    <string name="location_update_distance_freq_summary">Update distance of GPS location in meters</string>
+    <string name="network_proxy_settings">Network proxy settings</string>
+    <string name="http_proxy_is_enabled_title">Proxy enabled</string>
+    <string name="http_proxy_is_enabled_summary">Proxy enabled</string>
+    <string name="http_proxy_host_title">Proxy host</string>
+    <string name="http_proxy_host_summary">Proxy host</string>
+    <string name="http_proxy_port_title">Proxy port</string>
+    <string name="http_proxy_port_summary">Proxy port</string>
+    <string name="http_proxy_user_title">Proxy user</string>
+    <string name="http_proxy_user_summary">Proxy user</string>
+    <string name="http_proxy_password_title">Proxy password</string>
+    <string name="http_proxy_password_summary">Proxy password</string>
+    <string name="title_label">Title:</string>
+    <string name="author_label">Author:</string>
+    <string name="upload_date_label">Upload date:</string>
+    <string name="location_label">Location:</string>
+    <string name="panoramio_url">Panoramio url:</string>
 </resources>
diff --git a/app/src/main/res/xml/urban_expl_settings.xml b/app/src/main/res/xml/urban_expl_settings.xml
index 8f57e0a..3c42f20 100644
--- a/app/src/main/res/xml/urban_expl_settings.xml
+++ b/app/src/main/res/xml/urban_expl_settings.xml
@@ -2,67 +2,67 @@
 <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
 
     <PreferenceCategory
-        android:title="Panoramio search settings"
+        android:title="@string/panoramio_search_settings"
         android:key="pref_panoramio_settings">
 
         <EditTextPreference
                 android:key="pref_panoramio_radiusx"
-                android:title="Radius X"
-                android:summary="Radius X"
+                android:title="@string/panoramio_radiusx_title"
+                android:summary="@string/panoramio_radiusx_summary"
                 android:defaultValue="0.05"
                 android:inputType="numberDecimal" />
 
         <EditTextPreference
                 android:key="pref_panoramio_radiusy"
-                android:title="Radius Y"
-                android:summary="Radius Y"
+                android:title="@string/panoramio_radiusy_title"
+                android:summary="@string/panoramio_radiusy_summary"
                 android:defaultValue="0.05"
                 android:inputType="numberDecimal" />
 
         <EditTextPreference
                 android:key="pref_panoramio_bulk_size"
-                android:title="Radius Y"
-                android:summary="Radius Y"
+                android:title="@string/panoramio_bulk_size_title"
+                android:summary="@string/panoramio_bulk_size_summary"
                 android:defaultValue="50"
                 android:inputType="number" />
 
     </PreferenceCategory>
 
     <PreferenceCategory
-            android:title="Wiki search settings"
+            android:title="@string/wiki_search_settings"
             android:key="pref_wiki_settings">
 
         <EditTextPreference
                 android:key="pref_wiki_radius"
-                android:title="Wiki search radius"
-                android:summary="Wiki search radius[km]"
+                android:title="@string/wiki_search_radius_title"
+                android:summary="@string/wiki_search_radius_summary"
                 android:defaultValue="10.0"
                 android:inputType="numberDecimal" />
 
         <EditTextPreference
                 android:key="pref_wiki_limit"
-                android:title="Wiki search results limit"
-                android:summary="Limit of wiki results"
+                android:title="@string/wiki_search_results_limit_title"
+                android:summary="@string/wiki_search_results_limit_summary"
                 android:defaultValue="100"
                 android:inputType="number" />
 
     </PreferenceCategory>
 
     <PreferenceCategory
-            android:title="GPS tracking settings"
+            android:title="@string/location_tracking_settings"
             android:key="pref_gps_settings">
 
         <EditTextPreference
                 android:key="pref_gps_update_freq"
-                android:title="GPS update frequency"
-                android:summary="Update time of GPS location in minutes"
+                android:title="@string/location_update_time_freq_title"
+                android:summary="@string/location_update_time_freq_summary"
                 android:defaultValue="15.0"
                 android:inputType="numberDecimal" />
 
         <EditTextPreference
                 android:key="pref_gps_distance_freq"
-                android:title="GPS distance frequency"
-                android:summary="Update distance of GPS location in meters"
+                android:title="@string/location_update_distance_freq_title"
+                android:summary="@string/location_update_distance_freq_summary"
                 android:defaultValue="100.0"
                 android:inputType="numberDecimal" />
 
@@ -70,40 +70,40 @@
     </PreferenceCategory>
 
     <PreferenceCategory
-            android:title="Network proxy settings"
+            android:title="@string/network_proxy_settings"
             android:key="pref_proxy_settings">
 
         <CheckBoxPreference
             android:key="pref_proxy_enabled"
-            android:title="Proxy enabled"
-            android:summary="Proxy enabled" />
+            android:title="@string/http_proxy_is_enabled_title"
+            android:summary="@string/http_proxy_is_enabled_summary" />
 
         <EditTextPreference
                 android:key="pref_proxy_host"
-                android:title="Proxy host"
-                android:summary="Proxy host"
+                android:title="@string/http_proxy_host_title"
+                android:summary="@string/http_proxy_host_summary"
                 android:defaultValue="localhost"
                 android:dependency="pref_proxy_enabled" />
 
         <EditTextPreference
                 android:key="pref_proxy_port"
-                android:title="Proxy port"
-                android:summary="Proxy port"
+                android:title="@string/http_proxy_port_title"
+                android:summary="@string/http_proxy_port_summary"
                 android:defaultValue="8123"
                 android:inputType="number"
                 android:dependency="pref_proxy_enabled" />
 
         <EditTextPreference
                 android:key="pref_proxy_user"
-                android:title="Proxy user"
-                android:summary="Proxy user"
+                android:title="@string/http_proxy_user_title"
+                android:summary="@string/http_proxy_user_summary"
                 android:defaultValue=""
                 android:dependency="pref_proxy_enabled" />
 
         <EditTextPreference
                 android:key="pref_proxy_pass"
-                android:title="Proxy password"
-                android:summary="Proxy password"
+                android:title="@string/http_proxy_password_title"
+                android:summary="@string/http_proxy_password_summary"
                 android:defaultValue=""
                 android:inputType="textPassword"
                 android:dependency="pref_proxy_enabled" />