How can I use the Python's "Locale" library on Replit?

Question:
I’ve got an error while using Locale library on Teplit. I need to set my environment to Brazilian environment, to use Flet’s DatePicker…
Repl link/Link to where the bug appears:
The bug appears when I set Locale to Brazilian environment:
locale.setlocale(l.LC_ALL,‘PT_BR’)

Screenshots, links, or other helpful context:

When I set this following command:

import locale as l
l.setlocale(l.LC_ALL,'PT_BR')

I get the following error:

 File "/home/runner/atelierdalci/main.py", line 18, in <module>
    l.setlocale(l.LC_ALL,'PT_BR')
  File "/nix/store/xf54733x4chbawkh1qvy9i1i4mlscy1c-python3-3.10.11/lib/python3.10/locale.py", line 620, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting

Hello @fotografiadmd!

The local package returned an error because the location is unsupported. Please also note that your repls run on Replit servers, which are always in the same place.

Ok, I know the server is always at the same place, Lol.
But Locale was created exactly to change the country / locale parameters without influence the server parameters.

1 Like