Breiseáin a fhorbairt¶
Is bealach iad Breiseáin chun sreabhadh oibre logánaithe a shaincheapadh in Weblate.
- class weblate.addons.base.BaseAddon(storage: Addon)¶
Bunrang le haghaidh breiseáin Weblate.
- classmethod can_install(*, component: Component | None = None, project: Project | None = None) bool¶
Seiceáil an bhfuil an breiseán comhoiriúnach leis an gcomhpháirt tugtha.
- change_event(change: Change, activity_log_id: int | None = None) dict | None¶
Láimhseálaí teagmhais le haghaidh teagmhas athrú.
- check_change_action(change: Change) bool¶
Scagadh luath ar ghníomhartha Athraithe sula ndéantar glao ar ais change_event a spreagadh.
- component_update(component: weblate.trans.models.Component, activity_log_id: int | None = None) dict | None¶
Láimhseálaí imeachtaí le haghaidh nuashonrú comhpháirteanna.
- configure(configuration: dict[str, Any]) None¶
Sábháil cumraíocht.
- daily(component: weblate.trans.models.Component, activity_log_id: int | None = None) dict | None¶
Láimhseálaí imeachtaí go laethúil.
- classmethod get_add_form(user: User | None, *, component: Component | None = None, project: Project | None = None, **kwargs) BaseAddonForm | None¶
Seol ar ais an fhoirm chumraíochta chun an breiseán nua a chur leis.
- get_settings_form(user: User | None, **kwargs) BaseAddonForm | None¶
Seol ar ais an fhoirm chumraíochta don bhreiseán seo.
- post_add(translation: Translation, activity_log_id: int | None = None) dict | None¶
Láimhseálaí imeachtaí tar éis aistriúchán nua a chur leis.
- post_commit(component: weblate.trans.models.Component, store_hash: bool, activity_log_id: int | None = None) dict | None¶
Láimhseálaí imeachtaí tar éis athruithe a dhéanamh ar an stór.
- post_push(component: weblate.trans.models.Component, activity_log_id: int | None = None) dict | None¶
Láimhseálaí imeachtaí tar éis an taisc a bhrú suas an sruth.
- post_update(component: weblate.trans.models.Component, previous_head: str, skip_push: bool, activity_log_id: int | None = None) dict | None¶
Láimhseálaí imeachtaí tar éis an taisclainne a nuashonrú ó réamhtheachtacha.
- Paraiméadair:
previous_head (str) -- Is féidir CEANN an stór roimh nuashonrú, a bheith bán ar an gclón tosaigh.
skip_push (bool) -- Cibé ar cheart d'oibríocht an bhreiseáin scipeáil athruithe a bhrú in aghaidh an tsrutha. De ghnáth is féidir leat é seo a chur ar aghaidh chuig modhanna bunúsacha mar
commit_and_pushnócommit_pending.
- pre_commit(translation: Translation, author: str, store_hash: bool, activity_log_id: int | None = None) dict | None¶
Láimhseálaí an imeachta sula ndéantar athruithe ar an stór.
- pre_push(component: weblate.trans.models.Component, activity_log_id: int | None = None) dict | None¶
Láimhseálaí imeachtaí roimh an stór a bhrú suas an sruth.
- pre_update(component: weblate.trans.models.Component, activity_log_id: int | None = None) dict | None¶
Láimhseálaí imeachtaí sula ndéantar an stór a nuashonrú ó réamhtheachtacha.
- save_state() None¶
Sábháil faisnéis stáit an bhreiseáin.
- class weblate.addons.models.Addon¶
Réad ORM le haghaidh breiseán.
- class weblate.trans.models.Component¶
Réad ORM le haghaidh comhpháirte.
- class weblate.trans.models.Translation¶
Réad ORM le haghaidh aistriúcháin.
- class weblate.trans.models.Project¶
Réad ORM le haghaidh tionscadail.
- class weblate.trans.models.Unit¶
Réad ORM le haghaidh aonad.
- class weblate.trans.models.Change¶
Réad ORM le haghaidh athraithe.
- class weblate.trans.models.User¶
Réad ORM don úsáideoir.
- class weblate.trans.models.TranslationFormat¶
Fillteán comhad aistriúcháin.
- class weblate.trans.models.BaseAddonForm¶
Bunfhoirm chun breiseáin a chumrú.
Seo breiseán samplach:
# 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