← Back to team overview

harvest-dev team mailing list archive

[Merge] lp:~dylanmccall/harvest/bug-804020-missing-translations into lp:harvest

 

Dylan McCall has proposed merging lp:~dylanmccall/harvest/bug-804020-missing-translations into lp:harvest.

Requested reviews:
  harvest-dev (harvest-dev)
Related bugs:
  Bug #804020 in harvest: "Spanish translation is almost nonexistent "
  https://bugs.launchpad.net/harvest/+bug/804020

For more details, see:
https://code.launchpad.net/~dylanmccall/harvest/bug-804020-missing-translations/+merge/66515

Just adding making some strings translatable that weren't before, hopefully to satisfy bug #804020. I don't know how to generate Harvest's .pot file (*blushes*) so I'll leave that to someone else :)

The way I did PkgNameFilter's placeholder text might look a tad funny. It felt wrong to add gettext to that module for a single little string (all the other strings come from outside), so I made it a variable that we set to a translated string in harvest.opportunities.filters.
-- 
https://code.launchpad.net/~dylanmccall/harvest/bug-804020-missing-translations/+merge/66515
Your team harvest-dev is requested to review the proposed merge of lp:~dylanmccall/harvest/bug-804020-missing-translations into lp:harvest.
=== modified file 'harvest/filters/filters.py'
--- harvest/filters/filters.py	2011-02-22 03:15:06 +0000
+++ harvest/filters/filters.py	2011-06-30 19:31:05 +0000
@@ -211,6 +211,8 @@
     
     html_class = 'filter editfilter'
     
+    placeholder = 'type here'
+    
     def __init__(self, id_str, **kwargs):
         Filter.__init__(self, id_str, **kwargs)
         self.input_str = ""
@@ -228,7 +230,7 @@
         field_value = self.get_value()
         if field_value:
             field_value = 'value="%s"' % field_value 
-        return '<input type="text" placeholder="(type here)" spellcheck="false" %s />' % field_value
+        return '<input type="text" placeholder="%s" spellcheck="false" %s />' % (self.placeholder, field_value)
 
 
 class SetFilter(Filter): #abstract, extend in application

=== modified file 'harvest/opportunities/filters.py'
--- harvest/opportunities/filters.py	2011-02-22 03:21:41 +0000
+++ harvest/opportunities/filters.py	2011-06-30 19:31:05 +0000
@@ -5,6 +5,8 @@
 import models
 
 class PkgNameFilter(filters.EditFilter):
+    placeholder = _('type here')
+    
     def process_queryset(self, queryset):
         return queryset.filter(name__startswith = self.get_value())
 
@@ -89,12 +91,12 @@
                 filters.FilterGroup('pkg', [
                     PkgNameFilter('name', name=_('Named')),
                     PkgSetFilter('set', name=_('Limit to'))
-                ], name='Packages' ),
+                ], name=_('Packages') ),
                 filters.FilterGroup('opp', [
                     OppFeaturedFilter('featured', name=_('Featured')),
                     OppListFilter('list', name=_('Limit to')),
                     OppStatusFilter('status', name=_('Status'))
-                ], name='Opportunities' )
+                ], name=_('Opportunities') )
             ],
             default_parameters = { 'pkg' : ['set'],
                                 'pkg.set' : ['ubuntu-desktop'],


Follow ups