Ver código fonte

Changed default language to spanish. Improved language detection and date localization.

seavenois 10 anos atrás
pai
commit
e22c94a78b

+ 5 - 9
app/src/main/java/com/ivalentin/margolariak/ActivityFutureLayout.java

@@ -55,9 +55,8 @@ public class ActivityFutureLayout extends Fragment implements OnMapReadyCallback
 	private MapView mapView;
 	private MapView mapView;
 	private GoogleMap map;
 	private GoogleMap map;
 	private LatLng location;
 	private LatLng location;
-	private View view;
 	private String markerName = "";
 	private String markerName = "";
-	private Bundle bund;
+	private Bundle bund = null;
 
 
 	@SuppressWarnings("ResultOfMethodCallIgnored")
 	@SuppressWarnings("ResultOfMethodCallIgnored")
     @SuppressLint("InflateParams")
     @SuppressLint("InflateParams")
@@ -78,12 +77,9 @@ public class ActivityFutureLayout extends Fragment implements OnMapReadyCallback
         //Get data from database
         //Get data from database
         SQLiteDatabase db = getActivity().openOrCreateDatabase(GM.DB_NAME, Context.MODE_PRIVATE, null);
         SQLiteDatabase db = getActivity().openOrCreateDatabase(GM.DB_NAME, Context.MODE_PRIVATE, null);
         final Cursor cursor;
         final Cursor cursor;
-        String currLang = Locale.getDefault().getDisplayLanguage();
-        if (!currLang.equals("es") && !currLang.equals("eu")){
-            currLang = "en";
-        }
+		String lang = GM.getLang();
 
 
-        cursor = db.rawQuery("SELECT id, title_" + currLang+ " AS title, text_" + currLang + " AS text, date, city, price FROM activity WHERE id = " + id + ";", null);
+        cursor = db.rawQuery("SELECT id, title_" + lang+ " AS title, text_" + lang + " AS text, date, city, price FROM activity WHERE id = " + id + ";", null);
         cursor.moveToFirst();
         cursor.moveToFirst();
 
 
         //Get display elements
         //Get display elements
@@ -104,7 +100,7 @@ public class ActivityFutureLayout extends Fragment implements OnMapReadyCallback
         tvTitle.setText(cursor.getString(1));
         tvTitle.setText(cursor.getString(1));
         ((MainActivity) getActivity()).setSectionTitle(cursor.getString(1));
         ((MainActivity) getActivity()).setSectionTitle(cursor.getString(1));
         wvText.loadDataWithBaseURL(null, cursor.getString(2), "text/html", "utf-8", null);
         wvText.loadDataWithBaseURL(null, cursor.getString(2), "text/html", "utf-8", null);
-        tvDate.setText(GM.formatDate(cursor.getString(3) + " 00:00:00", currLang, false));
+        tvDate.setText(GM.formatDate(cursor.getString(3) + " 00:00:00", lang, false));
         tvPrice.setText(String.format(getString(R.string.price), cursor.getInt(5)));
         tvPrice.setText(String.format(getString(R.string.price), cursor.getInt(5)));
         tvCity.setText(cursor.getString(4));
         tvCity.setText(cursor.getString(4));
 
 
@@ -137,7 +133,7 @@ public class ActivityFutureLayout extends Fragment implements OnMapReadyCallback
         cursor.close();
         cursor.close();
 
 
         //Get itinerary
         //Get itinerary
