Skip to main content
Filter by
Sorted by
Tagged with
1 vote
1 answer
97 views

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 ...
roganjosh's user avatar
  • 13.3k
2 votes
1 answer
66 views

I am trying to translate Arabic for FastAPI and I created template as shown here: <!DOCTYPE html> <html> <head> <title>{{ _("Welcome") }}</title> </head&...
NPatel's user avatar
  • 21.4k
1 vote
0 answers
78 views

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 ...
NPatel's user avatar
  • 21.4k
-1 votes
1 answer
176 views

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/...
tomasvana10's user avatar
0 votes
2 answers
477 views

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 ...
nowox's user avatar
  • 29.7k
-1 votes
1 answer
308 views

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 ...
user22318251's user avatar
0 votes
1 answer
196 views

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 ...
Alexandre Massoutier's user avatar
0 votes
1 answer
453 views

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 ...
DanielBell99's user avatar
  • 2,045
2 votes
1 answer
136 views

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 ...
leo's user avatar
  • 8,661
3 votes
1 answer
165 views

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,...
user2828408's user avatar
0 votes
1 answer
454 views

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 ...
Thorben Dhaenens's user avatar
0 votes
0 answers
943 views

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 ...
Milad Bannourah's user avatar
1 vote
1 answer
431 views

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 ...
Louis Go's user avatar
  • 2,706
14 votes
2 answers
8k views

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 ...
mbaki's user avatar
  • 157
1 vote
1 answer
146 views

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 ...
bhthllj's user avatar
  • 21
0 votes
2 answers
3k views

I am using flask_babel for localization of a python project. When extracting translatable strings from templates, which is put in {{ _('') }} , i am getting the following error. If anyone of you ...
lungsang's user avatar
  • 177
1 vote
1 answer
1k views

We would like to use Flask-Babel for the internationalizing of our Flask application. Our goal is to use a unique ID string like "example_demo_text" for msgid and translate this msgid in ...
HaKePlan's user avatar
1 vote
1 answer
68 views

I'm stuck with xgettext missing tag attributes in HTML templates, e.g.: xgettext --keyword=_ --language=Python -o - - <<EOF <!DOCTYPE html> <html> <head> % msg = _('A ...
neurino's user avatar
  • 12.5k
0 votes
2 answers
2k views

I tried to set up multiple Dash Apps inside a Flask App and use Flask Babel. from flask import Flask, request from flask_babel import Babel, gettext from werkzeug.middleware.dispatcher import ...
ukena's user avatar
  • 13
0 votes
2 answers
1k views

I have a flask app and i wanted to add multiple languages to it. So i have using this demo on Flask_babel to do this. Flask Label Demo config.py DEBUG = True LANGUAGES = ['en', 'de', 'fr'] This is ...
Aarushi's user avatar
  • 570
0 votes
1 answer
154 views

I have a very frustrating issue. I need the string "95% confidence interval" to appear on in a web view. And I need to have it translatable (using babel) so I'm using it like this: _("...
Cole's user avatar
  • 39
0 votes
2 answers
3k views

I'd like to convert a float to a currency using Babel and PySpark sample data: amount currency 2129.9 RON 1700 EUR 1268 GBP 741.2 USD 142.08091153 EUR 4.7E7 ...
John Doe's user avatar
  • 10.3k
1 vote
0 answers
146 views

I am writing a website in Flask. I use Flask-Babel for translation into different languages. I use lazy_gettext to translate dictionary values. When changing the language on the site, all phrases and ...
Яша Проценко's user avatar
1 vote
3 answers
2k views

I have written this function to format time and date in my Flask app with Babel: import babel from flask import Flask app = Flask(__name__) def format_datetime(value, format='medium'): if format ...
TheTruth's user avatar
0 votes
1 answer
966 views

I've been trying to set 'use_locale' parameter for wtform DecimalField, but nothing seems to work and there's barely any examples on how to set 'use_locale'. I've been through the documentation from ...
Max Scola's user avatar
0 votes
1 answer
2k views

I am currently making a web app that displays a list of transactions of the user. I want to make a setting to change the currency from USD to EUR. I am using custom filter in jinja: My custom filter ...
aNdroid's user avatar
  • 57
1 vote
2 answers
383 views

Let's say I have a string in English, locale="en", e.g. "computer" and its Spanish translation, locale="es" translation, would be "computadora". If the website ...
Al Nikolaj's user avatar
2 votes
1 answer
2k views

Hello it is a pleasure to greet you, today I come to ask you for help with an error that Babel de Flask is presenting to me, I am new to the subject, but in advance I thank you for your collaboration. ...
Khöug's user avatar
  • 46
3 votes
1 answer
3k views

I am a beginner with react. I was just trying to make a web app with flask backend and react frontend with material-ui but I was facing problems with setting it up. What I did I downloaded the React ...
Jalaj's user avatar
  • 463
