|
| #define | PY_PGETTEXT_FORMAT |
| static PyMemberDef | blender::app_translations_members [] |
| static PyGetSetDef | blender::app_translations_getseters [] |
| static PyMethodDef | blender::app_translations_methods [] |
| static PyTypeObject | blender::BlenderAppTranslationsType |
| | blender::PyDoc_STRVAR (app_translations_contexts_doc, "A named tuple containing all predefined translation contexts.\n" "\n" ".. warning::\n" " Never use a (new) context starting with \"" BLT_I18NCONTEXT_DEFAULT_BPYRNA "\", it would be internally\n" " assimilated as the default one!\n") |
| | blender::PyDoc_STRVAR (app_translations_contexts_C_to_py_doc, "A readonly dict mapping contexts' C-identifiers to their py-identifiers.\n") |
| | blender::PyDoc_STRVAR (app_translations_locale_doc, "The actual locale currently in use (will always return an empty string when Blender " "is built without " "internationalization support).\n" "\n" ":type: str\n") |
| static PyObject * | blender::app_translations_locale_get (PyObject *, void *) |
| | blender::PyDoc_STRVAR (app_translations_locales_doc, "All locales currently known by Blender (i.e. available as translations).\n" "\n" ":type: list[str]\n") |
| static PyObject * | blender::app_translations_locales_get (PyObject *, void *) |
| static PyObject * | blender::_py_pgettext (PyObject *args, PyObject *kw, const char *format, const char *(*_pgettext)(const char *, const char *)) |
| | blender::PyDoc_STRVAR (app_translations_pgettext_doc, ".. function:: pgettext(msgid, msgctxt=None)\n" "\n" " Try to translate the given msgid (with optional msgctxt).\n" "\n" " .. note::\n" " The ``(msgid, msgctxt)`` parameters order has been switched compared to gettext " "function, to allow\n" " single-parameter calls (context then defaults to BLT_I18NCONTEXT_DEFAULT).\n" "\n" " .. note::\n" " You should really rarely need to use this function in regular addon code, as all " "translation should be\n" " handled by Blender internal code. " "The only exceptions are strings containing formatting " "(like \"File: %r\"),\n" " but you should rather use :func:`pgettext_iface`/:func:`pgettext_tip` in those cases!\n" "\n" " .. note::\n" " Does nothing when Blender is built without internationalization support (hence always " "returns ``msgid``).\n" "\n" " :param msgid: The string to translate.\n" " :type msgid: str\n" " :param msgctxt: The translation context (defaults to BLT_I18NCONTEXT_DEFAULT).\n" " :type msgctxt: str | None\n" " :return: The translated string (or msgid if no translation was found).\n" " :rtype: str\n" "\n") |
| static PyObject * | blender::app_translations_pgettext (BlenderAppTranslations *, PyObject *args, PyObject *kw) |
| | blender::PyDoc_STRVAR (app_translations_pgettext_n_doc, ".. function:: pgettext_n(msgid, msgctxt=None)\n" "\n" " Extract the given msgid to translation files. This is a no-op function that will " "only mark the string to extract, but not perform the actual translation.\n" "\n" " .. note::\n" " See :func:`pgettext` notes.\n" "\n" " :param msgid: The string to extract.\n" " :type msgid: str\n" " :param msgctxt: The translation context (defaults to BLT_I18NCONTEXT_DEFAULT).\n" " :type msgctxt: str | None\n" " :return: The original string.\n" " :rtype: str\n" "\n") |
| static PyObject * | blender::app_translations_pgettext_n (BlenderAppTranslations *, PyObject *args, PyObject *kw) |
| | blender::PyDoc_STRVAR (app_translations_pgettext_iface_doc, ".. function:: pgettext_iface(msgid, msgctxt=None)\n" "\n" " Try to translate the given msgid (with optional msgctxt), if labels' translation " "is enabled.\n" "\n" " .. note::\n" " See :func:`pgettext` notes.\n" "\n" " :param msgid: The string to translate.\n" " :type msgid: str\n" " :param msgctxt: The translation context (defaults to BLT_I18NCONTEXT_DEFAULT).\n" " :type msgctxt: str | None\n" " :return: The translated string (or msgid if no translation was found).\n" " :rtype: str\n" "\n") |
| static PyObject * | blender::app_translations_pgettext_iface (BlenderAppTranslations *, PyObject *args, PyObject *kw) |
| | blender::PyDoc_STRVAR (app_translations_pgettext_tip_doc, ".. function:: pgettext_tip(msgid, msgctxt=None)\n" "\n" " Try to translate the given msgid (with optional msgctxt), if tooltips' " "translation is enabled.\n" "\n" " .. note::\n" " See :func:`pgettext` notes.\n" "\n" " :param msgid: The string to translate.\n" " :type msgid: str\n" " :param msgctxt: The translation context (defaults to BLT_I18NCONTEXT_DEFAULT).\n" " :type msgctxt: str | None\n" " :return: The translated string (or msgid if no translation was found).\n" " :rtype: str\n" "\n") |
| static PyObject * | blender::app_translations_pgettext_tip (BlenderAppTranslations *, PyObject *args, PyObject *kw) |
| | blender::PyDoc_STRVAR (app_translations_pgettext_rpt_doc, ".. function:: pgettext_rpt(msgid, msgctxt=None)\n" "\n" " Try to translate the given msgid (with optional msgctxt), if reports' translation " "is enabled.\n" "\n" " .. note::\n" " See :func:`pgettext` notes.\n" "\n" " :param msgid: The string to translate.\n" " :type msgid: str\n" " :param msgctxt: The translation context (defaults to BLT_I18NCONTEXT_DEFAULT).\n" " :type msgctxt: str | None\n" " :return: The translated string (or msgid if no translation was found).\n" " :rtype: str\n" "\n") |
| static PyObject * | blender::app_translations_pgettext_rpt (BlenderAppTranslations *, PyObject *args, PyObject *kw) |
| | blender::PyDoc_STRVAR (app_translations_pgettext_data_doc, ".. function:: pgettext_data(msgid, msgctxt=None)\n" "\n" " Try to translate the given msgid (with optional msgctxt), if new data name's " "translation is enabled.\n" "\n" " .. note::\n" " See :func:`pgettext` notes.\n" "\n" " :param msgid: The string to translate.\n" " :type msgid: str\n" " :param msgctxt: The translation context (defaults to BLT_I18NCONTEXT_DEFAULT).\n" " :type msgctxt: str | None\n" " :return: The translated string (or ``msgid`` if no translation was found).\n" " :rtype: str\n" "\n") |
| static PyObject * | blender::app_translations_pgettext_data (BlenderAppTranslations *, PyObject *args, PyObject *kw) |
| | blender::PyDoc_STRVAR (app_translations_locale_explode_doc, ".. function:: locale_explode(locale)\n" "\n" " Return all components and their combinations of the given ISO locale string.\n" "\n" " >>> bpy.app.translations.locale_explode(\"sr_RS@latin\")\n" " (\"sr\", \"RS\", \"latin\", \"sr_RS\", \"sr@latin\")\n" "\n" " For non-complete locales, missing elements will be None.\n" "\n" " :param locale: The ISO locale string to explode.\n" " :type locale: str\n" " :return: A tuple ``(language, country, variant, language_country, language@variant)``.\n" " :rtype: tuple[str | None, str | None, str | None, str | None, str | None]\n" "\n") |
| static PyObject * | blender::app_translations_locale_explode (BlenderAppTranslations *, PyObject *args, PyObject *kw) |
| static PyObject * | blender::app_translations_new (PyTypeObject *type, PyObject *args, PyObject *kw) |
| static void | blender::app_translations_free (void *self_v) |
| | blender::PyDoc_STRVAR (app_translations_doc, "This object contains some data/methods regarding internationalization in Blender, " "and allows every py script\n" "to feature translations for its own UI messages.\n" "\n") |
| PyObject * | blender::BPY_app_translations_struct () |
| void | blender::BPY_app_translations_end () |
This file defines a singleton py object accessed via 'bpy.app.translations', which exposes various data and functions useful in i18n work. Most notably, it allows to extend main translations with Python dictionaries.
Definition in file bpy_app_translations.cc.