{"id":23896,"library":"invenio-i18n","title":"Invenio-i18n","description":"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.","status":"active","version":"3.5.0","language":"python","source_language":"en","source_url":"https://github.com/inveniosoftware/invenio-i18n","tags":["invenio","i18n","flask","internationalization"],"install":[{"cmd":"pip install invenio-i18n","lang":"bash","label":"Default"}],"dependencies":[{"reason":"Core dependency for Invenio framework","package":"invenio-base","optional":false},{"reason":"Flask extension for Babel integration","package":"Flask-BabelEx","optional":false}],"imports":[{"note":"","symbol":"InvenioI18N","correct":"from invenio_i18n import InvenioI18N"},{"note":"Flask-BabelEx is a dependency but its symbols are re-exported via invenio_i18n","wrong":"from flask_babelex import current_i18n","symbol":"current_i18n","correct":"from invenio_i18n import current_i18n"}],"quickstart":{"code":"from flask import Flask\nfrom invenio_i18n import InvenioI18N\n\napp = Flask(__name__)\napp.config['I18N_LANGUAGES'] = [('en', 'English'), ('fr', 'Fran\\u00e7ais')]\next = InvenioI18N(app)\n\n@app.route('/')\ndef index():\n    from invenio_i18n import current_i18n\n    return current_i18n.locale.language\n\nif __name__ == '__main__':\n    app.run()","lang":"python","description":"Minimal Flask app with Invenio-I18N initialization and language detection."},"warnings":[{"fix":"Use Flask-BabelEx explicitly: pip install Flask-BabelEx. Do not install Flask-Babel.","message":"Invenio-i18n 3.x requires Flask-BabelEx >= 2.x and is not compatible with plain Flask-Babel. Ensure Flask-Babel is not installed.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Use app.config['I18N_AVAILABLE_LANGUAGES'] instead of I18N_LANGUAGES.","message":"The 'I18N_LANGUAGES' config key is deprecated in favor of 'I18N_AVAILABLE_LANGUAGES' since version 3.3.0.","severity":"deprecated","affected_versions":">=3.3.0"},{"fix":"Always import current_i18n from invenio_i18n.","message":"If you override 'current_i18n' from Flask-BabelEx, ensure you import from invenio_i18n, not flask_babelex, as the internal wrapper may change.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Upgrade to latest: pip install --upgrade invenio-i18n","cause":"Older version of invenio-i18n (pre-1.0) had different import path.","error":"ImportError: cannot import name 'InvenioI18N' from 'invenio_i18n'"},{"fix":"Ensure Flask-BabelEx is installed and translation data is packaged: pip install Flask-BabelEx","cause":"Missing translation files; often due to incomplete pip install or without Flask-BabelEx.","error":"RuntimeError: babel data directory not found"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}