mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-31 01:38:08 -05:00
Fix i18n issue with 'ago' translations
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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>
|
||||
%endif
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
%endif
|
||||
/>
|
||||
<label for="comment-visits-${i}">
|
||||
${visit} ${_("ago")}
|
||||
${_("%(when)s ago") % dict(when=visit)}
|
||||
</label>
|
||||
</div>
|
||||
%endfor
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
<tr>
|
||||
<td>${ip}</td>
|
||||
<td>${location.get('country_name', '')}</td>
|
||||
<td>${timestamp(last_visit)} ${_('ago')}</td>
|
||||
<td>${_('%(when)s ago') % dict(when=timestamp(last_visit))}</td>
|
||||
</tr>
|
||||
% endfor
|
||||
</tbody>
|
||||
|
||||
Reference in New Issue
Block a user