Commit 0f3e8aed authored by Michal Čihař's avatar Michal Čihař

Change string used for plurals separation

Using \x00 proven to be bad idea as some databases (eg. SQLite) does not
cope with string containing this. Using \x1e (Record Separator) should
be safe in this regard.

Fixes #266.
parent 2d921718
...@@ -23,7 +23,6 @@ import time ...@@ -23,7 +23,6 @@ import time
from south.db import db from south.db import db
from south.v2 import DataMigration from south.v2 import DataMigration
from django.db import models from django.db import models
from trans.util import PLURAL_SEPARATOR
class Migration(DataMigration): class Migration(DataMigration):
...@@ -51,7 +50,7 @@ class Migration(DataMigration): ...@@ -51,7 +50,7 @@ class Migration(DataMigration):
checksum=unit.checksum, checksum=unit.checksum,
ignore=False ignore=False
).exists() ).exists()
unit.num_words = len(unit.source.split(PLURAL_SEPARATOR)[0].split()) unit.num_words = len(unit.source.split('\x00\x00')[0].split())
unit.save() unit.save()
done += 1 done += 1
if done % 1000 == 0: if done % 1000 == 0:
......
This diff is collapsed.
...@@ -52,7 +52,7 @@ AVATAR_DEFAULT_IMAGE = getattr( ...@@ -52,7 +52,7 @@ AVATAR_DEFAULT_IMAGE = getattr(
'identicon' 'identicon'
) )
PLURAL_SEPARATOR = '\x00\x00' PLURAL_SEPARATOR = '\x1e\x1e'
def avatar_for_email(email, size=80): def avatar_for_email(email, size=80):
......
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