enable "short" days in _datestrings (_grampslocale already had them)

This commit is contained in:
Paul Franklin 2017-03-07 09:53:39 -08:00
parent 968f378174
commit 337be8e6af
2 changed files with 19 additions and 4 deletions

View File

@ -121,6 +121,7 @@ class DateDisplay:
self._mod_str = self._ds.modifiers self._mod_str = self._ds.modifiers
self._qual_str = self._ds.qualifiers self._qual_str = self._ds.qualifiers
self.long_days = self._ds.long_days self.long_days = self._ds.long_days
self.short_days = self._ds.short_days # Icelandic needs this
if format is None: if format is None:
self.format = 0 self.format = 0

View File

@ -248,12 +248,23 @@ class DateStrings:
_("Saturday"), _("Saturday"),
) )
self.short_days = ("", # Icelandic needs them
_("Sun"),
_("Mon"),
_("Tue"),
_("Wed"),
_("Thu"),
_("Fri"),
_("Sat"))
# set GRAMPS_RESOURCES then: python3 -m gramps.gen.datehandler._datestrings
if __name__ == '__main__': if __name__ == '__main__':
import sys import sys
from ..utils.grampslocale import GrampsLocale from ..utils.grampslocale import GrampsLocale
from ..const import GRAMPS_LOCALE as glocale from ..const import GRAMPS_LOCALE as glocale
from ._grampslocale import (_deprecated_long_months as old_long, from ._grampslocale import (_deprecated_long_months as old_long,
_deprecated_short_months as old_short, _deprecated_short_months as old_short,
_deprecated_short_days as old_short_days, # Icelandic needs them
_deprecated_long_days as old_days) _deprecated_long_days as old_days)
from ._datedisplay import DateDisplay from ._datedisplay import DateDisplay
import gettext import gettext
@ -272,10 +283,10 @@ if __name__ == '__main__':
print ("# Generating snippets for {}*.po\n" print ("# Generating snippets for {}*.po\n"
"# Available languages: {}".format( "# Available languages: {}".format(
lang_short, available_langs)) lang_short, available_langs))
glocale = GrampsLocale(languages=(lang)) glocale = GrampsLocale(languages=(lang)) # in __main__
dd = glocale.date_displayer dd = glocale.date_displayer
ds = dd._ds ds = dd._ds
glocale_EN = GrampsLocale(languages=('en')) glocale_EN = GrampsLocale(languages=('en')) # in __main__
ds_EN = DateStrings(glocale_EN) ds_EN = DateStrings(glocale_EN)
filename = __file__ filename = __file__
@ -308,6 +319,7 @@ if __name__ == '__main__':
localized_months = old_long localized_months = old_long
print_po_snippet((ds_EN.long_months, localized_months, old_long), print_po_snippet((ds_EN.long_months, localized_months, old_long),
"localized lexeme inflections||") "localized lexeme inflections||")
try: try:
localized_months = dd.__class__.short_months localized_months = dd.__class__.short_months
except AttributeError: except AttributeError:
@ -315,6 +327,10 @@ if __name__ == '__main__':
print_po_snippet((ds_EN.short_months, localized_months, old_short), print_po_snippet((ds_EN.short_months, localized_months, old_short),
"localized lexeme inflections - short month form||") "localized lexeme inflections - short month form||")
print_po_snippet((ds_EN.long_days, old_days, old_days), "")
print_po_snippet((ds_EN.short_days, old_short_days, old_short_days), "")
try: try:
loc = dd.__class__.hebrew loc = dd.__class__.hebrew
print_po_snippet((ds_EN.hebrew, loc, loc), print_po_snippet((ds_EN.hebrew, loc, loc),
@ -356,5 +372,3 @@ if __name__ == '__main__':
"date quality|") "date quality|")
except AttributeError: except AttributeError:
pass pass
print_po_snippet((ds_EN.long_days, old_days, old_days), "")