-        Cursor cursorItinerary = db.rawQuery("SELECT activity_itinerary.id, activity_itinerary.name_" + currLang + " AS name, description_" + currLang + " AS description, start, place.name_" + currLang + " AS placename, address_" + currLang + " AS address, lat, lon FROM activity_itinerary, place WHERE activity_itinerary.place = place.id AND activity = " + id + ";", null);
+        Cursor cursorItinerary = db.rawQuery("SELECT activity_itinerary.id, activity_itinerary.name_" + lang + " AS name, description_" + lang + " AS description, start, place.name_" + lang + " AS placename, address_" + lang + " AS address, lat, lon FROM activity_itinerary, place WHERE activity_itinerary.place = place.id AND activity = " + id + ";", null);
         if (cursorItinerary.getCount() <= 0){
         if (cursorItinerary.getCount() <= 0){
             LinearLayout sch = (LinearLayout) view.findViewById(R.id.ll_activity_future_schedule);
             LinearLayout sch = (LinearLayout) view.findViewById(R.id.ll_activity_future_schedule);
             sch.setVisibility(View.GONE);
             sch.setVisibility(View.GONE);

+ 5 - 8
app/src/main/java/com/ivalentin/margolariak/ActivityLayout.java

@@ -75,13 +75,10 @@ public class ActivityLayout extends Fragment{
 
 
         SQLiteDatabase db = getActivity().openOrCreateDatabase(GM.DB_NAME, Context.MODE_PRIVATE, null);
         SQLiteDatabase db = getActivity().openOrCreateDatabase(GM.DB_NAME, Context.MODE_PRIVATE, null);
         final Cursor cursor;
         final Cursor cursor;
-        String currLang = Locale.getDefault().getDisplayLanguage();
-        if (!currLang.equals("es") && !currLang.equals("eu")){
-            currLang = "en";
-        }
+        String lang = GM.getLang();
 
 
         //Get data from the database of the future activities
         //Get data from the database of the future activities
-        cursor = db.rawQuery("SELECT id, date, city, title_" + currLang+ " AS title, text_" + currLang + " AS text, price FROM activity WHERE date >= date('now') ORDER BY date DESC;", null);
+        cursor = db.rawQuery("SELECT id, date, city, title_" + lang+ " AS title, text_" + lang + " AS text, price FROM activity WHERE date >= date('now') ORDER BY date DESC;", null);
         if (cursor.getCount() > 0) {
         if (cursor.getCount() > 0) {
             TextView tvNoFuture = (TextView) view.findViewById(R.id.tv_activities_no_future);
             TextView tvNoFuture = (TextView) view.findViewById(R.id.tv_activities_no_future);
             tvNoFuture.setVisibility(View.GONE);
             tvNoFuture.setVisibility(View.GONE);
@@ -118,7 +115,7 @@ public class ActivityLayout extends Fragment{
 
 
                 //Set date
                 //Set date
                 TextView tvDate = (TextView) entry.findViewById(R.id.tv_row_activity_future_date);
                 TextView tvDate = (TextView) entry.findViewById(R.id.tv_row_activity_future_date);
-                tvDate.setText(GM.formatDate(cursor.getString(1) + " 00:00:00", currLang, false));
+                tvDate.setText(GM.formatDate(cursor.getString(1) + " 00:00:00", lang, false));
 
 
                 //Set hidden id
                 //Set hidden id
                 TextView tvId = (TextView) entry.findViewById(R.id.tv_row_activity_future_hidden);
                 TextView tvId = (TextView) entry.findViewById(R.id.tv_row_activity_future_hidden);
@@ -177,7 +174,7 @@ public class ActivityLayout extends Fragment{
         }
         }
 
 
         //Get data from the database of the past activities
         //Get data from the database of the past activities
-        Cursor cursorPast = db.rawQuery("SELECT id, date, city, title_" + currLang + " AS title, text_" + currLang + " AS text, after_" + currLang + " AS after FROM activity WHERE date < date('now') ORDER BY date DESC;", null);
+        Cursor cursorPast = db.rawQuery("SELECT id, date, city, title_" + lang + " AS title, text_" + lang + " AS text, after_" + lang + " AS after FROM activity WHERE date < date('now') ORDER BY date DESC;", null);
 
 
 
 
         //Print rows
         //Print rows
@@ -210,7 +207,7 @@ public class ActivityLayout extends Fragment{
 
 
             //Set date
             //Set date
             TextView tvDate = (TextView) entry.findViewById(R.id.tv_row_activity_past_date);
             TextView tvDate = (TextView) entry.findViewById(R.id.tv_row_activity_past_date);
-            tvDate.setText(GM.formatDate(cursorPast.getString(1) + " 00:00:00", currLang, false));
+            tvDate.setText(GM.formatDate(cursorPast.getString(1) + " 00:00:00", lang, false));
 
 
             //Set hidden id
             //Set hidden id
             TextView tvId = (TextView) entry.findViewById(R.id.tv_row_activity_past_hidden);
             TextView tvId = (TextView) entry.findViewById(R.id.tv_row_activity_past_hidden);

+ 3 - 6
app/src/main/java/com/ivalentin/margolariak/ActivityPastLayout.java

@@ -50,11 +50,8 @@ public class ActivityPastLayout extends Fragment {
         //Get data from database
         //Get data from database
         SQLiteDatabase db = getActivity().openOrCreateDatabase(GM.DB_NAME, Context.MODE_PRIVATE, null);
         SQLiteDatabase db = getActivity().openOrCreateDatabase(GM.DB_NAME, Context.MODE_PRIVATE, null);
         final Cursor cursor;
         final Cursor cursor;
-        String currLang = Locale.getDefault().getDisplayLanguage();
-        if (!currLang.equals("es") && !currLang.equals("eu")){
-            currLang = "en";
-        }
-        cursor = db.rawQuery("SELECT id, title_" + currLang+ " AS title, text_" + currLang + " AS text, date, city, after_" + currLang + " AS after FROM activity WHERE id = " + id + ";", null);
+        String lang = GM.getLang();
+        cursor = db.rawQuery("SELECT id, title_" + lang+ " AS title, text_" + lang + " AS text, date, city, after_" + lang + " AS after FROM activity WHERE id = " + id + ";", null);
         cursor.moveToFirst();
         cursor.moveToFirst();
 
 
         //Get display elements
         //Get display elements
@@ -79,7 +76,7 @@ public class ActivityPastLayout extends Fragment {
         else{
         else{
             wvText.loadDataWithBaseURL(null, cursor.getString(5), "text/html", "utf-8", null);
             wvText.loadDataWithBaseURL(null, cursor.getString(5), "text/html", "utf-8", null);
         }
         }
-        tvDate.setText(GM.formatDate(cursor.getString(3) + " 00:00:00", currLang, false));
+        tvDate.setText(GM.formatDate(cursor.getString(3) + " 00:00:00", lang, false));
         tvCity.setText(cursor.getString(4));
         tvCity.setText(cursor.getString(4));
 
 
         //Get images
         //Get images

+ 3 - 7
app/src/main/java/com/ivalentin/margolariak/AlbumLayout.java

@@ -20,7 +20,6 @@ import android.widget.LinearLayout;
 import android.widget.TextView;
 import android.widget.TextView;
 
 
 import java.io.File;
 import java.io.File;
-import java.util.Locale;
 
 
 /**
 /**
  * Fragment to display photos of a selected album.
  * Fragment to display photos of a selected album.
@@ -54,11 +53,8 @@ public class AlbumLayout extends Fragment {
         //Get data from database
         //Get data from database
         SQLiteDatabase db = getActivity().openOrCreateDatabase(GM.DB_NAME, Context.MODE_PRIVATE, null);
         SQLiteDatabase db = getActivity().openOrCreateDatabase(GM.DB_NAME, Context.MODE_PRIVATE, null);
         final Cursor cursor;
         final Cursor cursor;
-        String currLang = Locale.getDefault().getDisplayLanguage();
-        if (!currLang.equals("es") && !currLang.equals("eu")){
-            currLang = "en";
-        }
-        cursor = db.rawQuery("SELECT id, name_" + currLang + " AS name, description_" + currLang + " AS description FROM album WHERE id = " + id + ";", null);
+		String lang = GM.getLang();
+        cursor = db.rawQuery("SELECT id, name_" + lang + " AS name, description_" + lang + " AS description FROM album WHERE id = " + id + ";", null);
         cursor.moveToFirst();
         cursor.moveToFirst();
 
 
         //Set album elements
         //Set album elements
@@ -83,7 +79,7 @@ public class AlbumLayout extends Fragment {
         LayoutInflater factory = LayoutInflater.from(getActivity());
         LayoutInflater factory = LayoutInflater.from(getActivity());
 
 
         String image;
         String image;
-        Cursor imageCursor = db.rawQuery("SELECT id, title_" + currLang + " AS title, file, width, height FROM photo, photo_album WHERE photo = id AND album = " + id + " ORDER BY uploaded DESC;", null);
+        Cursor imageCursor = db.rawQuery("SELECT id, title_" + lang + " AS title, file, width, height FROM photo, photo_album WHERE photo = id AND album = " + id + " ORDER BY uploaded DESC;", null);
         while (imageCursor.moveToNext()){
         while (imageCursor.moveToNext()){
             //Create a new row
             //Create a new row
             entry = (LinearLayout) factory.inflate(R.layout.row_album, null);
             entry = (LinearLayout) factory.inflate(R.layout.row_album, null);

+ 3 - 6
app/src/main/java/com/ivalentin/margolariak/BlogLayout.java

@@ -146,13 +146,10 @@ public class BlogLayout extends Fragment{
 
 
         SQLiteDatabase db = getActivity().openOrCreateDatabase(GM.DB_NAME, Context.MODE_PRIVATE, null);
         SQLiteDatabase db = getActivity().openOrCreateDatabase(GM.DB_NAME, Context.MODE_PRIVATE, null);
         final Cursor cursor;
         final Cursor cursor;
-        String currLang = Locale.getDefault().getDisplayLanguage();
-        if (!currLang.equals("es") && !currLang.equals("eu")){
-            currLang = "en";
-        }
+        String lang = GM.getLang();
 
 
         //Get data from the database
         //Get data from the database
-        cursor = db.rawQuery("SELECT id, title_" + currLang+ " AS title, text_" + currLang + " AS text, dtime FROM post ORDER BY dtime DESC LIMIT 5 OFFSET " + offset + ";", null);
+        cursor = db.rawQuery("SELECT id, title_" + lang+ " AS title, text_" + lang + " AS text, dtime FROM post ORDER BY dtime DESC LIMIT 5 OFFSET " + offset + ";", null);
 
 
         //Clear the list
         //Clear the list
         llList.removeAllViews();
         llList.removeAllViews();
@@ -182,7 +179,7 @@ public class BlogLayout extends Fragment{
 
 
             //Set date
             //Set date
             TextView tvDate = (TextView) entry.findViewById(R.id.tv_row_blog_date);
             TextView tvDate = (TextView) entry.findViewById(R.id.tv_row_blog_date);
-            tvDate.setText(GM.formatDate(cursor.getString(3), currLang, false));
+            tvDate.setText(GM.formatDate(cursor.getString(3), lang, false));
 
 
             //Set hidden id
             //Set hidden id
             TextView tvId = (TextView) entry.findViewById(R.id.tv_row_blog_hidden);
             TextView tvId = (TextView) entry.findViewById(R.id.tv_row_blog_hidden);

+ 3 - 3
app/src/main/java/com/ivalentin/margolariak/GM.java

@@ -226,14 +226,14 @@ public final class GM {
 	public static String getLang(){
 	public static String getLang(){
 		String currLang = Locale.getDefault().getISO3Language();//getDisplayLanguage();
 		String currLang = Locale.getDefault().getISO3Language();//getDisplayLanguage();
 		switch (currLang){
 		switch (currLang){
-			case "spa":
-				currLang = "es";
+			case "eng":
+				currLang = "en";
 				break;
 				break;
 			case "eus":
 			case "eus":
 				currLang = "eu";
 				currLang = "eu";
 				break;
 				break;
 			default:
 			default:
-				currLang = "en";
+				currLang = "es";
 		}
 		}
 		return currLang;
 		return currLang;
 	}
 	}

+ 9 - 9
app/src/main/java/com/ivalentin/margolariak/GalleryLayout.java

@@ -11,6 +11,7 @@ import android.os.Bundle;
 import android.app.Fragment;
 import android.app.Fragment;
 import android.app.FragmentManager;
 import android.app.FragmentManager;
 import android.app.FragmentTransaction;
 import android.app.FragmentTransaction;
+import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.View;
 import android.view.ViewGroup;
 import android.view.ViewGroup;
@@ -19,7 +20,6 @@ import android.widget.LinearLayout;
 import android.widget.TextView;
 import android.widget.TextView;
 
 
 import java.io.File;
 import java.io.File;
-import java.util.Locale;
 
 
 /**
 /**
  * Fragment of the gallery section.
  * Fragment of the gallery section.
@@ -75,13 +75,10 @@ public class GalleryLayout extends Fragment{
 
 
         SQLiteDatabase db = getActivity().openOrCreateDatabase(GM.DB_NAME, Context.MODE_PRIVATE, null);
         SQLiteDatabase db = getActivity().openOrCreateDatabase(GM.DB_NAME, Context.MODE_PRIVATE, null);
         final Cursor cursor;
         final Cursor cursor;
-        String currLang = Locale.getDefault().getDisplayLanguage();
-        if (!currLang.equals("es") && !currLang.equals("eu")){
-            currLang = "en";
-        }
+		String lang = GM.getLang();
 
 
         //Get data from the database
         //Get data from the database
-        cursor = db.rawQuery("SELECT DISTINCT album.id AS id, album.name_" + currLang + " AS name FROM photo, album, photo_album WHERE photo.id = photo AND album.id = album ORDER BY uploaded DESC;", null);
+        cursor = db.rawQuery("SELECT DISTINCT album.id AS id, album.name_" + lang + " AS name FROM photo, album, photo_album WHERE photo.id = photo AND album.id = album ORDER BY uploaded DESC;", null);
 
 
         //Loop
         //Loop
         while (cursor.moveToNext()){
         while (cursor.moveToNext()){
@@ -110,7 +107,7 @@ public class GalleryLayout extends Fragment{
             preview[3] = (ImageView) entry.findViewById(R.id.iv_row_gallery_3);
             preview[3] = (ImageView) entry.findViewById(R.id.iv_row_gallery_3);
 
 
             //Get db rows
             //Get db rows
-            Cursor cursorImage = db.rawQuery("SELECT id, file, width, height, count(id) FROM photo, photo_album WHERE photo = id AND album = " + cursor.getString(0) + " ORDER BY random() LIMIT 4;", null);
+            Cursor cursorImage = db.rawQuery("SELECT id, file, width, height, FROM photo, photo_album WHERE photo = id AND album = " + cursor.getString(0) + " ORDER BY random() LIMIT 4;", null);
 
 
             //Loop
             //Loop
             int i = 0;
             int i = 0;
@@ -133,14 +130,17 @@ public class GalleryLayout extends Fragment{
                     new DownloadImage(GM.SERVER + "/img/galeria/miniature/" + image, this.getActivity().getFilesDir().toString() + "/img/galeria/miniature/" + image, preview[i]).execute();
                     new DownloadImage(GM.SERVER + "/img/galeria/miniature/" + image, this.getActivity().getFilesDir().toString() + "/img/galeria/miniature/" + image, preview[i]).execute();
                 }
                 }
                 i ++;
                 i ++;
+				Log.e("Image idx", "" + i);
 
 
             }
             }
 
 
             //Set photo counter
             //Set photo counter
-			cursorImage.moveToFirst();
+			Cursor cursorCounter = db.rawQuery("SELECT id FROM photo, photo_album WHERE photo = id AND album = " + cursor.getString(0) + ";", null);
             TextView tvPhotoCounter = (TextView) entry.findViewById(R.id.tv_row_gallery_counter);
             TextView tvPhotoCounter = (TextView) entry.findViewById(R.id.tv_row_gallery_counter);
-            tvPhotoCounter.setText(String.format(getResources().getQuantityString(R.plurals.gallery_photo_count, cursorImage.getInt(4), cursorImage.getInt(4))));
+            tvPhotoCounter.setText(getResources().getQuantityString(R.plurals.gallery_photo_count, cursorCounter.getColumnCount(), cursorCounter.getColumnCount()));
 
 
+			//Close cursors
+			cursorCounter.close();
             cursorImage.close();
             cursorImage.close();
 
 
             //Set onCLickListener
             //Set onCLickListener

+ 3 - 0
app/src/main/java/com/ivalentin/margolariak/HomeLayout.java

@@ -68,6 +68,9 @@ public class HomeLayout extends Fragment implements LocationListener{
 		//Load the layout.
 		//Load the layout.
 		view = inflater.inflate(R.layout.fragment_layout_home, null);
 		view = inflater.inflate(R.layout.fragment_layout_home, null);
 
 
+		//Variable to know if I need a location manager
+		boolean requestLocation = false;
+
 		//Set Location manager
 		//Set Location manager
 		//TODO: Only do this if location is required
 		//TODO: Only do this if location is required
 		locationManager = (LocationManager) view.getContext().getSystemService(Context.LOCATION_SERVICE);
 		locationManager = (LocationManager) view.getContext().getSystemService(Context.LOCATION_SERVICE);

+ 5 - 10
app/src/main/java/com/ivalentin/margolariak/PhotoLayout.java

@@ -21,7 +21,6 @@ import android.widget.TextView;
 import android.widget.Toast;
 import android.widget.Toast;
 
 
 import java.io.File;
 import java.io.File;
-import java.util.Locale;
 
 
 /**
 /**
  * Section that shows a photo of the gallery, with details and comments.
  * Section that shows a photo of the gallery, with details and comments.
@@ -37,7 +36,6 @@ public class PhotoLayout extends Fragment {
 	//Main View
 	//Main View
 	private View view;
 	private View view;
 
 
-	private String currLang;
 	private String albumName;
 	private String albumName;
 
 
 	Integer photos[];
 	Integer photos[];
@@ -160,11 +158,8 @@ public class PhotoLayout extends Fragment {
 		//Get data from database
 		//Get data from database
 		SQLiteDatabase db = getActivity().openOrCreateDatabase(GM.DB_NAME, Context.MODE_PRIVATE, null);
 		SQLiteDatabase db = getActivity().openOrCreateDatabase(GM.DB_NAME, Context.MODE_PRIVATE, null);
 		final Cursor cursor;
 		final Cursor cursor;
-		currLang = Locale.getDefault().getDisplayLanguage();
-		if (!currLang.equals("es") && !currLang.equals("eu")){
-			currLang = "en";
-		}
-		cursor = db.rawQuery("SELECT id, file, title_" + currLang+ " AS title, description_" + currLang + " AS description, uploaded, width, height, size FROM photo WHERE id = " + id + ";", null);
+		final String lang = GM.getLang();
+		cursor = db.rawQuery("SELECT id, file, title_" + lang+ " AS title, description_" + lang + " AS description, uploaded, width, height, size FROM photo WHERE id = " + id + ";", null);
 		cursor.moveToFirst();
 		cursor.moveToFirst();
 
 
 		//Get display elements
 		//Get display elements
@@ -194,7 +189,7 @@ public class PhotoLayout extends Fragment {
 		else{
 		else{
 			tvDescription.setVisibility(View.GONE);
 			tvDescription.setVisibility(View.GONE);
 		}
 		}
-		tvDate.setText(GM.formatDate(cursor.getString(4), currLang, true));
+		tvDate.setText(GM.formatDate(cursor.getString(4), lang, true));
 
 
 		//Get image
 		//Get image
 		String image = cursor.getString(1);
 		String image = cursor.getString(1);
@@ -249,7 +244,7 @@ public class PhotoLayout extends Fragment {
 			TextView tvUser = (TextView) entry.findViewById(R.id.tv_row_comment_user);
 			TextView tvUser = (TextView) entry.findViewById(R.id.tv_row_comment_user);
 			tvUser.setText(commentCursor.getString(2));
 			tvUser.setText(commentCursor.getString(2));
 			TextView tvCDate = (TextView) entry.findViewById(R.id.tv_row_comment_date);
 			TextView tvCDate = (TextView) entry.findViewById(R.id.tv_row_comment_date);
-			tvCDate.setText(GM.formatDate(commentCursor.getString(1), currLang, true));
+			tvCDate.setText(GM.formatDate(commentCursor.getString(1), lang, true));
 			TextView tvText = (TextView) entry.findViewById(R.id.tv_row_comment_text);
 			TextView tvText = (TextView) entry.findViewById(R.id.tv_row_comment_text);
 			tvText.setText(commentCursor.getString(0));
 			tvText.setText(commentCursor.getString(0));
 
 
@@ -282,7 +277,7 @@ public class PhotoLayout extends Fragment {
 			//Start async task
 			//Start async task
 			LinearLayout form = (LinearLayout) view.findViewById(R.id.ll_new_comment);
 			LinearLayout form = (LinearLayout) view.findViewById(R.id.ll_new_comment);
 			LinearLayout list = (LinearLayout) view.findViewById(R.id.ll_comment_list);
 			LinearLayout list = (LinearLayout) view.findViewById(R.id.ll_comment_list);
-			new PostComment("galeria", user, text, currLang, photoId, form, list, commentCount, tvComments, context).execute();
+			new PostComment("galeria", user, text, lang, photoId, form, list, commentCount, tvComments, context).execute();
 
 
 			}
 			}
 		});
 		});

+ 7 - 14
app/src/main/java/com/ivalentin/margolariak/PostLayout.java

@@ -37,9 +37,7 @@ public class PostLayout extends Fragment {
     //Main View
     //Main View
     private View view;
     private View view;
 
 
-    String currLang;
-
-    Context context;
+    private Context context;
 
 
     @SuppressLint("InflateParams") //Throws unknown error when done properly.
     @SuppressLint("InflateParams") //Throws unknown error when done properly.
     @SuppressWarnings("ResultOfMethodCallIgnored")
     @SuppressWarnings("ResultOfMethodCallIgnored")
@@ -61,11 +59,8 @@ public class PostLayout extends Fragment {
         //Get data from database
         //Get data from database
         SQLiteDatabase db = getActivity().openOrCreateDatabase(GM.DB_NAME, Context.MODE_PRIVATE, null);
         SQLiteDatabase db = getActivity().openOrCreateDatabase(GM.DB_NAME, Context.MODE_PRIVATE, null);
         final Cursor cursor;
         final Cursor cursor;
-        currLang = Locale.getDefault().getDisplayLanguage();
-        if (!currLang.equals("es") && !currLang.equals("eu")){
-            currLang = "en";
-        }
-        cursor = db.rawQuery("SELECT id, title_" + currLang+ " AS title, text_" + currLang + " AS text, dtime FROM post WHERE id = " + id + ";", null);
+        String lang = GM.getLang();
+        cursor = db.rawQuery("SELECT id, title_" + lang+ " AS title, text_" + lang + " AS text, dtime FROM post WHERE id = " + id + ";", null);
         cursor.moveToFirst();
         cursor.moveToFirst();
 
 
         //Get display elements
         //Get display elements
@@ -86,10 +81,7 @@ public class PostLayout extends Fragment {
         tvTitle.setText(cursor.getString(1));
         tvTitle.setText(cursor.getString(1));
         ((MainActivity) getActivity()).setSectionTitle(cursor.getString(1));
         ((MainActivity) getActivity()).setSectionTitle(cursor.getString(1));
         wvText.loadDataWithBaseURL(null, cursor.getString(2), "text/html", "utf-8", null);
         wvText.loadDataWithBaseURL(null, cursor.getString(2), "text/html", "utf-8", null);
-        tvDate.setText(GM.formatDate(cursor.getString(3), currLang, true));
-
-        //Close the cursor
-        //cursor.close();
+        tvDate.setText(GM.formatDate(cursor.getString(3), lang, true));
 
 
         //Get images
         //Get images
         Cursor imageCursor = db.rawQuery("SELECT image, idx FROM post_image WHERE post = " + id + " ORDER BY idx LIMIT 5;", null);
         Cursor imageCursor = db.rawQuery("SELECT image, idx FROM post_image WHERE post = " + id + " ORDER BY idx LIMIT 5;", null);
@@ -131,7 +123,7 @@ public class PostLayout extends Fragment {
             TextView tvUser = (TextView) entry.findViewById(R.id.tv_row_comment_user);
             TextView tvUser = (TextView) entry.findViewById(R.id.tv_row_comment_user);
             tvUser.setText(commentCursor.getString(2));
             tvUser.setText(commentCursor.getString(2));
             TextView tvCDate = (TextView) entry.findViewById(R.id.tv_row_comment_date);
             TextView tvCDate = (TextView) entry.findViewById(R.id.tv_row_comment_date);
-            tvCDate.setText(GM.formatDate(commentCursor.getString(1), currLang, true));
+            tvCDate.setText(GM.formatDate(commentCursor.getString(1), lang, true));
             TextView tvText = (TextView) entry.findViewById(R.id.tv_row_comment_text);
             TextView tvText = (TextView) entry.findViewById(R.id.tv_row_comment_text);
             tvText.setText(commentCursor.getString(0));
             tvText.setText(commentCursor.getString(0));
 
 
@@ -164,7 +156,8 @@ public class PostLayout extends Fragment {
                 //Start async task
                 //Start async task
                 LinearLayout form = (LinearLayout) view.findViewById(R.id.ll_new_comment);
                 LinearLayout form = (LinearLayout) view.findViewById(R.id.ll_new_comment);
                 LinearLayout list = (LinearLayout) view.findViewById(R.id.ll_comment_list);
                 LinearLayout list = (LinearLayout) view.findViewById(R.id.ll_comment_list);
-                new PostComment("blog", user, text, currLang, id, form, list, commentCount, tvComments, context).execute();
+                String lang = GM.getLang();
+                new PostComment("blog", user, text, lang, id, form, list, commentCount, tvComments, context).execute();
 
 
             }
             }
         });
         });

+ 190 - 0
app/src/main/res/values-en/strings.xml

@@ -0,0 +1,190 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+
+	<!-- Tag keys -->
+	<string name="key_0" translatable="false">0</string>
+	<string name="key_1" translatable="false">1</string>
+
+	<!-- App related strings -->
+
+	<string name="app_name" translatable="false">Gasteizko Margolariak</string>
+	<string name="app_cdesc" translatable="false"> </string>
+
+
+	<!-- Common strings -->
+	<string name="price">Price: %1$d</string>
+
+	<!-- Arrow buttons -->
+
+	<string name="arrow_left" translatable="false">&lt;</string>
+	<string name="arrow_right" translatable="false">&gt;</string>
+
+
+	<string name="section_title_blog">Blog</string>
+
+	<!-- Menu sections -->
+
+	<string name="menu_home">Home</string>
+	<string name="menu_lablanca">La Blanca</string>
+	<string name="menu_lablanca_schedule">Festival schedule</string>
+	<string name="menu_lablanca_gm_schedule">Margolariak schedule</string>
+	<string name="menu_location">Find us</string>
+	<string name="menu_activities">Activities</string>
+	<string name="menu_blog">Blog</string>
+	<string name="menu_gallery">Gallery</string>
+	<string name="menu_settings">Settings</string>
+
+	<!-- Schedule strings -->
+	<string name="schedule_filter">Search&#8230;</string>
+	<string name="schedule_close">Close</string>
+	<string name="schedule_host">Host: %1$s</string>
+
+
+
+	<!-- Day strings -->
+	<string name="today">Today</string>
+	<string name="tomorrow">Tomorrow</string>
+
+
+	<!-- Home section strings -->
+
+	<string name="home_section_location">Find us</string>
+	<string name="home_section_lablanca">La Blanca</string>
+	<string name="home_section_gmschedule">Margolari Schedule</string>
+	<string name="home_section_cityschedule">City Schedule</string>
+	<string name="home_section_around">Around me</string>
+	<string name="home_section_activities_future">Upcaming Activities</string>
+	<string name="home_section_blog">Latest Posts</string>
+	<string name="home_section_gallery">Latest Photos</string>
+	<string name="home_section_activities_past">Latest Activities</string>
+	<string name="home_section_social">Follow us</string>
+
+	<string name="home_section_location_text_0">Gasteizko Margolariak is around!</string>
+	<string name="home_section_location_text_short">They are just %1$d meters away from you!\n(About %2$d minutes walking)</string>
+	<string name="home_section_location_text_long">They are just %1$s kilometers away from you!</string>
+
+
+
+	<!-- Settings section strings -->
+
+	<string name="settings_notification">Receive notifications</string>
+	<string name="settings_notification_on">You will receive notifications</string>
+	<string name="settings_notification_off">You won\'t receive notifications</string>
+	<string name="settings_license">License</string>
+	<string name="settings_privacy">Privacy</string>
+	<string name="settings_about">About us</string>
+	<string name="settings_transparency">Transparency</string>
+	<string name="settings_license_content">Copyright 2016 Iñigo Valentin&lt;br/>&lt;br/>This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 3 as published by the Free Software Foundation.&lt;br/>&lt;br/>This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details at http://www.gnu.org/licenses/.&lt;br/>&lt;br/>The name "Gasteizko Margolariak" and its logotype are property of Gasteizko Margolariak.&lt;br/>&lt;br/>&lt;br/>&lt;div style="background-color:#bbbbbb;padding:6px;border-radius:5px;border-style:solid;border-width:2px;border-color:#333333;text-align:center;">You can get the source code for this project at &lt;a href="https://github.com/Seavenois/GM">Github&lt;/a>&lt;/div></string>
+	<string name="settings_privacy_content">In Gasteizko Margolariak we respect your privacy. We don\'t collect ANY data from our users, including personal information, location, shopping habits, sexual preferences, favourite colour, first love\'s name... ANY.&lt;br/>&lt;br/>In order of making you believe us, we\'ll explain what we DO store:&lt;br/>&lt;br/>&lt;ul>&lt;li>A randomly generated user code, unique to your device. This is neccessary to sync content with aur database, so you can get info about our post, activities... But it\'s done in a way that won\'t allow un to identify you as a person with that number.&lt;/li>&lt;li>When commenting on a photo ar an entry, we store your current IP address. This is incredibly usefull for us to know how many actual people are posting comments, and it also makes imposible for us to identify you as a person.&lt;/li>&lt;/ul></string>
+	<string name="settings_about_content">La Asociación Cultural Gasteizko Margolariak nace en el año 2013 con la idea de estimular la participación ciudadana y fortalecer la cultura y las tradiciones de Vitoria-Gasteiz.&lt;br/>&lt;br/>En nuestro nombre se refleja un barrio en el que las calles nos recuerdan a grandes pintores: el barrio de San Martín. Estamos representados en los barrios, y creemos que son la esencia de esta ciudad.&lt;br/>&lt;br/>Nos convertimos en Cuadrilla de Blusas y Neskas en 2013, y en ese mismo año, miembros de la Comisión de Blusas y Neskas.&lt;br/>&lt;br/>Desde entonces no hemos hecho más que crecer junto con todos los que han decidido, año tras año, apostar por nosotros.</string>
+	<string name="settings_transparency_content">¿Te preocupa saber dónde va tu dinero? En Gasteizko Margolariak queremos que estés tranquilo.&lt;br/>&lt;br/>Muchas de nuestras actividades son gratuitas. Otras, como las fiestas de La Blanca, tienen una cuota de inscripción. Gasteizko Margolariak no es una empresa, es una Asociación Cultural, y como tal, no tenemos beneficios.&lt;br/>&lt;br/>Queremos ser transparentes, y por eso, empezando en 2016, pondremos a tu disposición nuestras cuentas de manera online, para que sepas que cada euro se reinvierte en tí.</string>
+
+	<!-- Blog section strings -->
+	<string name="blog_pager_previous" translatable="false">&lt;</string>
+	<string name="blog_pager_next" translatable="false">&gt;</string>
+
+	<!-- Activity section strings -->
+	<string name="activity_city">City:</string>
+	<string name="activity_price">Price:</string>
+	<string name="activity_no_future">There are no upcaming activities for now. We\'ll tell you when there is something planned!</string>
+	<string name="activity_schedule">Schedule</string>
+	<string name="activity_future">Upcaming activities</string>
+	<string name="activity_past">Past activities</string>
+
+
+	<!--Gallery section strings-->
+	<string name="gallery_upload">Upload photos</string>
+	<string name="gallery_upload_text">Do you have any photos? Upload them and help us getting this gallery bigger!</string>
+	<string name="gallery_upload_button"> Upload </string>
+	<string name="gallery_albums">Albums</string>
+	<plurals name="gallery_photo_count">
+		<item quantity="one">%1$d photo</item>
+		<item quantity="other">%1$d photos</item>
+	</plurals>
+
+	<!--La Blanca section strings-->
+	<string name="lablanca_title">La Blanca</string>
+	<string name="lablanca_nofestivals">Las Fiestas de La Blanca. Esos días, del 4 al 9 de agosto, en los que Vitoria-Gasteiz se transforma. Se llena de color y alegría, y en cada esquina puedes encontrar actividades y espectáculos. Todos las estamos esperando.\n\nPor desgracia, aún hay que esperar más.\n\nNosotros ya estamos trabajando en ello. Tan pronto como vayamos sabiendo más, aquí iremos publicando nuestro programa y otra información sobre las fiestas.</string>
+	<string name="lablanca_prices">Prices</string>
+	<string name="lablanca_prices_days">Single days</string>
+	<string name="lablanca_prices_pack">Packs</string>
+	<string name="lablanca_schedule">Schedule</string>
+	<string name="lablanca_schedule_city">City schedule</string>
+	<string name="lablanca_schedule_gm">Margolariak schedule</string>
+	<string name="lablanca_date_july">July %1$s</string>
+	<string name="lablanca_date_august">August %1$s</string>
+
+	<!--Schedule section strings-->
+	<string name="schedule_month_july">July</string>
+	<string name="schedule_month_august">August</string>
+
+	<!-- Comments section and form strings -->
+	<string name="comment_your_comment">Your comment</string>
+	<plurals name="comment_comments">
+		<item quantity="one">%1$d comment</item>
+		<item quantity="other">%1$d comments</item>
+	</plurals>
+	<string name="comment_text">Text&#8230;</string>
+	<string name="comment_name">Name&#8230;</string>
+	<string name="comment_send">Publish</string>
+	<string name="comment_toast_user">Enter a username</string>
+	<string name="comment_toast_text">Enter comment text</string>
+
+
+	<!--Schedule section strings -->
+	<string name="schedule_now">Now</string>
+	<string name="schedule_later">Later</string>
+
+	<!-- Social networks strings -->
+
+	<string name="social_phone" translatable="false">Phone</string>
+	<string name="social_facebook" translatable="false">Facebook</string>
+	<string name="social_mail" translatable="false">e-mail</string>
+	<string name="social_whatsapp" translatable="false">Whatsapp</string>
+	<string name="social_twitter" translatable="false">Twitter</string>
+	<string name="social_googleplus" translatable="false">Google+</string>
+	<string name="social_youtube" translatable="false">Youtube</string>
+	<string name="social_instagram" translatable="false">Instagram</string>
+	<string name="social_phone_link" translatable="false">tel:+34637140371</string>
+	<string name="social_mail_link" translatable="false">mailto:gasteizkomargolariak@gmail.com</string>
+	<string name="social_whatsapp_link" translatable="false">smsto:+34637140371</string>
+	<string name="social_whatsapp_package" translatable="false">com.whatsapp</string>
+	<string name="social_whatsapp_chat" translatable="false">chat</string>
+	<string name="social_whatsapp_error">Couldn\'t comunicate with Whatsapp app. Is it installed?</string>
+	<string name="social_facebook_link" translatable="false">http://facebook.com/gmargolariak</string>
+	<string name="social_twitter_link" translatable="false">http://twitter.com/gmargolariak</string>
+	<string name="social_googleplus_link" translatable="false">https://plus.google.com/106661466029005469492</string>
+	<string name="social_youtube_link" translatable="false">https://www.youtube.com/user/GasteizkoMargolariak</string>
+	<string name="social_instagram_link" translatable="false">https://instagram.com/gmargolariak/</string>
+
+
+	<!-- Misc strings -->
+
+	<string name="eur" translatable="false">€</string>
+
+	
+	<!-- Notification dialog strings -->
+	
+	<string name="notification_close">Close</string>
+	<string name="notification_action_lablanca"> Open La Blanca </string>
+	<string name="notification_action_gmschedule"> Open Margolari schedule </string>
+	<string name="notification_action_cityschedule"> Open city schedule </string>
+	<string name="notification_action_location"> Show location </string>
+	<string name="notification_action_blog"> Open blog </string>
+	<string name="notification_action_activities"> Open activities </string>
+	<string name="notification_action_gallery"> Open gallery </string>
+	
+	
+	<!-- Sync dialog strings -->
+	
+	<string name="dialog_sync_title">Fetching content</string>
+	<string name="dialog_sync_text_0">Locating Don Margolo&#8230;</string>
+	<string name="dialog_sync_text_1">Starting up the van&#8230;</string>
+	<string name="dialog_sync_text_2">Serving kalimotxos&#8230;</string>
+	<string name="dialog_sync_text_3">\"&#8230;tu eres el piloto&#8230;\"</string>
+	<string name="dialog_sync_text_4">Afinando la tuba&#8230;</string>
+	<string name="dialog_sync_failed_title">Synchronization failed</string>
+	<string name="dialog_sync_failed_text">Couldn\'t download content.\n\nMake sure you have a network connection and try again.</string>
+	<string name="dialog_sync_failed_close">Close</string>
+	
+</resources>

+ 0 - 131
app/src/main/res/values-es/strings.xml

@@ -1,131 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-
-
-	<!-- App related strings -->
-
-\
-
-	<!-- Arrow buttons -->
-
-
-	<!-- Menu sections -->
-
-	<string name="menu_home">Home</string>
-	<string name="menu_lablanca">La Blanca</string>
-	<string name="menu_lablanca_schedule">Programa de fiestas</string>
-	<string name="menu_lablanca_gm_schedule">Programa Margolari</string>
-	<string name="menu_activities">Actividades</string>
-	<string name="menu_blog">Blog</string>
-	<string name="menu_gallery">Galería</string>
-\	<string name="menu_settings">Preferencias</string>
-
-	<!-- Schedule strings -->
-
-	<string name="schedule_filter">Buscar&#8230;</string>
-	<string name="schedule_close">Cerrar</string>
-	<string name="schedule_host">Organiza %1$s</string>
-
-
-	<!-- Day strings -->
-	<string name="today">Hoy</string>
-	<string name="tomorrow">Mañana</string>
-
-
-	<!-- Home section strings -->
-
-	<string name="home_section_around">Cerca de mi</string>
-	<string name="home_section_location">Encuéntranos</string>
-	<string name="home_section_location_text_0">¡Gasteizko Margolariak está cerca!</string>
-	<string name="home_section_social">Síguenos</string>
-
-	
-	<!-- Prices dialog strings -->
-
-
-	<!-- Settings section strings -->
-
-	<string name="settings_notification">Notificaciones</string>
-	<string name="settings_notification_on">Recibir notificaciones</string>
-	<string name="settings_notification_off">No recibir notificaciones</string>
-
-	
-	<!-- Social networks strings -->
-
-	<string name="social_whatsapp_error">Error de conexión con Whatsapp. Está instalado?</string>
-
-
-	<!-- Notification dialog strings -->
-	
-	<string name="notification_close">Cerrar</string>
-
-	<!-- Sync dialog strings -->
-	
-	<string name="dialog_sync_title">Sincronizando</string>
-	<string name="dialog_sync_failed_title">Error de sincronización</string>
-	<string name="dialog_sync_failed_text">No se pudierdon descargar los contenidos\n\nAsegúrate de que dispones de conexión a internet e inténtalo de nuevo.</string>
-	<string name="dialog_sync_failed_close">Cerrar</string>
-	<string name="activity_city">Cudad:</string>
-	<string name="activity_future">Proximas actividades</string>
-	<string name="activity_no_future">No hay actividades planeadas proximamanete. Cuando organicemos algo, aparecera aquí.</string>
-	<string name="activity_past">Actividades pasadas</string>
-	<string name="activity_price">Precio:</string>
-	<string name="activity_schedule">Itinerario</string>
-	<string name="comment_name">Nombre…</string>
-	<string name="comment_send">Publicar</string>
-	<string name="comment_text">Comentario…</string>
-	<string name="comment_toast_text">Introduce un comentario</string>
-	<string name="comment_toast_user">Introduce un nombre</string>
-	<string name="comment_your_comment">Tu comentario</string>
-	<string name="dialog_sync_text_0">Contactando con Don Margolo&#8230;</string>
-	<string name="dialog_sync_text_1">Arrancando la furgo&#8230;</string>
-	<string name="dialog_sync_text_2">Preparando kalimotxos&#8230;</string>
-	<string name="dialog_sync_text_3">\"&#8230;tu eres el piloto&#8230;\"</string>
-	<string name="dialog_sync_text_4">Afinando la tuba&#8230;</string>
-	<string name="gallery_albums">Albums</string>
-	<string name="gallery_upload">Subir fotos</string>
-	<string name="gallery_upload_button">Subir</string>
-	<string name="gallery_upload_text">¿Tienes fotografías? ¡Ayudanos a construir esta galería!</string>
-	<string name="home_section_activities_future">Proximas actividades</string>
-	<string name="home_section_gmschedule">Programa Margolari</string>
-	<string name="home_section_location_text_short">¡Están a solo %1$d metros de ti! (Unos %2$d minutos andando)</string>
-	<string name="home_section_location_text_long">¡Están a solo %1$s kilometros de ti!</string>
-	<string name="lablanca_date_august">%1$s de agosto</string>
-	<string name="lablanca_date_july">%1$s de julio</string>
-	<string name="lablanca_prices">Precios</string>
-	<string name="lablanca_prices_days">Dias sueltos</string>
-	<string name="lablanca_prices_pack">Packs</string>
-	<string name="lablanca_schedule">Programa</string>
-	<string name="lablanca_schedule_city">Programa de Fiestas</string>
-	<string name="lablanca_schedule_gm">Programa Margolari</string>
-	<string name="lablanca_title">La Blanca</string>
-	<string name="menu_location">Encuentranos</string>
-	<string name="notification_action_gmschedule">Ver programa Margolari</string>
-	<string name="schedule_later">Siguiente</string>
-	<string name="schedule_month_august">Agosto</string>
-	<string name="schedule_month_july">Julio</string>
-	<string name="schedule_now">Ahora</string>
-	<string name="section_title_blog">Blog</string>
-	<string name="home_section_blog">Ultimos posts</string>
-	<string name="home_section_cityschedule">Programa de fiestas</string>
-	<string name="home_section_gallery">Ultimas fotos</string>
-	<string name="home_section_lablanca">La Blanca</string>
-	<string name="home_section_activities_past">Ultimas actividades</string>
-	<string name="notification_action_activities">Ver actividades</string>
-	<string name="notification_action_blog">Abrir blog</string>
-	<string name="notification_action_cityschedule">Programa de fiestas</string>
-	<string name="notification_action_gallery">Abrir galeria</string>
-	<string name="notification_action_lablanca">Abrir La Blanca</string>
-	<string name="notification_action_location">Ver localizacion</string>
-	<string name="price">Precio: %1$d</string>
-	<string name="settings_about">Sobre nosotros</string>
-	<string name="settings_license">Licencia</string>
-	<string name="settings_license_content"><![CDATA[Copyright 2016 Iñigo Valentin<br/><br/>This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 3 as published by the Free Software Foundation.<br/><br/>This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details at http://www.gnu.org/licenses/.<br/><br/>The name "Gasteizko Margolariak" and its logotype are property of Gasteizko Margolariak.<br/><br/><br/><div style="background-color:#bbbbbb;padding:6px;border-radius:5px;border-style:solid;border-width:2px;border-color:#333333;text-align:center;">You can get the source code for this project at <a href="https://github.com/Seavenois/GM">Github</a></div>]]></string>
-	<string name="settings_privacy">Privacidad</string>
-	<string name="settings_privacy_content"><![CDATA[In Gasteizko Margolariak we respect your privacy. We don\'t collect ANY data from our users, including personal information, location, shopping habits, sexual preferences, favourite colour, first love\'s name... ANY.<br/><br/>In order of making you believe us, we\'ll explain what we DO store:<br/><br/><ul><li>A randomly generated user code, unique to your device. This is neccessary to sync content with aur database, so you can get info about our post, activities... But it\'s done in a way that won\'t allow un to identify you as a person with that number.</li><li>When commenting on a photo ar an entry, we store your current IP address. This is incredibly usefull for us to know how many actual people are posting comments, and it also makes imposible for us to identify you as a person.</li></ul>]]></string>
-	<string name="settings_transparency">Transparencia</string>
-	<string name="settings_transparency_content"><![CDATA[¿Te preocupa saber dónde va tu dinero? En Gasteizko Margolariak queremos que estés tranquilo.<br/><br/>Muchas de nuestras actividades son gratuitas. Otras, como las fiestas de La Blanca, tienen una cuota de inscripción. Gasteizko Margolariak no es una empresa, es una Asociación Cultural, y como tal, no tenemos beneficios.<br/><br/>Queremos ser transparentes, y por eso, empezando en 2016, pondremos a tu disposición nuestras cuentas de manera online, para que sepas que cada euro se reinvierte en tí.]]></string>
-	<string name="lablanca_nofestivals">Las Fiestas de La Blanca. Esos días, del 4 al 9 de agosto, en los que Vitoria-Gasteiz se transforma. Se llena de color y alegría, y en cada esquina puedes encontrar actividades y espectáculos. Todos las estamos esperando.\n\nPor desgracia, aún hay que esperar más.\n\nNosotros ya estamos trabajando en ello. Tan pronto como vayamos sabiendo más, aquí iremos publicando nuestro programa y otra información sobre las fiestas.</string>
-	<string name="settings_about_content"><![CDATA[La Asociación Cultural Gasteizko Margolariak nace en el año 2013 con la idea de estimular la participación ciudadana y fortalecer la cultura y las tradiciones de Vitoria-Gasteiz.<br/><br/>En nuestro nombre se refleja un barrio en el que las calles nos recuerdan a grandes pintores: el barrio de San Martín. Estamos representados en los barrios, y creemos que son la esencia de esta ciudad.<br/><br/>Nos convertimos en Cuadrilla de Blusas y Neskas en 2013, y en ese mismo año, miembros de la Comisión de Blusas y Neskas.<br/><br/>Desde entonces no hemos hecho más que crecer junto con todos los que han decidido, año tras año, apostar por nosotros.]]></string>
-
-</resources>

+ 90 - 149
app/src/main/res/values/strings.xml

@@ -1,190 +1,131 @@
 <?xml version="1.0" encoding="utf-8"?>
 <?xml version="1.0" encoding="utf-8"?>
 <resources>
 <resources>
 
 
-	<!-- Tag keys -->
-	<string name="key_0" translatable="false">0</string>
-	<string name="key_1" translatable="false">1</string>
 
 
 	<!-- App related strings -->
 	<!-- App related strings -->
 
 
-	<string name="app_name" translatable="false">Gasteizko Margolariak</string>
-	<string name="app_cdesc" translatable="false"> </string>
-
-
-	<!-- Common strings -->
-	<string name="price">Price: %1$d</string>
+\
 
 
 	<!-- Arrow buttons -->
 	<!-- Arrow buttons -->
 
 
-	<string name="arrow_left" translatable="false">&lt;</string>
-	<string name="arrow_right" translatable="false">&gt;</string>
-
-
-	<string name="section_title_blog">Blog</string>
 
 
 	<!-- Menu sections -->
 	<!-- Menu sections -->
 
 
 	<string name="menu_home">Home</string>
 	<string name="menu_home">Home</string>
 	<string name="menu_lablanca">La Blanca</string>
 	<string name="menu_lablanca">La Blanca</string>
-	<string name="menu_lablanca_schedule">Festival schedule</string>
-	<string name="menu_lablanca_gm_schedule">Margolariak schedule</string>
-	<string name="menu_location">Find us</string>
-	<string name="menu_activities">Activities</string>
+	<string name="menu_lablanca_schedule">Programa de fiestas</string>
+	<string name="menu_lablanca_gm_schedule">Programa Margolari</string>
+	<string name="menu_activities">Actividades</string>
 	<string name="menu_blog">Blog</string>
 	<string name="menu_blog">Blog</string>
-	<string name="menu_gallery">Gallery</string>
-	<string name="menu_settings">Settings</string>
+	<string name="menu_gallery">Galería</string>
+\	<string name="menu_settings">Preferencias</string>
 
 
 	<!-- Schedule strings -->
 	<!-- Schedule strings -->
-	<string name="schedule_filter">Search&#8230;</string>
-	<string name="schedule_close">Close</string>
-	<string name="schedule_host">Host: %1$s</string>
 
 
+	<string name="schedule_filter">Buscar&#8230;</string>
+	<string name="schedule_close">Cerrar</string>
+	<string name="schedule_host">Organiza %1$s</string>
 
 
 
 
 	<!-- Day strings -->
 	<!-- Day strings -->
-	<string name="today">Today</string>
-	<string name="tomorrow">Tomorrow</string>
+	<string name="today">Hoy</string>
+	<string name="tomorrow">Mañana</string>
 
 
 
 
 	<!-- Home section strings -->
 	<!-- Home section strings -->
 
 
-	<string name="home_section_location">Find us</string>
-	<string name="home_section_lablanca">La Blanca</string>
-	<string name="home_section_gmschedule">Margolari Schedule</string>
-	<string name="home_section_cityschedule">City Schedule</string>
-	<string name="home_section_around">Around me</string>
-	<string name="home_section_activities_future">Upcaming Activities</string>
-	<string name="home_section_blog">Latest Posts</string>
-	<string name="home_section_gallery">Latest Photos</string>
-	<string name="home_section_activities_past">Latest Activities</string>
-	<string name="home_section_social">Follow us</string>
-
-	<string name="home_section_location_text_0">Gasteizko Margolariak is around!</string>
-	<string name="home_section_location_text_short">They are just %1$d meters away from you!\n(About %2$d minutes walking)</string>
-	<string name="home_section_location_text_long">They are just %1$s kilometers away from you!</string>
+	<string name="home_section_around">Cerca de mi</string>
+	<string name="home_section_location">Encuéntranos</string>
+	<string name="home_section_location_text_0">¡Gasteizko Margolariak está cerca!</string>
+	<string name="home_section_social">Síguenos</string>
 
 
+	
+	<!-- Prices dialog strings -->
 
 
 
 
 	<!-- Settings section strings -->
 	<!-- Settings section strings -->
 
 
-	<string name="settings_notification">Receive notifications</string>
-	<string name="settings_notification_on">You will receive notifications</string>
-	<string name="settings_notification_off">You won\'t receive notifications</string>
-	<string name="settings_license">License</string>
-	<string name="settings_privacy">Privacy</string>
-	<string name="settings_about">About us</string>
-	<string name="settings_transparency">Transparency</string>
-	<string name="settings_license_content">Copyright 2016 Iñigo Valentin&lt;br/>&lt;br/>This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 3 as published by the Free Software Foundation.&lt;br/>&lt;br/>This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details at http://www.gnu.org/licenses/.&lt;br/>&lt;br/>The name "Gasteizko Margolariak" and its logotype are property of Gasteizko Margolariak.&lt;br/>&lt;br/>&lt;br/>&lt;div style="background-color:#bbbbbb;padding:6px;border-radius:5px;border-style:solid;border-width:2px;border-color:#333333;text-align:center;">You can get the source code for this project at &lt;a href="https://github.com/Seavenois/GM">Github&lt;/a>&lt;/div></string>
-	<string name="settings_privacy_content">In Gasteizko Margolariak we respect your privacy. We don\'t collect ANY data from our users, including personal information, location, shopping habits, sexual preferences, favourite colour, first love\'s name... ANY.&lt;br/>&lt;br/>In order of making you believe us, we\'ll explain what we DO store:&lt;br/>&lt;br/>&lt;ul>&lt;li>A randomly generated user code, unique to your device. This is neccessary to sync content with aur database, so you can get info about our post, activities... But it\'s done in a way that won\'t allow un to identify you as a person with that number.&lt;/li>&lt;li>When commenting on a photo ar an entry, we store your current IP address. This is incredibly usefull for us to know how many actual people are posting comments, and it also makes imposible for us to identify you as a person.&lt;/li>&lt;/ul></string>
-	<string name="settings_about_content">La Asociación Cultural Gasteizko Margolariak nace en el año 2013 con la idea de estimular la participación ciudadana y fortalecer la cultura y las tradiciones de Vitoria-Gasteiz.&lt;br/>&lt;br/>En nuestro nombre se refleja un barrio en el que las calles nos recuerdan a grandes pintores: el barrio de San Martín. Estamos representados en los barrios, y creemos que son la esencia de esta ciudad.&lt;br/>&lt;br/>Nos convertimos en Cuadrilla de Blusas y Neskas en 2013, y en ese mismo año, miembros de la Comisión de Blusas y Neskas.&lt;br/>&lt;br/>Desde entonces no hemos hecho más que crecer junto con todos los que han decidido, año tras año, apostar por nosotros.</string>
-	<string name="settings_transparency_content">¿Te preocupa saber dónde va tu dinero? En Gasteizko Margolariak queremos que estés tranquilo.&lt;br/>&lt;br/>Muchas de nuestras actividades son gratuitas. Otras, como las fiestas de La Blanca, tienen una cuota de inscripción. Gasteizko Margolariak no es una empresa, es una Asociación Cultural, y como tal, no tenemos beneficios.&lt;br/>&lt;br/>Queremos ser transparentes, y por eso, empezando en 2016, pondremos a tu disposición nuestras cuentas de manera online, para que sepas que cada euro se reinvierte en tí.</string>
-
-	<!-- Blog section strings -->
-	<string name="blog_pager_previous" translatable="false">&lt;</string>
-	<string name="blog_pager_next" translatable="false">&gt;</string>
-
-	<!-- Activity section strings -->
-	<string name="activity_city">City:</string>
-	<string name="activity_price">Price:</string>
-	<string name="activity_no_future">There are no upcaming activities for now. We\'ll tell you when there is something planned!</string>
-	<string name="activity_schedule">Schedule</string>
-	<string name="activity_future">Upcaming activities</string>
-	<string name="activity_past">Past activities</string>
-
-
-	<!--Gallery section strings-->
-	<string name="gallery_upload">Upload photos</string>
-	<string name="gallery_upload_text">Do you have any photos? Upload them and help us getting this gallery bigger!</string>
-	<string name="gallery_upload_button"> Upload </string>
-	<string name="gallery_albums">Albums</string>
-	<plurals name="gallery_photo_count">
-		<item quantity="one">%1$d photo</item>
-		<item quantity="other">%1$d photos</item>
-	</plurals>
-
-	<!--La Blanca section strings-->
-	<string name="lablanca_title">La Blanca</string>
-	<string name="lablanca_nofestivals">Las Fiestas de La Blanca. Esos días, del 4 al 9 de agosto, en los que Vitoria-Gasteiz se transforma. Se llena de color y alegría, y en cada esquina puedes encontrar actividades y espectáculos. Todos las estamos esperando.\n\nPor desgracia, aún hay que esperar más.\n\nNosotros ya estamos trabajando en ello. Tan pronto como vayamos sabiendo más, aquí iremos publicando nuestro programa y otra información sobre las fiestas.</string>
-	<string name="lablanca_prices">Prices</string>
-	<string name="lablanca_prices_days">Single days</string>
-	<string name="lablanca_prices_pack">Packs</string>
-	<string name="lablanca_schedule">Schedule</string>
-	<string name="lablanca_schedule_city">City schedule</string>
-	<string name="lablanca_schedule_gm">Margolariak schedule</string>
-	<string name="lablanca_date_july">July %1$s</string>
-	<string name="lablanca_date_august">August %1$s</string>
-
-	<!--Schedule section strings-->
-	<string name="schedule_month_july">July</string>
-	<string name="schedule_month_august">August</string>
-
-	<!-- Comments section and form strings -->
-	<string name="comment_your_comment">Your comment</string>
-	<plurals name="comment_comments">
-		<item quantity="one">%1$d comment</item>
-		<item quantity="other">%1$d comments</item>
-	</plurals>
-	<string name="comment_text">Text&#8230;</string>
-	<string name="comment_name">Name&#8230;</string>
-	<string name="comment_send">Publish</string>
-	<string name="comment_toast_user">Enter a username</string>
-	<string name="comment_toast_text">Enter comment text</string>
-
-
-	<!--Schedule section strings -->
-	<string name="schedule_now">Now</string>
-	<string name="schedule_later">Later</string>
+	<string name="settings_notification">Notificaciones</string>
+	<string name="settings_notification_on">Recibir notificaciones</string>
+	<string name="settings_notification_off">No recibir notificaciones</string>
 
 
+	
 	<!-- Social networks strings -->
 	<!-- Social networks strings -->
 
 
-	<string name="social_phone" translatable="false">Phone</string>
-	<string name="social_facebook" translatable="false">Facebook</string>
-	<string name="social_mail" translatable="false">e-mail</string>
-	<string name="social_whatsapp" translatable="false">Whatsapp</string>
-	<string name="social_twitter" translatable="false">Twitter</string>
-	<string name="social_googleplus" translatable="false">Google+</string>
-	<string name="social_youtube" translatable="false">Youtube</string>
-	<string name="social_instagram" translatable="false">Instagram</string>
-	<string name="social_phone_link" translatable="false">tel:+34637140371</string>
-	<string name="social_mail_link" translatable="false">mailto:gasteizkomargolariak@gmail.com</string>
-	<string name="social_whatsapp_link" translatable="false">smsto:+34637140371</string>
-	<string name="social_whatsapp_package" translatable="false">com.whatsapp</string>
-	<string name="social_whatsapp_chat" translatable="false">chat</string>
-	<string name="social_whatsapp_error">Couldn\'t comunicate with Whatsapp app. Is it installed?</string>
-	<string name="social_facebook_link" translatable="false">http://facebook.com/gmargolariak</string>
-	<string name="social_twitter_link" translatable="false">http://twitter.com/gmargolariak</string>
-	<string name="social_googleplus_link" translatable="false">https://plus.google.com/106661466029005469492</string>
-	<string name="social_youtube_link" translatable="false">https://www.youtube.com/user/GasteizkoMargolariak</string>
-	<string name="social_instagram_link" translatable="false">https://instagram.com/gmargolariak/</string>
-
-
-	<!-- Misc strings -->
-
-	<string name="eur" translatable="false">€</string>
+	<string name="social_whatsapp_error">Error de conexión con Whatsapp. Está instalado?</string>
+
 
 
-	
 	<!-- Notification dialog strings -->
 	<!-- Notification dialog strings -->
 	
 	
-	<string name="notification_close">Close</string>
-	<string name="notification_action_lablanca"> Open La Blanca </string>
-	<string name="notification_action_gmschedule"> Open Margolari schedule </string>
-	<string name="notification_action_cityschedule"> Open city schedule </string>
-	<string name="notification_action_location"> Show location </string>
-	<string name="notification_action_blog"> Open blog </string>
-	<string name="notification_action_activities"> Open activities </string>
-	<string name="notification_action_gallery"> Open gallery </string>
-	
-	
+	<string name="notification_close">Cerrar</string>
+
 	<!-- Sync dialog strings -->
 	<!-- Sync dialog strings -->
 	
 	
-	<string name="dialog_sync_title">Fetching content</string>
-	<string name="dialog_sync_text_0">Locating Don Margolo&#8230;</string>
-	<string name="dialog_sync_text_1">Starting up the van&#8230;</string>
-	<string name="dialog_sync_text_2">Serving kalimotxos&#8230;</string>
+	<string name="dialog_sync_title">Sincronizando</string>
+	<string name="dialog_sync_failed_title">Error de sincronización</string>
+	<string name="dialog_sync_failed_text">No se pudierdon descargar los contenidos\n\nAsegúrate de que dispones de conexión a internet e inténtalo de nuevo.</string>
+	<string name="dialog_sync_failed_close">Cerrar</string>
+	<string name="activity_city">Cudad:</string>
+	<string name="activity_future">Proximas actividades</string>
+	<string name="activity_no_future">No hay actividades planeadas proximamanete. Cuando organicemos algo, aparecera aquí.</string>
+	<string name="activity_past">Actividades pasadas</string>
+	<string name="activity_price">Precio:</string>
+	<string name="activity_schedule">Itinerario</string>
+	<string name="comment_name">Nombre…</string>
+	<string name="comment_send">Publicar</string>
+	<string name="comment_text">Comentario…</string>
+	<string name="comment_toast_text">Introduce un comentario</string>
+	<string name="comment_toast_user">Introduce un nombre</string>
+	<string name="comment_your_comment">Tu comentario</string>
+	<string name="dialog_sync_text_0">Contactando con Don Margolo&#8230;</string>
+	<string name="dialog_sync_text_1">Arrancando la furgo&#8230;</string>
+	<string name="dialog_sync_text_2">Preparando kalimotxos&#8230;</string>
 	<string name="dialog_sync_text_3">\"&#8230;tu eres el piloto&#8230;\"</string>
 	<string name="dialog_sync_text_3">\"&#8230;tu eres el piloto&#8230;\"</string>
 	<string name="dialog_sync_text_4">Afinando la tuba&#8230;</string>
 	<string name="dialog_sync_text_4">Afinando la tuba&#8230;</string>
-	<string name="dialog_sync_failed_title">Synchronization failed</string>
-	<string name="dialog_sync_failed_text">Couldn\'t download content.\n\nMake sure you have a network connection and try again.</string>
-	<string name="dialog_sync_failed_close">Close</string>
-	
+	<string name="gallery_albums">Albums</string>
+	<string name="gallery_upload">Subir fotos</string>
+	<string name="gallery_upload_button">Subir</string>
+	<string name="gallery_upload_text">¿Tienes fotografías? ¡Ayudanos a construir esta galería!</string>
+	<string name="home_section_activities_future">Proximas actividades</string>
+	<string name="home_section_gmschedule">Programa Margolari</string>
+	<string name="home_section_location_text_short">¡Están a solo %1$d metros de ti! (Unos %2$d minutos andando)</string>
+	<string name="home_section_location_text_long">¡Están a solo %1$s kilometros de ti!</string>
+	<string name="lablanca_date_august">%1$s de agosto</string>
+	<string name="lablanca_date_july">%1$s de julio</string>
+	<string name="lablanca_prices">Precios</string>
+	<string name="lablanca_prices_days">Dias sueltos</string>
+	<string name="lablanca_prices_pack">Packs</string>
+	<string name="lablanca_schedule">Programa</string>
+	<string name="lablanca_schedule_city">Programa de Fiestas</string>
+	<string name="lablanca_schedule_gm">Programa Margolari</string>
+	<string name="lablanca_title">La Blanca</string>
+	<string name="menu_location">Encuentranos</string>
+	<string name="notification_action_gmschedule">Ver programa Margolari</string>
+	<string name="schedule_later">Siguiente</string>
+	<string name="schedule_month_august">Agosto</string>
+	<string name="schedule_month_july">Julio</string>
+	<string name="schedule_now">Ahora</string>
+	<string name="section_title_blog">Blog</string>
+	<string name="home_section_blog">Ultimos posts</string>
+	<string name="home_section_cityschedule">Programa de fiestas</string>
+	<string name="home_section_gallery">Ultimas fotos</string>
+	<string name="home_section_lablanca">La Blanca</string>
+	<string name="home_section_activities_past">Ultimas actividades</string>
+	<string name="notification_action_activities">Ver actividades</string>
+	<string name="notification_action_blog">Abrir blog</string>
+	<string name="notification_action_cityschedule">Programa de fiestas</string>
+	<string name="notification_action_gallery">Abrir galeria</string>
+	<string name="notification_action_lablanca">Abrir La Blanca</string>
+	<string name="notification_action_location">Ver localizacion</string>
+	<string name="price">Precio: %1$d</string>
+	<string name="settings_about">Sobre nosotros</string>
+	<string name="settings_license">Licencia</string>
+	<string name="settings_license_content"><![CDATA[Copyright 2016 Iñigo Valentin<br/><br/>This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 3 as published by the Free Software Foundation.<br/><br/>This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details at http://www.gnu.org/licenses/.<br/><br/>The name "Gasteizko Margolariak" and its logotype are property of Gasteizko Margolariak.<br/><br/><br/><div style="background-color:#bbbbbb;padding:6px;border-radius:5px;border-style:solid;border-width:2px;border-color:#333333;text-align:center;">You can get the source code for this project at <a href="https://github.com/Seavenois/GM">Github</a></div>]]></string>
+	<string name="settings_privacy">Privacidad</string>
+	<string name="settings_privacy_content"><![CDATA[In Gasteizko Margolariak we respect your privacy. We don\'t collect ANY data from our users, including personal information, location, shopping habits, sexual preferences, favourite colour, first love\'s name... ANY.<br/><br/>In order of making you believe us, we\'ll explain what we DO store:<br/><br/><ul><li>A randomly generated user code, unique to your device. This is neccessary to sync content with aur database, so you can get info about our post, activities... But it\'s done in a way that won\'t allow un to identify you as a person with that number.</li><li>When commenting on a photo ar an entry, we store your current IP address. This is incredibly usefull for us to know how many actual people are posting comments, and it also makes imposible for us to identify you as a person.</li></ul>]]></string>
+	<string name="settings_transparency">Transparencia</string>
+	<string name="settings_transparency_content"><![CDATA[¿Te preocupa saber dónde va tu dinero? En Gasteizko Margolariak queremos que estés tranquilo.<br/><br/>Muchas de nuestras actividades son gratuitas. Otras, como las fiestas de La Blanca, tienen una cuota de inscripción. Gasteizko Margolariak no es una empresa, es una Asociación Cultural, y como tal, no tenemos beneficios.<br/><br/>Queremos ser transparentes, y por eso, empezando en 2016, pondremos a tu disposición nuestras cuentas de manera online, para que sepas que cada euro se reinvierte en tí.]]></string>
+	<string name="lablanca_nofestivals">Las Fiestas de La Blanca. Esos días, del 4 al 9 de agosto, en los que Vitoria-Gasteiz se transforma. Se llena de color y alegría, y en cada esquina puedes encontrar actividades y espectáculos. Todos las estamos esperando.\n\nPor desgracia, aún hay que esperar más.\n\nNosotros ya estamos trabajando en ello. Tan pronto como vayamos sabiendo más, aquí iremos publicando nuestro programa y otra información sobre las fiestas.</string>
+	<string name="settings_about_content"><![CDATA[La Asociación Cultural Gasteizko Margolariak nace en el año 2013 con la idea de estimular la participación ciudadana y fortalecer la cultura y las tradiciones de Vitoria-Gasteiz.<br/><br/>En nuestro nombre se refleja un barrio en el que las calles nos recuerdan a grandes pintores: el barrio de San Martín. Estamos representados en los barrios, y creemos que son la esencia de esta ciudad.<br/><br/>Nos convertimos en Cuadrilla de Blusas y Neskas en 2013, y en ese mismo año, miembros de la Comisión de Blusas y Neskas.<br/><br/>Desde entonces no hemos hecho más que crecer junto con todos los que han decidido, año tras año, apostar por nosotros.]]></string>
+
 </resources>
 </resources>