Selaa lähdekoodia

Fixing bugs tied to internationalization

Denis Merigoux 9 vuotta sitten
vanhempi
commit
13a08911ee
4 muutettua tiedostoa jossa 261 lisäystä ja 204 poistoa
  1. 103 0
      counter/migrations/0008_auto_20170122_1732.py
  2. 147 199
      locale/fr/LC_MESSAGES/django.po
  3. 4 0
      seum/settings.py.default
  4. 7 5
      seum/urls.py

+ 103 - 0
counter/migrations/0008_auto_20170122_1732.py

@@ -0,0 +1,103 @@
1
+# -*- coding: utf-8 -*-
2
+# Generated by Django 1.10 on 2017-01-22 17:32
3
+from __future__ import unicode_literals
4
+
5
+from django.conf import settings
6
+from django.db import migrations, models
7
+import django.db.models.deletion
8
+
9
+
10
+class Migration(migrations.Migration):
11
+
12
+    dependencies = [
13
+        ('counter', '0007_auto_20170113_1603'),
14
+    ]
15
+
16
+    operations = [
17
+        migrations.AlterModelOptions(
18
+            name='counter',
19
+            options={'verbose_name': 'counter'},
20
+        ),
21
+        migrations.AlterModelOptions(
22
+            name='hashtag',
23
+            options={'verbose_name': 'hashtag', 'verbose_name_plural': 'hashtags'},
24
+        ),
25
+        migrations.AlterModelOptions(
26
+            name='keyword',
27
+            options={'verbose_name': 'keyword', 'verbose_name_plural': 'keywords'},
28
+        ),
29
+        migrations.AlterModelOptions(
30
+            name='reset',
31
+            options={'verbose_name': 'reset', 'verbose_name_plural': 'resets'},
32
+        ),
33
+        migrations.AlterField(
34
+            model_name='counter',
35
+            name='email_notifications',
36
+            field=models.BooleanField(default=False, verbose_name='email notifications'),
37
+        ),
38
+        migrations.AlterField(
39
+            model_name='counter',
40
+            name='name',
41
+            field=models.CharField(max_length=60, verbose_name='name'),
42
+        ),
43
+        migrations.AlterField(
44
+            model_name='counter',
45
+            name='sort_by_score',
46
+            field=models.BooleanField(default=True, verbose_name='sort by SeumScore'),
47
+        ),
48
+        migrations.AlterField(
49
+            model_name='counter',
50
+            name='trigramme',
51
+            field=models.CharField(max_length=3, verbose_name='trigram'),
52
+        ),
53
+        migrations.AlterField(
54
+            model_name='counter',
55
+            name='user',
56
+            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='associated user'),
57
+        ),
58
+        migrations.AlterField(
59
+            model_name='hashtag',
60
+            name='keyword',
61
+            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='hashtags', to='counter.Keyword', verbose_name='hashtag'),
62
+        ),
63
+        migrations.AlterField(
64
+            model_name='hashtag',
65
+            name='reset',
66
+            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='hashtags', to='counter.Reset', verbose_name='reset'),
67
+        ),
68
+        migrations.AlterField(
69
+            model_name='like',
70
+            name='liker',
71
+            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='likes', to='counter.Counter', verbose_name='liker'),
72
+        ),
73
+        migrations.AlterField(
74
+            model_name='like',
75
+            name='reset',
76
+            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='likes', to='counter.Reset', verbose_name='seum'),
77
+        ),
78
+        migrations.AlterField(
79
+            model_name='like',
80
+            name='timestamp',
81
+            field=models.DateTimeField(auto_now_add=True, verbose_name='datetime'),
82
+        ),
83
+        migrations.AlterField(
84
+            model_name='reset',
85
+            name='counter',
86
+            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='resets', to='counter.Counter', verbose_name='victim'),
87
+        ),
88
+        migrations.AlterField(
89
+            model_name='reset',
90
+            name='reason',
91
+            field=models.TextField(verbose_name='reason'),
92
+        ),
93
+        migrations.AlterField(
94
+            model_name='reset',
95
+            name='timestamp',
96
+            field=models.DateTimeField(auto_now_add=True, verbose_name='datetime'),
97
+        ),
98
+        migrations.AlterField(
99
+            model_name='reset',
100
+            name='who',
101
+            field=models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='who', to='counter.Counter', verbose_name='seum giver'),
102
+        ),
103
+    ]

