Scripting
is extensible using scripts in several interpreted languages, including Python and JavaScript. Scripts are usually integrated into UI as menu actions (to which you may assign a keyboard shortcut). The location and name of menu entry for the script is defined in its accompanying .rc file. On each project open scans PROJECTDIR/lokalize-scripts folder for .rc files and adds them to a cache file called PROJECTDIR/lokalize-scripts/scripts.rc (so you shouldn't generally want to add it project's version control system). RC files also contain script paths, which may be relative to .rc file folder, or to a system scripts folder - they are tried both (actually they should be relative if you want to share .rc file with other people in your project). So you for example can specify ../../scripts/lokalize/opensrc.py to load script from global kde4-l10n scripts folder ( not specific to your language).
Examples of .rc files may be found in install folder (usually /usr/share/kde4/apps/lokalize/scripts/) and in KDE repository. Here you can find more script examples, including JavaScript-based check-gui.js that runs automatically on each file save (this is achieved via special option in .rc file). If you're familiar with Python or JavaScript, the code should be self-explanatory.
Below are links to API references. Everything marked as Q_SCRIPTABLE may be used from scripts.
Editor object API reference
Lokalize object API reference
Project object API reference