Skip to content

Commit

Permalink
Global state in print_po_snippet
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidMStraub committed Sep 14, 2024
1 parent d685608 commit 03296a1
Showing 1 changed file with 25 additions and 11 deletions.
36 changes: 25 additions & 11 deletions gramps/gen/datehandler/_datestrings.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ def __init__(self, locale):
except AttributeError:
localized_months = old_long

def print_po_snippet(en_loc_old_lists, context, line: int = 10000):
def print_po_snippet(en_loc_old_lists, context, line: int):
for m, localized, old in zip(*en_loc_old_lists):
if m == "":
continue
Expand All @@ -351,61 +351,75 @@ def print_po_snippet(en_loc_old_lists, context, line: int = 10000):
)
)
line += 1
return line

try:
localized_months = dd.__class__.long_months
except AttributeError:
localized_months = old_long
print_po_snippet(
line = 10000
line = print_po_snippet(
(ds_EN.long_months, localized_months, old_long),
"localized lexeme inflections",
line=line,
)

try:
localized_months = dd.__class__.short_months
except AttributeError:
localized_months = old_short
print_po_snippet(
line = print_po_snippet(
(ds_EN.short_months, localized_months, old_short),
"localized lexeme inflections - short month form",
line=line,
)

print_po_snippet((ds_EN.long_days, old_days, old_days), "")
line = print_po_snippet((ds_EN.long_days, old_days, old_days), "", line=line)

print_po_snippet((ds_EN.short_days, old_short_days, old_short_days), "")
line = print_po_snippet(
(ds_EN.short_days, old_short_days, old_short_days), "", line=line
)

try:
loc = dd.__class__.hebrew
print_po_snippet((ds_EN.hebrew, loc, loc), "Hebrew month lexeme")
line = print_po_snippet(
(ds_EN.hebrew, loc, loc), "Hebrew month lexeme", line=line
)
except AttributeError:
pass

try:
loc = dd.__class__.french
print_po_snippet((ds_EN.french, loc, loc), "French month lexeme")
line = print_po_snippet(
(ds_EN.french, loc, loc), "French month lexeme", line=line
)
except AttributeError:
pass

try:
loc = dd.__class__.islamic
print_po_snippet((ds_EN.islamic, loc, loc), "Islamic month lexeme")
line = print_po_snippet(
(ds_EN.islamic, loc, loc), "Islamic month lexeme", line=line
)
except AttributeError:
pass

try:
loc = dd.__class__.persian
print_po_snippet((ds_EN.persian, loc, loc), "Persian month lexeme")
line = print_po_snippet(
(ds_EN.persian, loc, loc), "Persian month lexeme", line=line
)
except AttributeError:
pass

try:
loc = dd.__class__._mod_str
print_po_snippet((ds_EN.modifiers, loc, loc), "date modifier")
line = print_po_snippet((ds_EN.modifiers, loc, loc), "date modifier", line=line)
except AttributeError:
pass

try:
loc = dd.__class__._qual_str
print_po_snippet((ds_EN.qualifiers, loc, loc), "date quality")
line = print_po_snippet((ds_EN.qualifiers, loc, loc), "date quality", line=line)
except AttributeError:
pass

0 comments on commit 03296a1

Please sign in to comment.