+ 147 - 199
locale/fr/LC_MESSAGES/django.po

@@ -8,7 +8,7 @@ msgid ""
8 8
 msgstr ""
9 9
 "Project-Id-Version: PACKAGE VERSION\n"
10 10
 "Report-Msgid-Bugs-To: \n"
11
-"POT-Creation-Date: 2017-01-22 14:19+0100\n"
11
+"POT-Creation-Date: 2017-01-22 13:09-0500\n"
12 12
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 13
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 14
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -18,110 +18,6 @@ msgstr ""
18 18
 "Content-Transfer-Encoding: 8bit\n"
19 19
 "Plural-Forms: nplurals=2; plural=(n > 1);\n"
20 20
 
21
-#: counter/models.py:12
22
-msgid "name"
23
-msgstr "nom"
24
-
25
-#: counter/models.py:13
26
-msgid "email"
27
-msgstr "email"
28
-
29
-#: counter/models.py:14
30
-msgid "trigram"
31
-msgstr "trigramme"
32
-
33
-#: counter/models.py:15
34
-msgid "associated user"
35
-msgstr "utilisateur associé"
36
-
37
-#: counter/models.py:16
38
-msgid "email notifications"
39
-msgstr "notifications par email"
40
-
41
-#: counter/models.py:17
42
-msgid "sort by SeumScore"
43
-msgstr "trier par SeumScore"
44
-
45
-#: counter/models.py:20
46
-#, python-format
47
-msgid "%(trigram)s (%(name)s)"
48
-msgstr "%(trigram)s (%(name)s)"
49
-
50
-#: counter/models.py:23
51
-msgid "counter"
52
-msgstr "compteur"
53
-
54
-#: counter/models.py:27 counter/models.py:55
55
-msgid "datetime"
56
-msgstr "date et heure"
57
-
58
-#: counter/models.py:28
59
-msgid "reason"
60
-msgstr "raison"
61
-
62
-#: counter/models.py:29
63
-msgid "victim"
64
-msgstr "victime"
65
-
66
-#: counter/models.py:30
67
-msgid "seum giver"
68
-msgstr "fouteur de seum"
69
-
70
-#: counter/models.py:34
71
-#, python-format
72
-msgid "%(counter)s: %(datetime)s (%(reason)s)"
73
-msgstr "%(counter)s : %(datetime)s (%(reason)s)"
74
-
75
-#: counter/models.py:48 counter/models.py:79
76
-msgid "reset"
77
-msgstr "remise à zéro"
78
-
79
-#: counter/models.py:49
80
-msgid "resets"
81
-msgstr "remises à zéro"
82
-
83
-#: counter/models.py:53
84
-msgid "liker"
85
-msgstr "likeur"
86
-
87
-#: counter/models.py:54
88
-msgid "seum"
89
-msgstr "seum"
90
-
91
-#: counter/models.py:58
92
-msgid "like"
93
-msgstr "like"
94
-
95
-#: counter/models.py:59
96
-msgid "likes"
97
-msgstr "likes"
98
-
99
-#: counter/models.py:63
100
-#, python-format
101
-msgid "%(liker)s likes %(reset)s"
102
-msgstr "%(liker)s aime %(reset)s"
103
-
104
-#: counter/models.py:70
105
-msgid "keyword"
106
-msgstr "mot-clé"
107
-
108
-#: counter/models.py:71
109
-msgid "keywords"
110
-msgstr "mots-clés"
111
-
112
-#: counter/models.py:78 counter/models.py:82
113
-msgid "hashtag"
114
-msgstr "hashtag"
115
-
116
-#: counter/models.py:83
117
-msgid "hashtags"
118
-msgstr "hashtags"
119
-
120
-#: counter/models.py:86
121
-#, python-format
122
-msgid "%(keyword)s for %(who)s"
123
-msgstr "%(keyword)s pour %(who)s"
124
-
125 21
 #: counter/templates/counterTemplate.html:47
