return string
+def ordinal(string):
+ if string[-1] == '1' and string[-2:] != '11':
+ suffix = _('st ')
+ elif string[-1] == '2' and string[-2:] != '12':
+ suffix = _('nd ')
+ elif string[-1] == '3' and string[-2:] != '13':
+ suffix = _('rd ')
+ else:
+ suffix = _('th ')
+ return string + suffix
+
+
# Entry widget with right-clic menu to copy/cut/paste
class EntryWithMenu(Entry):
def __init__(self, master, **kw):
if not todo:
break
done |= todo
- self.info(_('Download ') + str(i + 1) + _('th generation of ancestors...'))
+ self.info(_('Download ') + ordinal(str(i + 1)) + _('generation of ancestors...'))
todo = self.tree.add_parents(todo) - done
todo = set(self.tree.indi.keys())
if not todo:
break
done |= todo
- self.info(_('Download ') + str(i + 1) + _('th generation of descendants...'))
+ self.info(_('Download ') + ordinal(str(i + 1)) + _('generation of descendants...'))
todo = self.tree.add_children(todo) - done
if self.options.spouses.get():
return ('\n%s CONT ' % level).join(res)
+def ordinal(string):
+ if string[-1] == '1' and string[-2:] != '11':
+ suffix = _('st ')
+ elif string[-1] == '2' and string[-2:] != '12':
+ suffix = _('nd ')
+ elif string[-1] == '3' and string[-2:] != '13':
+ suffix = _('rd ')
+ else:
+ suffix = _('th ')
+ return string + suffix
+
+
# FamilySearch session class
class Session:
def __init__(self, username, password, verbose=False, logfile=sys.stderr, timeout=60):
if not todo:
break
done |= todo
- print(_('Download ') + str(i + 1) + _('th generation of ancestors...'))
+ print(_('Download ') + ordinal(str(i + 1)) + _('generation of ancestors...'))
todo = tree.add_parents(todo) - done
# download descendants
if not todo:
break
done |= todo
- print(_('Download ') + str(i + 1) + _('th generation of descendants...'))
+ print(_('Download ') + ordinal(str(i + 1)) + _('generation of descendants...'))
todo = tree.add_children(todo) - done
# download spouses
'Download starting individuals...': {
'fr': 'Téléchargement des personnes de départ...',
},
- 'th generation of ancestors...': {
- 'fr': 'e génération d\'ancêtres...',
+ 'st ': {
+ 'fr': 'e ',
},
- 'th generation of descendants...': {
- 'fr': 'e génération de descendants...',
+ 'nd ': {
+ 'fr': 'e ',
+ },
+ 'rd ': {
+ 'fr': 'e ',
+ },
+ 'th ': {
+ 'fr': 'e ',
+ },
+ 'generation of ancestors...': {
+ 'fr': 'génération d\'ancêtres...',
+ },
+ 'generation of descendants...': {
+ 'fr': 'génération de descendants...',
},
'Download spouses and marriage information...': {
'fr': 'Téléchargement des conjoints et des informations de mariage...',