Yönetim komutları
Not
Running management commands under a different user than the one running your webserver can result in files getting wrong permissions, please check Dosya sistemi izinleri for more details.
You will find basic management commands (available as ./manage.py
in the Django sources,
or as an extended set in a script called weblate installable atop Weblate).
Invoking management commands
As mentioned before, invocation depends on how you installed Weblate.
Weblate için virtualenv kullanıyorsanız, weblate komutunun tam yolunu belirtebilir ya da çağırmadan önce virtualenv etkinleştirebilirsiniz:
# Direct invocation
~/weblate-env/bin/weblate
# Activating virtualenv adds it to search path
. ~/weblate-env/bin/activate
weblate
If you are using source code directly (either from a tarball or Git checkout), the
management script is ./manage.py
available in the Weblate sources.
To run it:
python ./manage.py list_versions
Weblate kurulumu için pip kurucusunu ya da ./setup.py
betiğini kullandıysanız, Weblate denetimi için kullanılacak weblate yolunuza (ya da kullandığınız virtualenv yoluna) kurulur:
weblate list_versions
For the Docker image, the script is installed like above, and you can run it using docker exec:
docker exec --user weblate <container> weblate list_versions
For docker-compose the process is similar, you just have to use docker-compose exec:
docker-compose exec --user weblate weblate weblate list_versions
In case you need to pass it a file, you can temporary add a volume:
docker-compose exec --user weblate /tmp:/tmp weblate weblate importusers /tmp/users.json
add_suggestions
- weblate add_suggestions <project> <component> <language> <file>
2.5 sürümünde geldi.
Imports a translation from the file to use as a suggestion for the given translation. It skips duplicated translations; only different ones are added.
- --author USER@EXAMPLE.COM
E-mail of author for the suggestions. This user has to exist prior to importing (you can create one in the admin interface if needed).
Örnek:
weblate --author michal@cihar.com add_suggestions weblate application cs /tmp/suggestions-cs.po
auto_translate
- weblate auto_translate <project> <component> <language>
2.5 sürümünde geldi.
4.6 sürümünde değişti: Çeviri kipi parametresi eklendi.
Performs automatic translation based on other component translations.
- --source PROJECT/COMPONENT
Specifies the component to use as source available for translation. If not specified all components in the project are used.
- --user USERNAME
Specify username listed as author of the translations. “Anonymous user” is used if not specified.
- --overwrite
Whether to overwrite existing translations.
- --add
Automatically add language if a given translation does not exist.
- --mt MT
Use machine translation instead of other components as machine translations.
- --threshold THRESHOLD
Similarity threshold for machine translation, defaults to 80.
- --mode MODE
Specify translation mode, default is
translate
butfuzzy
orsuggest
can be used.
Örnek:
weblate auto_translate --user nijel --inconsistent --source weblate/application weblate website cs
Ayrıca bakınız
celery_queues
- weblate celery_queues
3.7 sürümünde geldi.
Celery görev kuyruklarının uzunluğunu görüntüler.
checkgit
- weblate checkgit <project|project/component>
Arka uç Git deposunun geçerli durumunu yazdırır.
You can either define which project or component to update (for example
weblate/application
), or use --all
to update all existing components.
commitgit
- weblate commitgit <project|project/component>
Commits any possible pending changes to the back-end Git repository.
You can either define which project or component to update (for example
weblate/application
), or use --all
to update all existing components,
or use --file-format
to filter based on the file format.
commit_pending
- weblate commit_pending <project|project/component>
Belirli bir süreden daha önce bekleyen değişiklikleri işler.
You can either define which project or component to update (for example
weblate/application
), or use --all
to update all existing components.
- --age HOURS
İşleme için saat olarak yaş. Belirtilmezse, Bileşen yapılandırması içinde yapılandırılmış değer kullanılır.
Not
This is automatically performed in the background by Weblate, so there no real need to invoke this manually, besides forcing an earlier commit than specified by Bileşen yapılandırması.
Ayrıca bakınız
cleanuptrans
- weblate cleanuptrans
Cleans up orphaned checks and translation suggestions. There is normally no need to run this manually, as the cleanups happen automatically in the background.
Ayrıca bakınız
cleanup_ssh_keys
- weblate cleanup_ssh_keys
4.9.1 sürümünde geldi.
Performs cleanup of stored SSH host keys:
Removes deprecated RSA keys for GitHub which might cause issues connecting to GitHub.
Removes duplicate entries in host keys.
Ayrıca bakınız
createadmin
- weblate createadmin
Creates an admin
account with a random password, unless it is specified.
- --password PASSWORD
Provides a password on the command-line, to not generate a random one.
- --no-password
Do not set password, this can be useful with –update.
- --username USERNAME
Use the given name instead of
admin
.
- --email USER@EXAMPLE.COM
Yönetici e-posta adresini belirtin.
- --name
Yönetici adını belirtin (görüntülenecek).
- --update
Var olan kullanıcıyı güncelleyin (parolaları değiştirmek için bunu kullanabilirsiniz).
2.9 sürümünde değişti: Eklenen parametreler --username
, --email
, --name
ve --update
.
dump_memory
- weblate dump_memory
2.20 sürümünde geldi.
Export a JSON file containing Weblate Translation Memory content.
Ayrıca bakınız
dumpuserdata
- weblate dumpuserdata <file.json>
Dumps userdata to a file for later use by importuserdata
.
İpucu
This comes in handy when migrating or merging Weblate instances.
import_demo
- weblate import_demo
4.1 sürümünde geldi.
Creates a demo project with components based on <https://github.com/WeblateOrg/demo>. Make sure the celery tasks are running before running this command.
This can be useful when developing Weblate.
import_json
- weblate import_json <json-file>
2.7 sürümünde geldi.
Batch import of components based on JSON data.
The imported JSON file structure pretty much corresponds to the component
object (see GET /api/components/(string:project)/(string:component)/
).
You have to include the name
and filemask
fields.
- --project PROJECT
Specifies where the components will be imported from.
- --main-component COMPONENT
Use the given VCS repository from this component for all of them.
- --ignore
Skip (already) imported components.
- --update
Update (already) imported components.
2.9 sürümünde değişti: The parameters --ignore
and --update
are there to deal with already
imported components.
JSON dosyası örneği:
[
{
"slug": "po",
"name": "Gettext PO",
"file_format": "po",
"filemask": "po/*.po",
"new_lang": "none"
},
{
"name": "Android",
"filemask": "android/values-*/strings.xml",
"template": "android/values/strings.xml",
"repo": "weblate://test/test",
"file_format": "aresource"
}
]
Ayrıca bakınız
import_memory
- weblate import_memory <file>
2.20 sürümünde geldi.
Imports a TMX or JSON file into the Weblate translation memory.
- --language-map LANGMAP
Allows mapping languages in the TMX to the Weblate translation memory. The language codes are mapped after normalization usually done by Weblate.
--language-map en_US:en
will for example import allen_US
strings asen
ones.This can be useful in case your TMX file locales happen not to match what you use in Weblate.
Ayrıca bakınız
import_project
- weblate import_project <project> <gitrepo> <branch> <filemask>
3.0 sürümünde değişti: The import_project command is now based on the Bileşen keşfi add-on, leading to some changes in behavior and what parameters are accepted.
Batch imports components into project based on the file mask.
<project> names an existing project, into which the components are to be imported.
The <gitrepo> defines the Git repository URL to use, and <branch> signifies the Git branch. To import additional translation components from an existing Weblate component, use a weblate://<project>/<component> URL for the <gitrepo>.
The <filemask> defines file discovery for the repository. It can be either be made simple using wildcards, or it can use the full power of regular expressions.
The simple matching uses **
for component name and *
for language, for
example: **/*.po
The regular expression has to contain groups named component and language.
For example: (?P<language>[^/]*)/(?P<component>[^-/]*)\.po
The import matches existing components based on files and adds the ones that do not exist. It does not change already existing ones.
- --name-template TEMPLATE
Customize the name of a component using Django template syntax.
For example:
Documentation: {{ component }}
- --base-file-template TEMPLATE
Customize the base file for monolingual translations.
For example:
{{ component }}/res/values/string.xml
- --new-base-template TEMPLATE
Customize the base file for addition of new translations.
For example:
{{ component }}/ts/en.ts
- --file-format FORMAT
You can also specify the file format to use (see Desteklenen dosya biçimleri), the default is auto-detection.
- --language-regex REGEX
You can specify language filtering (see Bileşen yapılandırması) with this parameter. It has to be a valid regular expression.
- --main-component
You can specify which component will be chosen as the main one—the one actually containing the VCS repository.
- --license NAME
Specify the overall, project or component translation license.
- --license-url URL
Specify the URL where the translation license is to be found.
- --vcs NAME
In case you need to specify which version control system to use, you can do it here. The default version control is Git.
To give you some examples, let’s try importing two projects.
First The Debian Handbook translations, where each language has separate a folder with the translations of each chapter:
weblate import_project \
debian-handbook \
git://anonscm.debian.org/debian-handbook/debian-handbook.git \
squeeze/master \
'*/**.po'
Then the Tanaguru tool, where the file format needs be specified, along with the base file template, and how all components and translations are located in single folder:
weblate import_project \
--file-format=properties \
--base-file-template=web-app/tgol-web-app/src/main/resources/i18n/%s-I18N.properties \
tanaguru \
https://github.com/Tanaguru/Tanaguru \
master \
web-app/tgol-web-app/src/main/resources/i18n/**-I18N_*.properties
More complex example of parsing of filenames to get the correct component and
language out of a filename like
src/security/Numerous_security_holes_in_0.10.1.de.po
:
weblate import_project \
tails \
git://git.tails.boum.org/tails master \
'wiki/src/security/(?P<component>.*)\.(?P<language>[^.]*)\.po$'
Filtering only translations in a chosen language:
./manage import_project \
--language-regex '^(cs|sk)$' \
weblate \
https://github.com/WeblateOrg/weblate.git \
'weblate/locale/*/LC_MESSAGES/**.po'
Importing Sphinx documentation split to multiple files:
$ weblate import_project --name-template 'Documentation: %s' \
--file-format po \
project https://github.com/project/docs.git master \
'docs/locale/*/LC_MESSAGES/**.po'
Importing Sphinx documentation split to multiple files and directories:
$ weblate import_project --name-template 'Directory 1: %s' \
--file-format po \
project https://github.com/project/docs.git master \
'docs/locale/*/LC_MESSAGES/dir1/**.po'
$ weblate import_project --name-template 'Directory 2: %s' \
--file-format po \
project https://github.com/project/docs.git master \
'docs/locale/*/LC_MESSAGES/dir2/**.po'
Ayrıca bakınız
More detailed examples can be found in the Starting with internationalization chapter,
alternatively you might want to use import_json
.
importuserdata
- weblate importuserdata <file.json>
Imports user data from a file created by dumpuserdata
.
importusers
- weblate importusers --check <file.json>
Imports users from JSON dump of the Django auth_users database.
- --check
With this option it will just check whether a given file can be imported and report possible conflicts arising from usernames or e-mails.
You can dump users from the existing Django installation using:
weblate dumpdata auth.User > users.json
install_addon
3.2 sürümünde geldi.
- weblate install_addon --addon ADDON <project|project/component>
Installs an add-on to a set of components.
- --addon ADDON
Name of the add-on to install. For example
weblate.gettext.customize
.
- --configuration CONFIG
Bir eklentinin JSON olarak kodlanmış yapılandırması.
- --update
Var olan eklenti yapılandırmasını güncelle.
You can either define which project or component to install the add-on in (for example
weblate/application
), or use --all
to include all existing components.
To install Gettext çıktısını özelleştirme for all components:
weblate install_addon --addon weblate.gettext.customize --config '{"width": -1}' --update --all
Ayrıca bakınız
list_languages
- weblate list_languages <locale>
Lists supported languages in MediaWiki markup - language codes, English names and localized names.
This is used to generate <https://wiki.l10n.cz/Slovn%C3%ADk_s_n%C3%A1zvy_jazyk%C5%AF>.
list_translators
- weblate list_translators <project|project/component>
Lists translators by contributed language for the given project:
[French]
Jean Dupont <jean.dupont@example.com>
[English]
John Doe <jd@example.com>
- --language-code
List names by language code instead of language name.
You can either define which project or component to use (for example
weblate/application
), or use --all
to list translators from all existing
components.
list_versions
- weblate list_versions
Tüm Weblate bağımlılıklarını ve sürümlerini listeler.
loadpo
- weblate loadpo <project|project/component>
Reloads translations from disk (for example in case you have done some updates in the VCS repository).
- --force
Force update, even if the files should be up-to-date.
- --lang LANGUAGE
Limit processing to a single language.
You can either define which project or component to update (for example
weblate/application
), or use --all
to update all existing components.
Not
You seldom need to invoke this, Weblate will automatically load changed files for every VCS update. This is needed in case you manually changed an underlying Weblate VCS repository or in some special cases following an upgrade.
lock_translation
- weblate lock_translation <project|project/component>
Prevents further translation of a component.
İpucu
Useful in case you want to do some maintenance on the underlying repository.
You can either define which project or component to update (for example
weblate/application
), or use --all
to update all existing components.
Ayrıca bakınız
move_language
- weblate move_language source target
3.0 sürümünde geldi.
Allows you to merge language content. This is useful when updating to a new version which contains aliases for previously unknown languages that have been created with the (generated) suffix. It moves all content from the source language to the target one.
Örnek:
weblate move_language cze cs
After moving the content, you should check whether there is anything left (this is subject to race conditions when somebody updates the repository meanwhile) and remove the (generated) language.
pushgit
- weblate pushgit <project|project/component>
İşlenen değişiklikleri yukarı akış sürüm denetimi deposuna iter.
- --force-commit
Bekleyen değişikliklerin itilmeden önce işlenmesini dayatır.
You can either define which project or component to update (for example
weblate/application
), or use --all
to update all existing components.
Not
Weblate pushes changes automatically if İşleme ile itme in Bileşen yapılandırması is turned on, which is the default.
unlock_translation
- weblate unlock_translation <project|project/component>
Unlocks a given component, making it available for translation.
İpucu
Useful in case you want to do some maintenance on the underlying repository.
You can either define which project or component to update (for example
weblate/application
), or use --all
to update all existing components.
Ayrıca bakınız
setupgroups
- weblate setupgroups
Configures default groups and optionally assigns all users to that default group.
- --no-privs-update
Turns off automatic updating of existing groups (only adds new ones).
- --no-projects-update
Prevents automatic updates of groups for existing projects. This allows adding newly added groups to existing projects, see Proje erişim denetimi.
Ayrıca bakınız
setuplang
- weblate setuplang
Updates list of defined languages in Weblate.
- --no-update
Turns off automatic updates of existing languages (only adds new ones).
updatechecks
- weblate updatechecks <project|project/component>
Updates all checks for all strings.
İpucu
Useful for upgrades which do major changes to checks.
You can either define which project or component to update (for example
weblate/application
), or use --all
to update all existing components.
updategit
- weblate updategit <project|project/component>
Fetches remote VCS repositories and updates the internal cache.
You can either define which project or component to update (for example
weblate/application
), or use --all
to update all existing components.
Not
Usually it is better to configure hooks in the repository to trigger
Bildirim kancaları, instead of regular polling by updategit
.