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._qual_str = self._ds.qualifiers
self.long_days = self._ds.long_days
self.short_days = self._ds.short_days # Icelandic needs this
if format is None:
self.format = 0

View File

@ -248,12 +248,23 @@ class DateStrings:
_("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__':
import sys
from ..utils.grampslocale import GrampsLocale
from ..const import GRAMPS_LOCALE as glocale
from ._grampslocale import (_deprecated_long_months as old_long,
_deprecated_short_months as old_short,
_deprecated_short_days as old_short_days, # Icelandic needs them
_deprecated_long_days as old_days)
from ._datedisplay import DateDisplay
import gettext
@ -272,10 +283,10 @@ if __name__ == '__main__':
print ("# Generating snippets for {}*.po\n"
"# Available languages: {}".format(
lang_short, available_langs))
glocale = GrampsLocale(languages=(lang))
glocale = GrampsLocale(languages=(lang)) # in __main__
dd = glocale.date_displayer
ds = dd._ds
glocale_EN = GrampsLocale(languages=('en'))
glocale_EN = GrampsLocale(languages=('en')) # in __main__
ds_EN = DateStrings(glocale_EN)
filename = __file__
@ -308,6 +319,7 @@ if __name__ == '__main__':
localized_months = old_long
print_po_snippet((ds_EN.long_months, localized_months, old_long),
"localized lexeme inflections||")
try:
localized_months = dd.__class__.short_months
except AttributeError:
@ -315,6 +327,10 @@ if __name__ == '__main__':
print_po_snippet((ds_EN.short_months, localized_months, old_short),
"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:
loc = dd.__class__.hebrew
print_po_snippet((ds_EN.hebrew, loc, loc),
@ -356,5 +372,3 @@ if __name__ == '__main__':
"date quality|")
except AttributeError:
pass
print_po_snippet((ds_EN.long_days, old_days, old_days), "")