Fix i18n issue with 'ago' translations

This commit is contained in:
Keith Mitchell
2011-12-02 16:45:00 -08:00
parent a3aabff799
commit 9f136da5d7
6 changed files with 8 additions and 7 deletions

View File

@@ -177,9 +177,10 @@ class Globals(object):
self.running_as_script = global_conf.get('running_as_script', False)
# turn on for language support
if not hasattr(self, 'lang'): self.lang = 'en'
if not hasattr(self, 'lang'):
self.lang = 'en'
self.languages, self.lang_name = \
get_active_langs(default_lang= self.lang)
get_active_langs(default_lang=self.lang)
all_languages = self.lang_name.keys()
all_languages.sort()

View File

@@ -594,7 +594,7 @@ def get_active_langs(path = _i18n_path, default_lang = 'en'):
trans_name = {}
for lang in os.listdir(path):
x = os.path.join(path, lang, 'LC_MESSAGES')
if os.path.exists(x) and os.path.isdir(x):
if os.path.isdir(x):
name = Translator.get_name(lang)
trans_name[lang] = name
if Translator.is_enabled(lang) and Translator.in_use(lang):

View File

@@ -104,7 +104,7 @@ ${parent.collapsed()}
%if show:
${unsafe(self.score(thing, likes = thing.likes))} 
%endif
${thing_timestamp(thing, thing.timesince)} ${_("ago")}
${_("%(when)s ago") % dict(when=thing_timestamp(thing, thing.timesince))}
%if thing.editted:
<em>*</em>&nbsp;
%endif

View File

@@ -43,7 +43,7 @@
%if thing.deleted:
<small>
<b>${_("[deleted]")}</b> ${thing.timesince} ${_("ago")}
<b>${_("[deleted]")}</b> ${_("%(when)s ago") % dict(when=thing.timesince)}
</small>
%else:

View File

@@ -35,7 +35,7 @@
%endif
/>
<label for="comment-visits-${i}">
${visit} ${_("ago")}
${_("%(when)s ago") % dict(when=visit)}
</label>
</div>
%endfor

View File

@@ -46,7 +46,7 @@
<tr>
<td>${ip}</td>
<td>${location.get('country_name', '')}</td>
<td>${timestamp(last_visit)}&#32;${_('ago')}</td>
<td>${_('%(when)s ago') % dict(when=timestamp(last_visit))}</td>
</tr>
% endfor
</tbody>