Permalink
Browse files

i18n: pages; missing .mo files

  • Loading branch information...
nmfm committed Feb 15, 2012
1 parent 614327c commit 99c5037002c50d4d95f68fd38362cbc8626c756f
View
@@ -4,7 +4,6 @@
*.swo
*.pyo
*~
-*.mo
/build/
/dist/
/env/
Binary file not shown.
Binary file not shown.
View
@@ -1,4 +1,5 @@
from django.core.urlresolvers import reverse
+from django.utils.translation import ugettext as _
import recentchanges
from recentchanges import RecentChanges
@@ -38,7 +39,7 @@ def page(self, obj):
return page
def title(self, obj):
- return 'File %s on page "%s"' % (obj.name, self.page(obj).name)
+ return _('File %(filename)s on page "%(pagename)s"') % {'filename': obj.name, 'pagename': self.page(obj).name})
def diff_url(self, obj):
return reverse('pages:file-compare-dates', kwargs={
@@ -75,5 +76,5 @@ def get_object(self, request, slug='', file=''):
obj = PageFile(slug=slugify(slug), name=file)
page = Page(slug=slugify(slug))
obj.page = page.versions.most_recent()
- obj.title = 'File %s on page "%s"' % (obj.name, obj.page.name)
+ obj.title = _('File %(filename)=s on page "%(pagename)s"') % {'filename': obj.name, 'pagename': obj.pageobj.name}
return obj
View
@@ -1,4 +1,5 @@
from django import forms
+from django.utils.translation import ugettext_lazy as _
from .models import Page, slugify
@@ -18,7 +19,7 @@ def clean(self, value):
return self.queryset.filter(slug=slugify(value)).get()
except self.queryset.model.DoesNotExist:
raise forms.ValidationError(
- "Page %s does not exist! Please enter a valid page name." % (
+ _("Page %s does not exist! Please enter a valid page name.") % (
self.queryset.model._meta.verbose_name,))
def prepare_value(self, value):
View
@@ -1,6 +1,7 @@
import mimetypes
from django import forms
+from django.utils.translation import ugettext_lazy as _
from versionutils.merging.forms import MergeMixin
from versionutils.versioning.forms import CommentMixin
@@ -10,7 +11,7 @@
class PageForm(MergeMixin, CommentMixin, forms.ModelForm):
- conflict_error = (
+ conflict_error = _(
"Warning: someone else saved this page before you. "
"Please resolve edit conflicts and save again."
)
@@ -42,7 +43,7 @@ def clean_name(self):
page = Page.objects.get(slug__exact=slugify(name))
if self.instance != page:
raise forms.ValidationError(
- 'A page with this name already exists'
+ _('A page with this name already exists')
)
except Page.DoesNotExist:
pass
@@ -58,7 +59,7 @@ def clean(self):
(mime_type, enc) = mimetypes.guess_type(filename)
if mime_type != self.instance.mime_type:
raise forms.ValidationError(
- 'The new file should be of the same type')
+ _('The new file should be of the same type'))
return self.cleaned_data
class Meta:
Binary file not shown.
Oops, something went wrong.

0 comments on commit 99c5037

Please sign in to comment.