Fixed locale bug in templates, closes #113

This commit is contained in:
Rhet Turnbull
2020-04-26 15:20:28 -07:00
parent 81d4e392c3
commit d8a64c9573
4 changed files with 128 additions and 1 deletions

View File

@@ -1,3 +1,3 @@
""" version info """
__version__ = "0.28.5"
__version__ = "0.28.6"

View File

@@ -10,6 +10,7 @@
# This code isn't elegant but it seems to work well. PRs gladly accepted.
import datetime
import locale
import os
import pathlib
import re
@@ -18,6 +19,9 @@ from typing import Tuple, List # pylint: disable=syntax-error
from .photoinfo import PhotoInfo
from ._constants import _UNKNOWN_PERSON
# ensure locale set to user's locale
locale.setlocale(locale.LC_ALL, "")
# Permitted substitutions (each of these returns a single value or None)
TEMPLATE_SUBSTITUTIONS = {
"{name}": "Filename of the photo",