துணை நிரல்களை உருவாக்குதல்

துணை நிரல்கள் are way to customize localization workflow in Weblate.

class weblate.addons.base.BaseAddon(storage: Addon)

வலைபெயர்ப்பு துணை நிரல்களுக்கான அடிப்படை வகுப்பு.

classmethod can_install(*, component: Component | None = None, project: Project | None = None) bool

கொடுக்கப்பட்ட கூறுகளுடன் கூடுதல் பொருந்துமா என்பதை சரிபார்க்கவும்.

change_event(change: Change, activity_log_id: int | None = None) dict | None

மாற்ற நிகழ்வுக்கான நிகழ்வு கையாளுபவர்.

check_change_action(change: Change) bool

Early filtering of Change actions before triggering change_event callback.

component_update(component: weblate.trans.models.Component, activity_log_id: int | None = None) dict | None

கூறு புதுப்பிப்புக்கான நிகழ்வு கையாளுபவர்.

configure(configuration: dict[str, Any]) None

உள்ளமைவைச் சேமிக்கவும்.

daily(component: weblate.trans.models.Component, activity_log_id: int | None = None) dict | None

நிகழ்வு கையாளுபவர் தினமும்.

classmethod get_add_form(user: User | None, *, component: Component | None = None, project: Project | None = None, **kwargs) BaseAddonForm | None

புதிய துணை நிரலைச் சேர்ப்பதற்கான உள்ளமைவு படிவத்தை திரும்பவும்.

get_settings_form(user: User | None, **kwargs) BaseAddonForm | None

இந்த துணை நிரலுக்கான உள்ளமைவு படிவத்தை திரும்பவும்.

post_add(translation: Translation, activity_log_id: int | None = None) dict | None

புதிய மொழிபெயர்ப்பு சேர்க்கப்பட்ட பிறகு நிகழ்வு கையாளுபவர்.

post_commit(component: weblate.trans.models.Component, store_hash: bool, activity_log_id: int | None = None) dict | None

நிகழ்வு கையாளுபவர் களஞ்சியத்தில் மாற்றங்கள் செய்யப்படுகிறார்கள்.

post_push(component: weblate.trans.models.Component, activity_log_id: int | None = None) dict | None

களஞ்சியத்திற்குப் பிறகு நிகழ்வு கையாளுபவர் மேல்நோக்கி தள்ளப்படுகிறது.

post_update(component: weblate.trans.models.Component, previous_head: str, skip_push: bool, activity_log_id: int | None = None) dict | None

நிகழ்வு கையாளுபவர் அப்ச்ட்ரீமில் இருந்து களஞ்சியம் புதுப்பிக்கப்பட்ட பிறகு.

அளவுருக்கள்:
  • previous_head (str) -- புதுப்பிப்புக்கு முன்னர் களஞ்சியத்தின் தலைவர், ஆரம்ப குளோனில் காலியாக இருக்கலாம்.

  • skip_push (bool) -- Whether the add-on operation should skip pushing changes upstream. Usually you can pass this to underlying methods as commit_and_push or commit_pending.

pre_commit(translation: Translation, author: str, store_hash: bool, activity_log_id: int | None = None) dict | None

நிகழ்வு கையாளுபவர் களஞ்சியத்தில் மாற்றங்கள் செய்யப்படுவதற்கு முன்.

pre_push(component: weblate.trans.models.Component, activity_log_id: int | None = None) dict | None

களஞ்சியம் மேல்நோக்கி தள்ளப்படுவதற்கு முன் நிகழ்வு கையாளுபவர்.

pre_update(component: weblate.trans.models.Component, activity_log_id: int | None = None) dict | None

நிகழ்வு கையாளுபவர் அப்ச்ட்ரீமில் இருந்து களஞ்சியம் புதுப்பிக்கப்படுவதற்கு முன்.

save_state() None

கூடுதல் மாநில தகவல்களைச் சேமிக்கவும்.

unit_pre_create(unit: Unit, activity_log_id: int | None = None) dict | None

புதிய அலகு உருவாக்கப்படுவதற்கு முன் நிகழ்வு கையாளுபவர்.

user() User

வலைபெயர்ப்பு பயனர் இந்த துணை நிரலால் மாற்றங்களைக் கண்காணிக்கப் பயன்படுகிறது.

class weblate.addons.models.Addon

ஒரு சேர்க்கைக்கான ORM பொருள்.

class weblate.trans.models.Component

ஒரு கூறுக்கான ORM பொருள்.

class weblate.trans.models.Translation

மொழிபெயர்ப்புக்கான ORM பொருள்.

class weblate.trans.models.Project

ஒரு திட்டத்திற்கான ORM பொருள்.

class weblate.trans.models.Unit

ஒரு அலகுக்கான ORM பொருள்.

class weblate.trans.models.Change

மாற்றத்திற்கான ORM பொருள்.

class weblate.trans.models.User

ஒரு பயனருக்கான ORM பொருள்.

class weblate.trans.models.TranslationFormat

மொழிபெயர்ப்பு கோப்பு ரேப்பர்.

class weblate.trans.models.BaseAddonForm

துணை நிரல்களை உள்ளமைப்பதற்கான அடிப்படை வடிவம்.

இங்கே ஒரு எடுத்துக்காட்டு சேர்க்கை:

# Copyright © Michal Čihař <michal@weblate.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later

from __future__ import annotations

from typing import TYPE_CHECKING, ClassVar

from django.utils.translation import gettext_lazy

from weblate.addons.base import BaseAddon
from weblate.addons.events import AddonEvent

if TYPE_CHECKING:
    from weblate.addons.base import CompatDict


class ExampleAddon(BaseAddon):
    # Filter for compatible components, every key is
    # matched against property of component
    compat: ClassVar[CompatDict] = {
        "file_format": {"po", "po-mono"},
    }
    # List of events add-on should receive
    events: ClassVar[set[AddonEvent]] = {
        AddonEvent.EVENT_PRE_COMMIT,
    }
    # Add-on unique identifier
    name = "weblate.example.example"
    # Verbose name shown in the user interface
    verbose = gettext_lazy("Example add-on")
    # Detailed add-on description
    description = gettext_lazy("This add-on does nothing it is just an example.")

    # Callback to implement custom behavior
    def pre_commit(
        self,
        translation,
        author: str,
        store_hash: bool,
        activity_log_id: int | None = None,
    ) -> None:
        return