Inmheánach láithreán gréasáin

Note

Tabharfaidh an chaibidil seo forbhreathnú bunúsach duit ar inmheánacha Weblate.

Tagann an chuid is mó dá struchtúr cód ó Weblate agus tá sé bunaithe ar Django.

Struchtúr eolaire

Forbhreathnú tapa ar struchtúr eolaire príomhstór Weblate:

docs

Cód foinseach don doiciméadú seo, ar féidir é a thógáil le Sphinx.

dev-docker

Cód docker chun freastalaí forbartha a rith, féach Weblate a rith go háitiúil i Docker.

weblate

Cód foinse Weblate mar fheidhmchlár Django, féach Inmheánach láithreán gréasáin.

weblate/static

Comhaid cliant (CSS, Javascript agus íomhánna), féach Comhéadan gréasáin.

modúil

Is éard atá i Weblate ná roinnt feidhmchlár Django (roinnt roghnach, féach Modúil Roghnacha Weblate):

accounts

Cuntas úsáideora, próifílí agus fógraí.

addons

Breiseáin chun iompar Weblate a athrú, féach Breiseáin.

api

API bunaithe ar creat Django REST.

auth

Fíordheimhniú agus ceadanna.

billing

An modúl roghnach Billeáil.

checks

Modúl teaghrán aistriúcháin Seiceálacha cáilíochta.

fonts

Modúl seiceála rindreála cló.

formats

Ciseal astarraingthe formáid comhaid bunaithe ar aistrithe-uirlisí.

gitexport

An modúl roghnach Onnmhaireoir Git.

lang

Modúl a shainíonn múnlaí teanga agus iolra.

legal

An modúl roghnach Modúl dlí.

machinery

Comhtháthú seirbhísí aistriúcháin meaisín.

memory

Cuimhne aistriúcháin ionsuite, féach Cuimhne Aistriúcháin.

screenshots

Bainistíocht scáileáin agus modúl OCR.

trans

Príomh-mhodúl ag láimhseáil aistriúcháin.

utils

Fóntais cúntóir éagsúla.

vcs

Astarraingt córas rialaithe leagan.

wladmin

Django shaincheapadh comhéadan admin.

Translation sources

A unit has a canonical file source and may have a translation from another language as its effective source. Keep Unit.source and Unit.source_unit canonical: repository synchronization and file formats depend on this. Use effective_source and its language and plural accessors for content shown to translators. Do not replace source on a copied unit to simulate an effective source; other fields and related objects still describe the canonical source.

Use Unit.source_snapshot when an operation needs to preserve the source text, language, plural rules, and terminology metadata together. Its identity defines source changes for dependency reconciliation, editor conflict detection, and AI diagnostics. For historical rendering and reports, read the snapshot recorded on the change, rather than reconstructing it from the current unit.

A missing configured parent remains a custom source: its text is empty, its language is retained, and its child is blocked. effective_source_unit is then None. Only removing the workflow or selecting the canonical language restores the canonical source.

Text-only accessors do not load language or plural metadata. For batch consumers that need the complete effective source, use UnitQuerySet.prefetch_translation_parent() alongside their existing unit prefetches. prefetch_source() already includes this. Ordinary searches keep the canonical query path and ordinary units retain their existing content hashes.

Source-dependent writes enter source_operation() before locking unit rows. The outer operation takes a shared project gate and reads its workflow mapping in one database round trip, including for projects without custom workflows. Workflow changes take source_project_gate(..., exclusive=True) before validation or persistence. Configuration changes affecting several projects acquire their gates in ascending project ID order. Never upgrade a shared gate to an exclusive one inside an operation.

The database gate function locks first and reads workflows in a separate statement, so a waiter sees configuration committed while it waited. Write paths use this transaction-scoped view rather than cached model settings. Nested operations reuse it; rolled-back savepoints discard their dependency work. Queued dependencies are reconciled before commit and external memory updates are scheduled after commit. Source-change history is written in bulk, preserving individual records while batching their notification dispatch.

Acquire any required repository locks before project gates, then component and unit row locks. Reconciliation itself only changes database state and does not acquire repository locks. Apply this boundary to bulk imports, automatic translation, file-save failures, deletion, and restoration as well as editor writes. Language and plural-rule changes require exclusive gates before their updates. Historical migrations use historical models without these runtime helpers.

Machinery source selection happens before mapping language codes to a provider. Use get_unit_source_language() for translation and uses_custom_source() for workflow-specific glossary handling. Provider codes can merge distinct language variants, so code equality cannot determine whether a workflow source was selected. Explicit component or secondary source selection takes precedence over the workflow source.

Inmheánaigh tascanna cúlra

Hint

Déantar cur síos sa chuid seo ar ghnéithe inmheánacha tascanna Celery. Tascanna cúlra ag baint úsáide as Soilire déantar cur síos ar conas Celery a chumrú chun na tascanna a rith.

Úsáideann Weblate Celery chun tascanna a fhorghníomhú sa chúlra. Bíonn roinnt tascanna spreagtha ag imeachtaí, agus bíonn roinnt tascanna spreagtha ag sceideal.

Úsáidtear an Celery Beat chun tascanna a sceidealú, agus úsáidtear django-celery-beat chun an sceideal tascanna tréimhsiúil a stóráil sa bhunachar sonraí. Cumraítear an sceideal tascanna i tasks.py i ngach ceann de na haipeanna Django.

Ídítear na tascanna ag baint úsáide as roinnt scuainí; cumraítear an ródaíocht i settings.py. Dearadh na scuainí chun cineálacha éagsúla ualaigh oibre a dheighilt:

celery

An scuaine réamhshocraithe ina ndéantar tascanna cúlra a phróiseáil.

notify

Seachadann sé ríomhphoist fógra, le haghaidh imeachtaí laistigh de Weblate agus le haghaidh fíordheimhnithe nó clárúcháin araon. Is scuaine ar leithligh í seo chun seachadadh ríomhphoist a dhéanamh réidh fiú má tá carn tascanna eile ann.

memory

Nuashonraíonn sé iontrálacha cuimhne aistriúcháin. Is féidir leis an scuaine nuashonraithe a bheith fada agus teaghráin nua á n-allmhairiú, agus níl mórán tábhacht le próiseáil fhada anseo, mar sin seachnaíonn scuaine ar leith bac a chur ar thascanna eile.

backup

Ní féidir na tascanna cúltaca a fhorghníomhú go comhthreomhar, agus déanann oibrí tiomnaithe aonair é seo níos éasca.

translate

Is eol go dtógann tascanna aistriúcháin uathoibríocha tamall fada mar go mbíonn tionchar acu ar sheirbhísí seachtracha.