3 votes
0 answers
95 views

I am looking for a possibility to create a custom locale for my website. The website is available in several languages, including French. The French version of the website has particular content which ...
Al Nikolaj's user avatar
0 votes
1 answer
1k views

I have an application in which I have managed to use translations for romanian and english. I want to press the button "english" and get the website translated in english and when pressing &...
moro_922's user avatar
  • 123
4 votes
1 answer
3k views

I have the function in Flask, which returns the website in english. Moreover, i want to be able to use german in the website at a button push from html. How can I change the language at a button push ...
moro_922's user avatar
  • 123
2 votes
0 answers
1k views

I need to write a multilingual program where users can set their home country and nationality on their profile pages. I can get a list of country names with python and babel easily. For example, to ...
nagylzs's user avatar
  • 4,240
1 vote
1 answer
2k views

Flask-babel doesn't call its localeselector even once. I'm using app factory to init my app. The translations folder is within my app, It was created by babel, according to the docs. I've also tried ...
nieomylnieja's user avatar
0 votes
1 answer
487 views

I have a set of SelectField with Flask-WTF and I convert the default language with Flask-Babel. Here is the snippet of my code: from flask_babel import _, lazy_gettext as _l class PaymentStatus(...
Tri's user avatar
  • 3,109
0 votes
1 answer
434 views

I need to extract messages from jinja2 files from my pyramid web app, Babel has a three default extraction method (javascript, python, ignore). How can i add Jinja2 extraction method ? All my ...
Javad Asoodeh's user avatar
0 votes
0 answers
478 views

Within a jinja template, I have the following string # English <p>by John Smith on <time pubdate="pubdate" datetime="2019-01-30T20:54:55">January 30, 2019</time></p> # German ...
Martin Thoma's user avatar
0 votes
1 answer
1k views

I am trying to create a translation file in simplified Chinese from an English source. This is all happening in a Flask project and I've been using Flask-Babel (so far successfully) to translate to ...
Arnaud's user avatar
  • 750
1 vote
2 answers
560 views

I have this python line raise ValueError(_(u'Your password must be {} of characters or longer.'.format(MIN_PASSWORD_LENGTH))) I added it to the PO file: msgid "Your password must be {} of characters ...
Felix's user avatar
  • 25
0 votes
1 answer
2k views

I am adding localisation to my Flask app with Flask-Babel, and I cannot seem to change the language. I followed all the Babel instructions for creating the po/mo files - I don't believe my issue is ...
user9277612's user avatar
0 votes
0 answers
53 views

I'm working on Google App Engine Python3.7 I wrote this working code based on what I learned here: http://babel.pocoo.org/en/latest/api/messages/mofile.html https://docs.python.org/3/library/gettext....
Paolo177's user avatar
  • 366
3 votes
2 answers
766 views

I'm migrated my code from webapp2 to Flask. (I deploy my code in Google App Engine) However, I can no longer use this string: "Error: Max %1$d characters" Initialization flask_app = Flask(__name__) ...
Blodhgard's user avatar
  • 9,415
1 vote
1 answer
511 views

Looking at the docs I find no mention to this pretty basic and common need: I want to set the html tag lang attribute according to selected locale -- without passing it explicitly every time to ...
neurino's user avatar
  • 12.5k
2 votes
2 answers
3k views

Most of the time, using Babel's gettext() or _() is with a current locale set within the current context, so that the target language is implicit, it is not passed as an argument to gettext(). ...
patb's user avatar
  • 1,826
1 vote
1 answer
322 views

I'm trying to use Babel 2.6.0 to get the "official" language(s) by territory but it returns nothing. As seen here, it should take a two letter territory code.
Travis's user avatar
  • 368
2 votes
2 answers
2k views

I have setup Babel correctly and the translation work as intended. What I am stuck with is to be able to switch languages using a link and than keep that setting active even if the user click on any ...
Salviati's user avatar
  • 788
16 votes
1 answer
9k views

I'm trying to write a custom extraction method for babel, to extract strings from a specific column in a csv file. I followed the documentation here. Here is my extraction method code: def ...
tiagosilva's user avatar
  • 1,786
4 votes
2 answers
1k views

I am using jinja 2.10 and pybabel. When my template contains following code (with '%' char inside trans block) pybabel-compile does not translate the string. The extracted string (in .po) is OK but on ...
Mirek's user avatar
  • 51
2 votes
2 answers
2k views

I've been getting the same error for hours, no matter what code changes I make, and it's referencing Babel, a dependency I am not specifically calling or using, although I assume it's being called for ...
km457's user avatar
  • 125
1 vote
0 answers
300 views

I'm trying to print a number in a scientific number format (with exponent) using the package babel and a German locale: >>> from babel.numbers import format_scientific >>> x = ...
Jan's user avatar
  • 972