Commit bed99964 authored by Schoumi's avatar Schoumi

Better handle of string to avoid static string in code

Add language english by default and french as second supported languague
parent 1b85bb2f
*.apk
# Generated files
bin/
gen/
......
......@@ -109,7 +109,7 @@ public class NetworkManager {
conn = (HttpURLConnection) url.openConnection();
}
else {
listener.fileUploadError("Connection Failed");
listener.fileUploadError(context.getString(R.string.connection_failed));
return null;
}
String location = conn.getHeaderField("Location");
......@@ -165,7 +165,7 @@ public class NetworkManager {
}
} catch (IOException e1) {
e1.printStackTrace();
listener.fileUploadError("Network Error");
listener.fileUploadError(context.getString(R.string.network_error));
}
if(stream != null) {
......@@ -215,7 +215,7 @@ public class NetworkManager {
}
} catch (JSONException e) {
e.printStackTrace();
listener.fileUploadError("JSON Unreadable");
listener.fileUploadError(context.getString(R.string.unreadable_json));
}
}
return imgOutput;
......
......@@ -281,7 +281,7 @@ public class MainActivity extends ActionBarActivity {
NetworkManager.getInstance(listener, getApplicationContext()).upload(url, delete, fileName, bytearray);
}
else {
listener.fileUploadError("Empty file or Unable to read the file");
listener.fileUploadError(getString(R.string.empty_file));
}
}
......
<resources>
<string name="app_name">Gobelim</string>
<string name="action_settings">Paramètres</string>
<string name="title_activity_share">Partager</string>
<string name="title_activity_history">Historique</string>
<string name="title_activity_link">Partager le lien</string>
<string name="title_activity_servers">Liste des serveurs</string>
<string name="upload_pict">Envoyer</string>
<string name="select_pict">Selectionner une Image</string>
<string name="duration">durée de\nConservation</string>
<string name="copy_to_clipboard">Lien copié dans le presse-papier</string>
<string name="server_title">Ajouter un serveur</string>
<string name="url">Adresse du site</string>
<string name="add_server">Ajouter un serveur</string>
<string name="manage_server">Gérer les serveurs</string>
<string name="show_history">Voir l\'historique</string>
<string name="delete_server_message">Supprimer le serveur</string>
<string name="upload_progress">Envoi en cours</string>
<string name="no_duration">\u221E</string>
<string name="duration_ended">Supprimée</string>
<string name="days">Jours restants</string>
<string name="day">Jour restant</string>
<string name="server_list_error">Vous n\'avez aucun serveur configuré, merci d\'en ajouter un</string>
<string name="network_error">Erreur Réseau</string>
<string name="connection_failed">Echec de Connexion</string>
<string name="unreadable_json">JSON Illisible</string>
<string name="empty_file">Fichier vide ou impossible à lire</string>
<string name="too_large_file">Le fichier est peut être trop grand</string>
<string-array name="deleted_days">
<item>Pas de limitation</item>
<item>24 Heures</item>
<item>7 Jours</item>
<item>30 Jours</item>
<item>1 an</item>
</string-array>
<string-array name="https">
<item>http://</item>
<item>https://</item>
</string-array>
</resources>
<resources>
<string name="app_name">Gobelim</string>
<string name="action_settings">Paramètres</string>
<string name="title_activity_share">Partager</string>
<string name="title_activity_history">Historique</string>
<string name="title_activity_link">Partager le lien</string>
<string name="title_activity_servers">Liste des serveurs</string>
<string name="upload_pict">Envoyer</string>
<string name="select_pict">Selectionner une Image</string>
<string name="duration">durée de\nConservation</string>
<string name="copy_to_clipboard">Lien copié dans le presse-papier</string>
<string name="server_title">Ajouter un serveur</string>
<string name="url">Adresse du site</string>
<string name="add_server">Ajouter un serveur</string>
<string name="manage_server">Gérer les serveurs</string>
<string name="show_history">Voir l\'historique</string>
<string name="delete_server_message">Supprimer le server</string>
<string name="upload_progress">Envoi en cours</string>
<string name="action_settings">Parameters</string>
<string name="title_activity_share">Share</string>
<string name="title_activity_history">History</string>
<string name="title_activity_link">Share the link</string>
<string name="title_activity_servers">Servers List</string>
<string name="upload_pict">Upload</string>
<string name="select_pict">Pick an Image</string>
<string name="duration">Storage\nDuration</string>
<string name="copy_to_clipboard">Link copy to clipboard</string>
<string name="server_title">Add a server</string>
<string name="url">Site Url</string>
<string name="add_server">Add a server</string>
<string name="manage_server">Manage servers</string>
<string name="show_history">Show history</string>
<string name="delete_server_message">Delete the server</string>
<string name="upload_progress">Upload in progress</string>
<string name="no_duration">\u221E</string>
<string name="duration_ended">Supprimée</string>
<string name="days">Jours restants</string>
<string name="day">Jour restant</string>
<string name="server_list_error">Vous n\'avez aucun serveur configuré, merci d\'en ajouter un</string>
<string name="duration_ended">Deleted</string>
<string name="days">Remaining Days</string>
<string name="day">Remaining Day</string>
<string name="server_list_error">You haven\'t any configured server, please add one</string>
<string name="network_error">Network Error</string>
<string name="connection_failed">Connection Fail</string>
<string name="unreadable_json">Unreadable JSON</string>
<string name="empty_file">Empty file or unable to read it</string>
<string name="too_large_file">The file may be too large</string>
<string-array name="deleted_days">
<item>Pas de limitation</item>
<item>24 Heures</item>
<item>7 Jours</item>
<item>30 Jours</item>
<item>1 an</item>
<item>No limitation</item>
<item>24 Hours</item>
<item>7 Days</item>
<item>30 Days</item>
<item>1 Year</item>
</string-array>
<string-array name="https">
<item>http://</item>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment