160 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
1
vote
1
answer
108
views
Using pybabel to translate tooltip text inside a HTML tag
I've basically finished translating my flask frontend into a lot of different languages but there are a couple of tooltips that I just can't seem to figure out. Technically, these need to be strings ...
2
votes
1
answer
70
views
FastAPI template Arabic translation render from right to left
I am trying to translate Arabic for FastAPI and I created template as shown here:
<!DOCTYPE html>
<html>
<head>
<title>{{ _("Welcome") }}</title>
</head&...
1
vote
0
answers
86
views
flask babel not able to load the translated files
I am trying to translate my current flask project and I follow the step mentioned in flask-babel.
First I tried with new flask-restx app. It works fine. When I compile the messages, it get those ...
-1
votes
1
answer
181
views
Error in building project - babel module not found
I have been attempting to build and upload my project to PyPI with GitHub workflows, when an error occurs in this build section:
Here is the error itself:
File "/home/runner/work/...
0
votes
2
answers
491
views
Format currency with babel without Unicode?
Using Babel I get this:
>>> babel.numbers.format_currency(1099.98, 'CHF', locale='fr_CH')
'1\u202f099,98\xa0CHF'
I would like this format:
"CHF 1'099.98"
Is it possible to specify ...
-1
votes
1
answer
319
views
Getting an error while running an odoo-bin in odoo 15
Getting an error as ModuleNotFoundError: No module named 'babel.dates'; 'babel' is not a package while running an odoo-bin
I have clone odoo 15.0 repostiorary
i have tried to run requirement file and ...
0
votes
1
answer
202
views
Combining Eel, Jinja2, Babel - how to?
On a project where I use Eel Python and you can tell Eel to use Jinja2.
Works fine (congrats to the creators). I installed Babel, created a /lang/ folder where I store .pot and .po and .mo files after ...
0
votes
1
answer
455
views
AttributeError: module 'babel' has no attribute 'numbers'
Goal: Pass a locale code and retrieve a currency symbol.
My approach is to use babel library. However, I encounter an AttributeError in version 2.12.1.
Documentation | PDF page number: 82
Code:
import ...
2
votes
1
answer
136
views
How do I make Babel use minus signs?
Why is it that Babel does not use the minus sign used by my locale, in functions like format_decimal()? It seems to me like this would be the very job of a library like Babel.
Is there a way I can ...
3
votes
1
answer
165
views
Babel formatting error for negative values in currency
I try to format floats into currency-strings with babel. The following code:
from babel.numbers import format_currency
print(format_currency(value, 'CHF', locale='de_CH'))
print(format_currency(value,...
0
votes
1
answer
457
views
Is there a way to replace jinja2.ext.autoescape and jinja2.ext.with_ in Flask Babel?
I'm using Flask Babel for web translation:
When I write my config file like the following, it doesn't find any translations and the error is that jinja2.ext.autoescape and jinja2.ext.with_ are ...
0
votes
0
answers
948
views
failed to excute due to unhandled exception no module named babel.numbers
i built a python app with tkinter and i want to make it into an exe so i can use it as a normal app. the problem is pyinstaller is always throwing weird errors (i don't know if this has to do with ...
1
vote
1
answer
444
views
Babel - Using both `msgstr` and `msgid` without duplicate static strings
Take this as an example while I tried to minimize code duplication.
msg = 'User request is completed'
logging.info(msg)
reply(_(msg)) # Babel would failed to extract the variable `msg`.
I know ...
14
votes
2
answers
8k
views
AttributeError: module 'jinja2.ext' has no attribute 'autoescape' while trying to use Flask-Babel
I am new to Flask and Babel and I have just started a project which will contain several languages. After I have generated the babel.cfg file, when I attempt to extract it with the command pybabel ...
1
vote
1
answer
156
views
Stringformat a MultiIndex DatetimeIndex using Babel's format_datetime() for Localization
Python 3.7.0
pandas 1.1.5
numpy 1.21.4
Babel 2.9.1
Problem
I have a dataset that is first evaluated, then completed with calculations and then converted into a pd.MultiIndex by grouping it with the ...