Merge lp:~benoit.soyeux/tomdroid/translation into lp:~tomdroid-maintainers/tomdroid/main

Proposed by Benoit Soyeux
Status: Merged
Merged at revision: 216
Proposed branch: lp:~benoit.soyeux/tomdroid/translation
Merge into: lp:~tomdroid-maintainers/tomdroid/main
Diff against target: 297 lines (+80/-34)
9 files modified
.classpath (+2/-2)
res/values-fr/arrays.xml (+2/-2)
res/values-fr/strings.xml (+27/-3)
res/values/strings.xml (+24/-0)
res/xml/preferences.xml (+1/-1)
src/org/tomdroid/sync/SyncService.java (+2/-1)
src/org/tomdroid/ui/SyncMessageHandler.java (+15/-19)
src/org/tomdroid/ui/Tomdroid.java (+2/-3)
src/org/tomdroid/util/NoteListCursorAdapter.java (+5/-3)
To merge this branch: bzr merge lp:~benoit.soyeux/tomdroid/translation
Reviewer Review Type Date Requested Status
Benoit Garret Approve
Benoit Soyeux (community) Needs Resubmitting
Review via email: mp+42062@code.launchpad.net

Description of the change

I Add some string in ressource to allow more transaltaion.
I translate all application in French including new module like note sorting and notebook filtering

To post a comment you must log in.
Revision history for this message
Benoit Garret (benoit.garret) wrote :

Thanks for your work, removing hardcoded string is very welcome.

Unfortunately, your branch has conflicts: when you read the merge description, you will notice this:

Text conflict in res/values-fr/strings.xml
Text conflict in res/values/strings.xml

Please fix the conflicts, I'll merge this branch as soon as it's done.

review: Needs Fixing
Revision history for this message
Benoit Soyeux (benoit.soyeux) wrote :

I see that main branch containt some information about market.
I add it to my file.

Is it good ?
In all values.xml, you can merge by adding entries that is not in one to other

review: Needs Resubmitting
220. By Benoit Soyeux

Add info from android market

Revision history for this message
Benoit Garret (benoit.garret) wrote :

Urgh, no. Adding manually the changes that have been done in the main branch is really, really bad. You should do a merge from the main branch instead.

If I've understood correctly, you're using bzr explorer instead of the command-line tool. To do the merge, open your branch in the explorer and click the merge button. In the location box, put lp:tomdroid (it is the branch you want to merge from).

You will have conflicts (as shown on this page by launchpad). For each one, edit the file to make the errors disappear, then use the "Mark conflict resolved" in the right click menu in the file explorer.

Once all the conflicts are resolved, commit and push your branch.

I could have done this myself, but it's much better for you to learn how to merge on a small branch like this one. Besides, many maintainers of open source projects will refuse to look at your contributions if they do not apply cleanly to the main development branch.

If you have any problem, do not hesitate to ask for more help. The most useful tool at this point, for this kind of help, would be IM. You can reach me at prénom point nom at gmail.com.

221. By Benoit Soyeux

I resolve conflict on res/values/string.xml files

Revision history for this message
Benoit Soyeux (benoit.soyeux) wrote :

Ok I do it.

Revision history for this message
Benoit Garret (benoit.garret) wrote :