126 22
 #: counter/templates/homeTemplate.html:32
127 23
 #: counter/templates/homeTemplate.html:134
@@ -229,9 +125,6 @@ msgstr ""
229 125
 "sera ton identité seumesque !"
230 126
 
231 127
 #: counter/templates/createUser.html:36 counter/templates/homeTemplate.html:76
232
-#: counter/views/home.py:203 counter/views/home.py:209
233
-#: counter/views/home.py:247 counter/views/home.py:253
234
-#: counter/views/home.py:285 counter/views/home.py:291
235 128
 msgid "Trigram"
236 129
 msgstr "Trigramme"
237 130
 
@@ -509,96 +402,151 @@ msgstr ""
509 402
 "Un mail t'a été envoyé, suis les instructions pour aller réinitialiser ton "
510 403
 "mot de passe."
511 404
 
512
-#: counter/templates/resetEmail.txt:3
513
-msgid ""
514
-"You have lost your password and you've got the seum. You have to follow this "
515
-"link (or copy-paste it in your browser) to reinitialise it:"
516
-msgstr ""
517
-"T'as perdu ton mot de passe et t'as le seum. "
518
-"Il te reste plus qu'à suivre le lien pour le réinitialiser :"
405
+#~ msgid "name"
406
+#~ msgstr "nom"
519 407
 
520
-#: counter/templates/resetEmail.txt:7
521
-msgid "Your login is {{ user.username }} in case you have forgotten it too."
522
-msgstr "Ton nom d'utilisateur c'est {{ user.username }} au cas où tu l'aurais oublié aussi."
408
+#~ msgid "email"
409
+#~ msgstr "email"
523 410
 
