Registry / web-framework / invenio-i18n

invenio-i18n

JSON →
library4.0.0pypypi✓ verified 83d ago

Invenio internationalization (I18N) module. Provides Flask-based i18n support, locale selector, and translation utilities for Invenio repositories. Current version 3.5.0, requires Python >=3.9.

pip install invenio-i18n
INSTALL
IMPORT
SIG · INVENIO-I18N
I
invenio-i18n
web-frameworkpythonv4.0.0
Install
4.6s avg
Import
509ms
Disk
73MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v4.0.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.504s · 74MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 4.6s · import 0.514s · 75MB
73MB installed
● package 73MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

InvenioI18N
from invenio_i18n import InvenioI18N
current_i18n
from invenio_i18n import current_i18n
from flask_babelex import current_i18n
Flask-BabelEx is a dependency but its symbols are re-exported via invenio_i18n

Minimal Flask app with Invenio-I18N initialization and language detection.

from flask import Flask from invenio_i18n import InvenioI18N app = Flask(__name__) app.config['I18N_LANGUAGES'] = [('en', 'English'), ('fr', 'Fran\u00e7ais')] ext = InvenioI18N(app) @app.route('/') def index(): from invenio_i18n import current_i18n return current_i18n.locale.language if __name__ == '__main__': app.run()
Debug
Known issues
breakingInvenio-i18n 3.x requires Flask-BabelEx >= 2.x and is not compatible with plain Flask-Babel. Ensure Flask-Babel is not installed.
fix
Use Flask-BabelEx explicitly: pip install Flask-BabelEx. Do not install Flask-Babel.
affects: >=3.0.0
deprecatedThe 'I18N_LANGUAGES' config key is deprecated in favor of 'I18N_AVAILABLE_LANGUAGES' since version 3.3.0.
fix
Use app.config['I18N_AVAILABLE_LANGUAGES'] instead of I18N_LANGUAGES.
affects: >=3.3.0
gotchaIf you override 'current_i18n' from Flask-BabelEx, ensure you import from invenio_i18n, not flask_babelex, as the internal wrapper may change.
fix
Always import current_i18n from invenio_i18n.
affects: all
Errors
Common errors & fixes
ImportError: cannot import name 'InvenioI18N' from 'invenio_i18n'
Older version of invenio-i18n (pre-1.0) had different import path.
fix
Upgrade to latest: pip install --upgrade invenio-i18n
RuntimeError: babel data directory not found
Missing translation files; often due to incomplete pip install or without Flask-BabelEx.
fix
Ensure Flask-BabelEx is installed and translation data is packaged: pip install Flask-BabelEx
Upgrade
Version history
4.0.0latest on PyPI · released Jun 17, 2026
Audit
Dependencies
invenio-baserequiredCore dependency for Invenio framework
Flask-BabelExrequiredFlask extension for Babel integration
Agent activity
4 hits · last 30 days
node
4
Resources
invenio-i18n — pip install invenio-i18n · libregistry