One last thing (I know I'm picky ;-) ): could you replace the string concatenations (building a string with +) by string formatting? Strings like messageSyncCompleteBegin and messageSyncCompleteEnd are likely to cause problems when more translations are added.

The method shown in this blog post would be perfect: http://mobile.tutsplus.com/tutorials/android/android-sdk-format-strings/

I'll merge everything once it's done.

222. By Benoit Soyeux

I add some translation with parameter as ask by Benoit Garet.

Revision history for this message
Benoit Soyeux (benoit.soyeux) wrote :

Thank you for the link.
It will be more clean.
I do it what you ask me.

review: Needs Resubmitting
Revision history for this message
Olivier Bilodeau (plaxx) wrote :

I'll let Benoit approve or give further comments but I wanted to drop by and say thanks for handling that task! It's very appreciated!

Revision history for this message
Benoit Garret (benoit.garret) wrote :

I'll merge this tonight. Thanks a lot for putting up with my criticisms and seeing this task through to the end, you did a superb job at it.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.classpath'
2--- .classpath 2010-10-14 03:51:26 +0000
3+++ .classpath 2010-12-07 21:28:13 +0000
4@@ -1,10 +1,10 @@
5 <?xml version="1.0" encoding="UTF-8"?>
6 <classpath>
7- <classpathentry kind="src" path="src"/>
8 <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
9- <classpathentry kind="src" path="gen"/>
10 <classpathentry kind="lib" path="libs/signpost-commonshttp4-1.2.1.1.jar"/>
11 <classpathentry kind="lib" path="libs/signpost-core-1.2.1.1.jar"/>
12 <classpathentry kind="src" path="tests"/>
13+ <classpathentry kind="src" path="src"/>
14+ <classpathentry kind="src" path="gen"/>
15 <classpathentry kind="output" path="bin"/>
16 </classpath>
17
18=== modified file 'res/values-fr/arrays.xml'
19--- res/values-fr/arrays.xml 2010-10-15 02:59:10 +0000
20+++ res/values-fr/arrays.xml 2010-12-07 21:28:13 +0000
21@@ -5,7 +5,7 @@
22 <item>sort_title</item>
23 </array>
24 <array name="sortOrderValues">
25- <item>Date Modified</item>
26- <item>Note Title</item>
27+ <item>Date de modification</item>
28+ <item>Titre de la note</item>
29 </array>
30 </resources>
31
32=== modified file 'res/values-fr/strings.xml'
33--- res/values-fr/strings.xml 2010-10-24 18:54:07 +0000
34+++ res/values-fr/strings.xml 2010-12-07 21:28:13 +0000
35@@ -31,13 +31,14 @@
36
37 <!-- main.xml -->
38 <string name="strListEmptyWaiting">Veuillez patienter pendant que les notes se chargent...</string>
39- <string name="strListEmptyNoNotes">
40- Il n\'y a pas de note dans la base de données Tomdroid.
41+ <string name="strListEmptyNoNotes">
42+ Il n\'y a pas de note dans la base de données Tomdroid.
43 </string>
44
45 <string name="menuSync">Sync</string>
46 <string name="menuPrefs">Préférences</string>
47 <string name="menuAbout">À propos</string>
48+ <string name="titleWelcome">Attention</string>
49 <string name="strWelcome">
50 Bienvenue sur Tomdroid.
51 \n\nVeuillez noter que l\'application est en phase beta et qu\'elle contient des problèmes connus,
52@@ -72,6 +73,30 @@
53 <string name="prefSyncConnectionFailed">La connexion au serveur a échoué, veuillez vérifier l\'adresse que vous avez entrée si elle est correcte.</string>
54 <string name="prefServerEmpty">L\'adresse du serveur a changé mais la nouvelle valeur est vide</string>
55
56+ <string name="titleSyncService">service de synchronisation</string>
57+ <string name="messageSyncComplete">La synchronisation avec %1$s est terminée</string>
58+ <string name="messageSyncNoNote">Aucune note trouvée sur %1$s .</string>
59+ <string name="messageSyncNoConnection">Aucune connection à Internet</string>
60+ <string name="messageSyncAlreadyInProgress">Synchronisation déjà en cours</string>
61+ <string name="messageSyncError">Il y a une erreur lors de la syncrhonisation. Si vous pouvez reproduire le problème, contactez nous !</string>
62+ <string name="error">erreur</string>
63+
64+ <!-- NoteSorting -->
65+ <string name="menuSort">Changer tri</string>
66+ <string name="titleDefaultSorting">Choix du tri par défaut</string>
67+ <string name="prefDefaultSorting">Tri par défaut</string>
68+
69+ <!-- NoteFiltering -->
70+ <string name="menuFilterNotebook">Filtrer</string>
71+ <string name="strListEmptyNoNotebooks">Il n\'y a aucun bloc-note dans la base de donnèes</string>
72+ <string name="allNotebooksFilter">Tous les bloc-notes</string>
73+
74+
75+ <!-- Date -->
76+ <string name="textModified">Mise à jour: </string>
77+ <string name="textToday">Aujourd\'hui</string>
78+ <string name="textYexterday">Hier</string>
79+
80 <!--
81 Information that goes into the Android Market Application Listing.
82 I've put it in here so that it'll get translated by translators.
83@@ -91,5 +116,4 @@
84 </string>
85 <!-- 80 chars max -->
86 <string name="market_promotext">Appli de prise de notes avec synchronisation en ligne compatible avec Tomboy</string>
87-
88 </resources>
89
90=== modified file 'res/values/strings.xml'
91--- res/values/strings.xml 2010-10-24 18:54:07 +0000
92+++ res/values/strings.xml 2010-12-07 21:28:13 +0000
93@@ -35,6 +35,7 @@
94 <string name="menuSync">Sync</string>
95 <string name="menuPrefs">Settings</string>
96 <string name="menuAbout">About</string>
97+ <string name="titleWelcome">Warning</string>
98 <string name="strWelcome">
99 Welcome to Tomdroid.
100 \n\nPlease note that this is beta quality software and that it contains known problems,
101@@ -69,6 +70,29 @@
102 <string name="prefSyncConnectionFailed">The connection to the server has failed, please check that the address you entered is correct.</string>
103 <string name="prefServerEmpty">The server address changed but the new value is empty</string>
104
105+ <string name="titleSyncService">Choose the sync service to use</string>
106+ <string name="messageSyncComplete">Synchronization with %1$s is complete</string>
107+ <string name="messageSyncNoNote">No notes found on %1$s .</string>
108+ <string name="messageSyncNoConnection">You are not connected to the Internet.</string>
109+ <string name="messageSyncAlreadyInProgress">Sync already in progress</string>
110+ <string name="messageSyncError">There was an error trying to parse your note collection. If you are able to replicate the problem, please contact us!</string>
111+ <string name="error">error</string>
112+
113+ <!-- NoteSorting -->
114+ <string name="menuSort">change sort</string>
115+ <string name="titleDefaultSorting">Choose the default sorting</string>
116+ <string name="prefDefaultSorting">Default sort</string>
117+
118+ <!-- NotebookFiltering -->
119+ <string name="menuFilterNotebook">Filter</string>
120+ <string name="strListEmptyNoNotebooks">There are no notebooks in the database.</string>
121+ <string name="allNotebooksFilter">All notebooks</string>
122+
123+ <!-- Date -->
124+ <string name="textModified">Modified: </string>
125+ <string name="textToday">Today</string>
126+ <string name="textYexterday">Yesterday</string>
127+
128 <!--
129 Information that goes into the Android Market Application Listing.
130 I've put it in here so that it'll get translated by translators.
131
132=== modified file 'res/xml/preferences.xml'
133--- res/xml/preferences.xml 2010-09-26 11:34:42 +0000
134+++ res/xml/preferences.xml 2010-12-07 21:28:13 +0000
135@@ -4,7 +4,7 @@
136 <PreferenceCategory android:title="@string/prefSync">
137
138 <ListPreference android:title="@string/prefSyncService"
139- android:dialogTitle="Choose the sync service to use"
140+ android:dialogTitle="@string/titleSyncService"
141 android:key="sync_service"
142 android:defaultValue="tomboy-web"/>
143
144
145=== modified file 'src/org/tomdroid/sync/SyncService.java'
146--- src/org/tomdroid/sync/SyncService.java 2010-08-30 16:33:02 +0000
147+++ src/org/tomdroid/sync/SyncService.java 2010-12-07 21:28:13 +0000
148@@ -33,6 +33,7 @@
149 import org.tomdroid.NoteManager;
150 import org.tomdroid.ui.Tomdroid;
151
152+import org.tomdroid.R;
153 import android.app.Activity;
154 import android.database.Cursor;
155 import android.os.Handler;
156@@ -68,7 +69,7 @@
157 public void startSynchronization() {
158
159 if (syncProgress != 100){
160- Toast.makeText(activity, "Sync already in prgress", Toast.LENGTH_SHORT).show();
161+ Toast.makeText(activity, activity.getString(R.string.messageSyncAlreadyInProgress), Toast.LENGTH_SHORT).show();
162 return;
163 }
164
165
166=== modified file 'src/org/tomdroid/ui/SyncMessageHandler.java'
167--- src/org/tomdroid/ui/SyncMessageHandler.java 2010-08-25 19:43:16 +0000
168+++ src/org/tomdroid/ui/SyncMessageHandler.java 2010-12-07 21:28:13 +0000
169@@ -28,6 +28,7 @@
170
171 import android.app.Activity;
172 import android.app.AlertDialog;
173+import android.content.Context;
174 import android.content.DialogInterface;
175 import android.content.DialogInterface.OnClickListener;
176 import android.os.Handler;
177@@ -55,23 +56,20 @@
178 @Override
179 public void handleMessage(Message msg) {
180
181+ String serviceDescription = SyncManager.getInstance().getCurrentService().getDescription();
182+ String message = "";
183+
184 switch (msg.what) {
185- case SyncService.PARSING_COMPLETE:
186- // TODO put string in a translatable bundle
187- Toast.makeText(
188- activity,
189- "Synchronization with "
190- + SyncManager.getInstance().getCurrentService().getDescription()
191- + " is complete.", Toast.LENGTH_SHORT).show();
192+ case SyncService.PARSING_COMPLETE:
193+ message = this.activity.getString(R.string.messageSyncComplete);
194+ message = String.format(message,serviceDescription);
195+ Toast.makeText( activity,message, Toast.LENGTH_SHORT).show();
196 break;
197
198 case SyncService.PARSING_NO_NOTES:
199- // TODO put string in a translatable bundle
200- Toast.makeText(
201- activity,
202- "No notes found on "
203- + SyncManager.getInstance().getCurrentService().getDescription()
204- + ".", Toast.LENGTH_SHORT).show();
205+ message = this.activity.getString(R.string.messageSyncNoNote);
206+ message = String.format(message,serviceDescription);
207+ Toast.makeText(activity,message, Toast.LENGTH_SHORT).show();
208 break;
209
210 case SyncService.PARSING_FAILED:
211@@ -83,11 +81,9 @@
212 if (!parsingErrorShown) {
213 parsingErrorShown = true;
214
215- // TODO put error string in a translatable resource
216- new AlertDialog.Builder(activity).setMessage(
217- "There was an error trying to parse your note collection. If "
218- + "you are able to replicate the problem, please contact us!")
219- .setTitle("Error").setNeutralButton("Ok", new OnClickListener() {
220+ message = this.activity.getString(R.string.messageSyncError);
221+ new AlertDialog.Builder(activity).setMessage(message)
222+ .setTitle(this.activity.getString(R.string.error)).setNeutralButton("Ok", new OnClickListener() {
223 public void onClick(DialogInterface dialog, int which) {
224 dialog.dismiss();
225 }
226@@ -97,7 +93,7 @@
227
228 case SyncService.NO_INTERNET:
229 // TODO put string in a translatable bundle
230- Toast.makeText(activity, "You are not connected to the internet.",
231+ Toast.makeText(activity, this.activity.getString(R.string.messageSyncNoConnection),
232 Toast.LENGTH_SHORT).show();
233 break;
234
235
236=== modified file 'src/org/tomdroid/ui/Tomdroid.java'
237--- src/org/tomdroid/ui/Tomdroid.java 2010-10-09 19:58:11 +0000
238+++ src/org/tomdroid/ui/Tomdroid.java 2010-12-07 21:28:13 +0000
239@@ -102,7 +102,7 @@
240
241 // Warn that this is a "will eat your babies" release
242 new AlertDialog.Builder(this).setMessage(getString(R.string.strWelcome)).setTitle(
243- "Warning").setNeutralButton("Ok", new OnClickListener() {
244+ getString(R.string.titleWelcome)).setNeutralButton("Ok", new OnClickListener() {
245 public void onClick(DialogInterface dialog, int which) {
246 Preferences.putBoolean(Preferences.Key.FIRST_RUN, false);
247 dialog.dismiss();
248@@ -157,8 +157,7 @@
249 if (uri != null && uri.getScheme().equals("tomdroid")) {
250 Log.i(TAG, "Got url : " + uri.toString());
251
252- final ProgressDialog dialog = ProgressDialog.show(this, "",
253- "Completing authentication. Please wait...", true, false);
254+ final ProgressDialog dialog = ProgressDialog.show(this, "", "Completing authentication. Please wait...", true, false);
255
256 Handler handler = new Handler() {
257
258
259=== modified file 'src/org/tomdroid/util/NoteListCursorAdapter.java'
260--- src/org/tomdroid/util/NoteListCursorAdapter.java 2010-10-09 19:45:06 +0000
261+++ src/org/tomdroid/util/NoteListCursorAdapter.java 2010-12-07 21:28:13 +0000
262@@ -44,6 +44,7 @@
263
264 private int layout;
265 private int[] colors = new int[] { 0xFFFFFFFF, 0xFFEEEEEE };
266+ private Context context;
267
268 private DateFormat localeDateFormat;
269 private DateFormat localeTimeFormat;
270@@ -51,6 +52,7 @@
271 public NoteListCursorAdapter (Context context, int layout, Cursor c, String[] from, int[] to) {
272 super(context, layout, c, from, to);
273 this.layout = layout;
274+ this.context = context;
275 localeDateFormat = DateFormat.getDateInstance(DateFormat.SHORT);
276 localeTimeFormat = DateFormat.getTimeInstance(DateFormat.SHORT);
277 }
278@@ -98,16 +100,16 @@
279 Long lastModifiedMillis = lastModified.toMillis(false);
280 Date lastModifiedDate = new Date(lastModifiedMillis);
281
282- String strModified = "Modified: ";
283+ String strModified = this.context.getString(R.string.textModified)+" ";
284 //TODO this is very inefficient
285 if (DateUtils.isToday(lastModifiedMillis)){
286- strModified += "Today, " + localeTimeFormat.format(lastModifiedDate);
287+ strModified += this.context.getString(R.string.textToday) +", " + localeTimeFormat.format(lastModifiedDate);
288 } else {
289 // Add a day to the last modified date - if the date is now today, it means the note was edited yesterday
290 Time yesterdayTest = lastModified;
291 yesterdayTest.monthDay += 1;
292 if (DateUtils.isToday(yesterdayTest.toMillis(false))){
293- strModified += "Yesterday, " + localeTimeFormat.format(lastModifiedDate);
294+ strModified += this.context.getString(R.string.textYexterday) +", " + localeTimeFormat.format(lastModifiedDate);
295 } else {
296 strModified += localeDateFormat.format(lastModifiedDate) + ", " + localeTimeFormat.format(lastModifiedDate);
297 }

Subscribers

People subscribed via source and target branches