524
-#: counter/templates/resetEmail.txt:18
525
-msgid ""
526
-"P.S.: If you don't want to receive these mails anymore, contact us at denis."
527
-"merigoux@gmail.com"
528
-msgstr "P.S. : Pour ne plus recevoir ces messages, envoie un mail à denis.merigoux@gmail.com"
529
-
530
-#: counter/views/counter.py:41
531
-msgid "unknown"
532
-msgstr "inconnu"
533
-
534
-#: counter/views/counter.py:81
535
-#, python-format
536
-msgid "From %(who)s: %(reason)s"
537
-msgstr "De %(who)s : %(reason)s"
538
-
539
-#: counter/views/home.py:161
540
-#, python-format
541
-msgid "%(counter)s: %(reason)s"
542
-msgstr "%(counter)s : %(reason)s"
543
-
544
-#: counter/views/home.py:163
545
-#, python-format
546
-msgid "%(who)s to %(counter)s: %(reason)s"
547
-msgstr "%(who)s pour %(counter)s : %(reason)s"
548
-
549
-#: counter/views/home.py:167
550
-msgid "Seum"
551
-msgstr "Seum"
552
-
553
-#: counter/views/home.py:184
554
-msgid "24h ago"
555
-msgstr "il y a 24h"
556
-
557
-#: counter/views/home.py:185
558
-msgid "Now"
559
-msgstr "Présent"
560
-
561
-#: counter/views/home.py:203 counter/views/home.py:208
562
-#: counter/views/home.py:228 counter/views/home.py:233
563
-msgid "Number of seums"
564
-msgstr "Nombre de seums"
565
-
566
-#: counter/views/home.py:228 counter/views/home.py:234
567
-msgid "Month"
568
-msgstr "Mois"
569
-
570
-#: counter/views/home.py:247 counter/views/home.py:252
571
-msgid "Number of given likes"
572
-msgstr "Nombre de likes distribués"
573
-
574
-#: counter/views/home.py:266 counter/views/home.py:272
575
-msgid "Hashtag"
576
-msgstr "Hashtag"
577
-
578
-#: counter/views/home.py:266 counter/views/home.py:271
579
-msgid "Number of seums containing the hashtag"
580
-msgstr "Nombre de seums contenant le hashtag"
581
-
582
-#: counter/views/home.py:285 counter/views/home.py:290
583
-msgid "Number of received likes"
584
-msgstr "Nombre de likes reçus"
585
-
586
-#: counter/views/user.py:22
587
-msgid "Passwords do not match."
588
-msgstr "Les mots de passe sont différents."
589
-
590
-#: counter/views/user.py:27
591
-msgid "A user with this email address already exists."
592
-msgstr "Un utilisateur avec cette adresse email existe déjà."
593
-
594
-#: counter/views/user.py:33
595
-msgid "Use another email address, another user has already this login."
596
-msgstr "Utilise une autre adresse email, un autre utilisateur a déjà ce login."
597
-
598
-#: seum/settings.py:111
599
-msgid "English"
600
-msgstr "Anglais"
601
-
602
-#: seum/settings.py:112
603
-msgid "French"
604
-msgstr "Français"
411
+#~ msgid "trigram"
412
+#~ msgstr "trigramme"
413
+
414
+#~ msgid "associated user"
415
+#~ msgstr "utilisateur associé"
416
+
417
+#~ msgid "email notifications"
418
+#~ msgstr "notifications par email"
419
+
420
+#~ msgid "sort by SeumScore"
421
+#~ msgstr "trier par SeumScore"
422
+
423
+#~ msgid "%(trigram)s (%(name)s)"
424
+#~ msgstr "%(trigram)s (%(name)s)"
425
+
426
+#~ msgid "counter"
427
+#~ msgstr "compteur"
428
+
429
+#~ msgid "datetime"
430
+#~ msgstr "date et heure"
431
+
432
+#~ msgid "reason"
433
+#~ msgstr "raison"
434
+
435
+#~ msgid "victim"
436
+#~ msgstr "victime"
437
+
438
+#~ msgid "seum giver"
439
+#~ msgstr "fouteur de seum"
440
+
441
+#~ msgid "%(counter)s: %(datetime)s (%(reason)s)"
442
+#~ msgstr "%(counter)s : %(datetime)s (%(reason)s)"
443
+
444
+#~ msgid "reset"
445
+#~ msgstr "remise à zéro"
446
+
447
+#~ msgid "resets"
448
+#~ msgstr "remises à zéro"
449
+
450
+#~ msgid "liker"
451
+#~ msgstr "likeur"
452
+
453
+#~ msgid "seum"
454
+#~ msgstr "seum"
455
+
456
+#~ msgid "like"
457
+#~ msgstr "like"
458
+
459
+#~ msgid "likes"
460
+#~ msgstr "likes"
461
+
462
+#~ msgid "%(liker)s likes %(reset)s"
463
+#~ msgstr "%(liker)s aime %(reset)s"
464
+
465
+#~ msgid "keyword"
466
+#~ msgstr "mot-clé"
467
+
468
+#~ msgid "keywords"
469
+#~ msgstr "mots-clés"
470
+
471
+#~ msgid "hashtag"
472
+#~ msgstr "hashtag"
473
+
474
+#~ msgid "hashtags"
475
+#~ msgstr "hashtags"
476
+
477
+#~ msgid "%(keyword)s for %(who)s"
478
+#~ msgstr "%(keyword)s pour %(who)s"
479
+
480
+#~ msgid ""
481
+#~ "You have lost your password and you've got the seum. You have to follow "
482
+#~ "this link (or copy-paste it in your browser) to reinitialise it:"
483
+#~ msgstr ""
484
+#~ "T'as perdu ton mot de passe et t'as le seum. Il te reste plus qu'à suivre "
485
+#~ "le lien pour le réinitialiser :"
486
+
487
+#~ msgid "Your login is {{ user.username }} in case you have forgotten it too."
488
+#~ msgstr ""
489
+#~ "Ton nom d'utilisateur c'est {{ user.username }} au cas où tu l'aurais "
490
+#~ "oublié aussi."
491
+
492
+#~ msgid ""
493
+#~ "P.S.: If you don't want to receive these mails anymore, contact us at "
494
+#~ "denis.merigoux@gmail.com"
495
+#~ msgstr ""
496
+#~ "P.S. : Pour ne plus recevoir ces messages, envoie un mail à denis."
497
+#~ "merigoux@gmail.com"
498
+
499
+#~ msgid "unknown"
500
+#~ msgstr "inconnu"
501
+
502
+#~ msgid "From %(who)s: %(reason)s"
503
+#~ msgstr "De %(who)s : %(reason)s"
504
+
505
+#~ msgid "%(counter)s: %(reason)s"
506
+#~ msgstr "%(counter)s : %(reason)s"
507
+
508
+#~ msgid "%(who)s to %(counter)s: %(reason)s"
509
+#~ msgstr "%(who)s pour %(counter)s : %(reason)s"
510
+
511
+#~ msgid "Seum"
512
+#~ msgstr "Seum"
513
+
514
+#~ msgid "24h ago"
515
+#~ msgstr "il y a 24h"
516
+
517
+#~ msgid "Now"
518
+#~ msgstr "Présent"
519
+
520
+#~ msgid "Number of seums"
521
+#~ msgstr "Nombre de seums"
522
+
523
+#~ msgid "Month"
524
+#~ msgstr "Mois"
525
+
526
+#~ msgid "Number of given likes"
527
+#~ msgstr "Nombre de likes distribués"
528
+
529
+#~ msgid "Hashtag"
530
+#~ msgstr "Hashtag"
531
+
532
+#~ msgid "Number of seums containing the hashtag"
533
+#~ msgstr "Nombre de seums contenant le hashtag"
534
+
535
+#~ msgid "Number of received likes"
536
+#~ msgstr "Nombre de likes reçus"
537
+
538
+#~ msgid "Passwords do not match."
539
+#~ msgstr "Les mots de passe sont différents."
540
+
541
+#~ msgid "A user with this email address already exists."
542
+#~ msgstr "Un utilisateur avec cette adresse email existe déjà."
543
+
544
+#~ msgid "Use another email address, another user has already this login."
545
+#~ msgstr ""
546
+#~ "Utilise une autre adresse email, un autre utilisateur a déjà ce login."
547
+
548
+#~ msgid "English"
549
+#~ msgstr "Anglais"
550
+
551
+#~ msgid "French"
552
+#~ msgstr "Français"

