வலைபெயர்ப்பு தனிப்பயனாக்குதல்

சாங்கோ மற்றும் பைத்தானைப் பயன்படுத்தி நீட்டித்து தனிப்பயனாக்கவும். எல்லோரும் பயனடையச் செய்யும் வகையில் உங்கள் மாற்றங்களை அப்ச்ட்ரீமில் பங்களிக்கவும். இது உங்கள் பராமரிப்பு செலவுகளைக் குறைக்கிறது; உள் இடைமுகங்களை மாற்றும்போது அல்லது குறியீட்டை மறுசீரமைக்கும்போது வலைபெயர்ப்பில் உள்ள குறியீடு கவனிக்கப்படுகிறது.

Hint

You can also customize Weblate look in தோற்றம் தனிப்பயனாக்கம்.

Warning

உள் இடைமுகங்கள் அல்லது வார்ப்புருக்கள் ஒரு நிலையான பநிஇ என்று கருதப்படவில்லை. ஒவ்வொரு மேம்படுத்தல், இடைமுகங்கள் அல்லது அவற்றின் சொற்பொருள் முன்னறிவிப்பின்றி மாறக்கூடும் என்பதற்கான உங்கள் தனிப்பயனாக்கங்களை மதிப்பாய்வு செய்.

பைதான் தொகுதியை உருவாக்குதல்

If you are not familiar with Python, you might want to look into Python For Beginners, explaining the basics and pointing to further tutorials.

To write a file with custom Python code (called a module), a place to store it is needed, either in the system path (usually something like /usr/lib/python3.12/site-packages/) or in the Weblate directory, which is also added to the interpreter search path.

Hint

When using Docker, you can place Python modules in /app/data/python/ (see கப்பல்துறை கொள்கலன் தொகுதிகள்), so they can be loaded by Weblate, for example from a settings override file.

இன்னும் சிறப்பாக, உங்கள் தனிப்பயனாக்கலை சரியான பைதான் தொகுப்பாக மாற்றவும்:

  1. உங்கள் தொகுப்புக்கு ஒரு கோப்புறையை உருவாக்கவும் (நாங்கள் weblate_customization ஐப் பயன்படுத்துவோம்).

  2. Within it, create a pyproject.toml file to describe the package:

    [build-system]
    requires = ["uv_build>=0.8.18,<0.9.0"]
    build-backend = "uv_build"
    
    [project]
    name = "weblate-customization"
    version = "0.1.0"
    description = "Add your description here"
    requires-python = ">=3.13"
    dependencies = []
    
  3. Create a folder for the Python module: src/weblate_customization

  4. Within it, create a __init__.py file to ensure Python can import the module.

  5. This package can now be installed using uv pip install -e. More info to be found in Editable packages documentation.

  6. Once installed, the module can be used in the Weblate configuration (for example weblate_customization.checks.FooCheck).

உங்கள் தொகுப்பு அமைப்பு இப்படி இருக்க வேண்டும்:

weblate_customization
├── pyproject.toml
└── src
    └── weblate_customization
        ├── __init__.py
        ├── addons.py
        └── checks.py

வலைபெயர்ப்பைத் தனிப்பயனாக்குவதற்கான உதாரணத்தை <https://github.com/weblateorg/customize- example> இல் நீங்கள் காணலாம், இது கீழே விவரிக்கப்பட்டுள்ள அனைத்து தலைப்புகளையும் உள்ளடக்கியது.

Custom quality checks, add-ons, automatic suggestions and auto-fixes

To install your code for தனிப்பயன் தானியங்கி சரிசெய்தல், சொந்த சோதனைகளை எழுதுதல், தனிப்பயன் இயந்திர மொழிபெயர்ப்பு or கூடுதல் எழுதுதல் in Weblate:

  1. Place the files into your Python module containing the Weblate customization (see பைதான் தொகுதியை உருவாக்குதல் or Customizing code).

  2. Add its fully-qualified path to the Python class in the dedicated settings:

# Checks
CHECK_LIST += ("weblate_customization.checks.FooCheck",)

# Autofixes
AUTOFIX_LIST += ("weblate_customization.autofix.FooFixer",)

# Add-ons
WEBLATE_ADDONS += ("weblate_customization.addons.ExamplePreAddon",)

# Automatic suggestions
WEBLATE_MACHINERY += ("weblate_customization.machinery.SampleTranslation",)