Skip to content

Commit

Permalink
Set the locale to the user’s default setting
Browse files Browse the repository at this point in the history
According to POSIX, a program which has not called setlocale(LC_ALL, '') runs using the portable 'C' locale. Calling setlocale(LC_ALL, '') lets it use the default locale as defined by the LANG variable.
  • Loading branch information
tom-kuca authored and pazz committed May 3, 2024
1 parent 3a3fc88 commit 7c2e43c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions alot/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# This file is released under the GNU GPL, version 3 or a later revision.
# For further details see the COPYING file
import argparse
import locale
import logging
import os
import sys
Expand Down Expand Up @@ -86,6 +87,9 @@ def main():
for the user interface main loop to run."""
options, command = parser()

# locale
locale.setlocale(locale.LC_ALL, '')

# logging
root_logger = logging.getLogger()
for log_handler in root_logger.handlers:
Expand Down

0 comments on commit 7c2e43c

Please sign in to comment.