+ 4 - 0
seum/settings.py.default

@@ -105,6 +105,10 @@ LANGUAGES = [
105 105
     ('fr', _('French')),
106 106
 ]
107 107
 
108
+LOCALE_PATHS = [
109
+    os.path.join(BASE_DIR, 'locale'),
110
+]
111
+
108 112
 
109 113
 # Static files (CSS, JavaScript, Images)
110 114
 # https://docs.djangoproject.com/en/1.9/howto/static-files/

+ 7 - 5
seum/urls.py

@@ -19,14 +19,14 @@ from django.conf.urls.i18n import i18n_patterns
19 19
 from django.contrib import admin
20 20
 from django.views.generic.base import RedirectView
21 21
 
22
-urlpatterns = [url(r'^i18n/', include('django.conf.urls.i18n'), name='set_language'), ]
22
+urlpatterns = [
23
+    url(r'^i18n/', include('django.conf.urls.i18n'), name='set_language'),]
23 24
 
24
-urlpatterns += i18n_patterns(
25
+urlpatterns += [
25 26
     url(r'^admin/', admin.site.urls),
26
-
27 27
     url(r'^favicon\.ico$', RedirectView.as_view(url='/static/favicon.ico')),
28 28
     url(r'^robots\.txt$', RedirectView.as_view(url='/static/robots.txt')),
29
-)
29
+]
30 30
 
31 31
 if settings.DEBUG:
32 32
     import debug_toolbar
@@ -34,4 +34,6 @@ if settings.DEBUG:
34 34
         url(r'^__debug__/', include(debug_toolbar.urls)),
35 35
     )
36 36
 
37
-urlpatterns += i18n_patterns(url(r'^', include('counter.urls')), )
37
+urlpatterns += i18n_patterns(
38
+    url(r'^', include('counter.urls')),
39
+)