Welcome to Weblate’s documentation!¶
Contents:
About Weblate¶
Project goals¶
Minimalistic web based translation with direct commit to git on each translation made. There is no plan in heavy conflict resolution as these should be primarily handled on git side.
Project name¶
The project is named as mixture of words web and translate.
Project website¶
You can find project website at <http://weblate.org/>, there is also demonstration server at <http://demo.weblate.org/>. This documentation can be browsed on <http://weblate.readthedocs.org/>.
Authors¶
This tool was written by Michal Čihař <michal@cihar.com>.
Usage guide¶
This document briefly covers how to translate application using Weblate.
Registration¶
While everybody can browse projects, view translations or suggest them, only registered users are allowed to actually save changes and are credited for every translation made.
You can register following two simple steps:
- Fill out the registration form with your credentials
- Activate registration by following in email you receive
- Possibly adjust your profile to choose which languages you know
Profile information¶
User profile contains your preferences, name and email. Name and email are bing used in Git commits, so keep this information accurate.
In preferences, you can choose user interface language, languages which you prefer to translate (list of these will be offered to you on main page) and secondary languages, whose translations will be shown to you while translating.
Projects structure¶
Each project can contain various subprojects. The reason for this structure is that all subprojects in a project are expected to have a lot in common. Whenever translation is made in single subproject, it is automatically propagated to others within same project (this is especially useful when translating more version of same project).
Translation links¶
Once you navigate to translation, you will be shown set of links which lead to translation. These are results of various checks, like untranslated or fuzzy strings. Should no other checks fire, there will be still link to all translations. Alternatively you can use search field to find translation you need to fix.
Translating¶
On translate page, you are shown source string and edit area for translating. Should the translation be plural, multiple source strings and edit areas are shown, each described with label for plural form.
There are various extra information which can be shown on this page. Most of them are coming from the project source code (like context, comments or where the message is being used). When you configure secondary languages in your preferences, translation to these languages will be shown.
Bellow translation can be also shown suggestions from other users, which you can accept or delete.
Suggestions¶
As an anonymous user, you have no other choice than making a suggestion. However if you are logged in you can still decide to make only a suggestion instead of saving translation, for example in case you are unsure about the translation and you want somebody else to review it.
Machine translation¶
Based on configuration and your language, Weblate provides buttons for following machine translation tools.
Apertium¶
A free/open-source machine translation platform providing translation to limited set of lanugages.
Ver también
Microsoft Translator¶
Machine translation service. Weblate is currently using deprecated v1 API, which might stop working in future.
Ver también
Checks¶
Weblate does wide range of consistency checks on translated messages. The following section describes them in more detail. The checks take account also special rules for different languages, so if you think the result is wrong, please report a bug.
Not translated¶
The source and translated strings are same at least in one of plural forms. This checks ignores some strings which are quite usually same in all languages.
Starting newline¶
Source and translated do not both start with a newline.
Trailing newline¶
Source and translated do not both end with a newline.
Trailing space¶
Source and translated do not both end with a space.
Trailing stop¶
Source and translated do not both end with a full stop. Full stop is also checked in various language variants (Chinese, Japanese, Devanagari or Urdu).
Trailing colon¶
Source and translated do not both end with a colon or colon is not correctly spaced. This includes spacing rules for French or Breton. Colon is also checked in various language variants (Chinese or Japanese).
Trailing question¶
Source and translated do not both end with question mark or it is not correctly spaced. This includes spacing rules for French or Breton. Question mark is also checked in various language variants (Armenian, Arabic, Chinese, Korean, Japanese, Ethiopic, Vai or Coptic).
Trailing exclamation¶
Source and translated do not both end with exclamation mark or it is not correctly spaced. This includes spacing rules for French or Breton. Exclamation mark is also check in various langauge variants (Chinese, Japanese, Korean, Armenian, Limbu, Myanmar or Nko).
Python format¶
Python format string does not match source.
PHP format¶
PHP format string does not match source.
C format¶
C format string does not match source.
Missing plurals¶
Some plural forms are not translated. Check plural form definition to see for which counts each plural form is being used.
Changes¶
weblate 0.7¶
Relased on February 16th 2012.
- Direct support for GitHub notifications.
- Added support for cleaning up orphaned checks and translations.
- Displays nearby strings while translating.
- Displays similar strings while translating.
- Improved searching for string.
weblate 0.6¶
Relased on February 14th 2012.
- Added various checks for translated messages.
- Tunable access control.
- Improved handling of translations with new lines.
- Added client side sorting of tables.
- Please check upgrading instructions in case you are upgrading.
weblate 0.5¶
Relased on February 12th 2012.
- Support for machine translation using following online services:
- Apertium
- Microsoft Translator
- MyMemory
- Several new translations.
- Improved merging of upstream changes.
- Better handle concurrent git pull and translation.
- Propagating works for fuzzy changes as well.
- Propagating works also for file upload.
- Fixed file downloads while using FastCGI (and possibly others).
weblate 0.4¶
Relased on February 8th 2012.
- Added usage guide to documentation.
- Fixed API hooks not to require CSRF protection.
weblate 0.3¶
Relased on February 8th 2012.
- Better display of source for plural translations.
- New documentation in Sphinx format.
- Displays secondary languages while translating.
- Improved error page to give list of existing projects.
- New per language stats.
weblate 0.2¶
Relased on February 7th 2012.
- Improved validation of several forms.
- Warn users on profile upgrade.
- Remember URL for login.
- Naming of text areas while entering plural forms.
- Automatic expanding of translation area.
Installation instructions¶
Requirements¶
- Django
- https://www.djangoproject.com/
- Translate-toolkit
- http://translate.sourceforge.net/wiki/toolkit/index
- GitPython (>= 0.3)
- http://gitorious.org/projects/git-python/
- Django-registration
- https://bitbucket.org/ubernostrum/django-registration/
Installation¶
Install all required components (see above), adjust settings.py
and
then run ./manage.py syncdb to create database structure. Now you
should be able to create translation projects using admin interface. You
probably also want to run ./manage.py setuplang to get default list
of languages and ./manage.py setupgroups to initialize default groups.
Ver también
Running server¶
Running Weblate is not different from running any other Django based application.
It is recommended to serve static files directly by your webserver, you should use that for following paths:
/media
- Serves
media
directory from Weblate. /static/admin
- Serves media files for Django admin interface (eg.
/usr/share/pyshared/django/contrib/admin/media/
).
Additionally you should setup rewrite rule to serve media/favicon.ico
as favicon.ico
.
Sample configuration for Lighttpd¶
The configuration for Lighttpd web server might look like following:
fastcgi.server = (
"/weblate.fcgi" => (
"main" => (
"socket" => "/var/run/django/weblate.socket",
"check-local" => "disable",
)
),
)
alias.url = (
"/media" => "/var/lib/django/weblate/media/",
"/static/admin" => "/usr/share/pyshared/django/contrib/admin/media/",
)
url.rewrite-once = (
"^(/*media.*)$" => "$1",
"^(/*static.*)$" => "$1",
"^/*favicon\.ico$" => "/media/favicon.ico",
"^/*robots\.txt$" => "/media/robots.txt",
"^(/.*)$" => "/weblate.fcgi$1",
)
expire.url = (
"/media/" => "access 1 months",
"/static/" => "access 1 months",
"/favicon.ico" => "access 1 months",
)
Upgrading¶
On upgrade to version 0.6 you should run ./manage.py syncdb and ./manage.py setupgroups --move to setup access control as described in installation section.
On upgrade to version 0.7 you should run ./manage.py syncdb to setup new tables and ./manage.py rebuild_index to build index for fulltext search.
Configuration¶
All settings are stored in settings.py
(as usual for Django).
-
COMMIT_MESSAGE
¶ Message used on each commit Weblate does.
-
ENABLE_HOOKS
¶ Whether to enable anonymous remote hooks.
Ver también
-
GIT_ROOT
¶ Path where Weblate will store cloned Git repositories. Defaults to
repos
subdirectory.
-
MT_APERTIUM_KEY
¶ API key for Apertium Web Service, you can register at http://api.apertium.org/register.jsp
-
MT_MICROSOFT_KEY
¶ API key for Microsoft Translator service, you can register at http://www.bing.com/developers/createapp.aspx
-
NEARBY_MESSAGES
¶ How many messages around current one to show during translating.
-
SITE_TITLE
¶ Site title to be used in website and emails as well.
Administration¶
Administration of Weblate is done through standard Django admin interface,
which is available under /admin/
URL.
Adding new resources¶
All translation resources need to be available as Git repositories and are organized as project/subproject structure.
Weblate supports wide range of translation formats supported by translate toolkit, for example:
- GNU Gettext
- XLIFF
- Java properties
- Windows RC files
- Qt Linguist .ts
- Symbian localization files
- CSV
- INI
Project¶
To add new resource to translate, you need to create translation project first. The project is sort of shelf, in which real translations are folded. All subprojects in same project share suggestions and dictionary, also the translations are automatically propagated through the all subproject in single project.
Subproject¶
Subproject is real resource for translating. You enter Git repository location and file mask which files to translate and Weblate automatically fetches the Git and finds all translated files.
Nota
As setup of translation project includes fetching Git repositories, you
might want to preseed these, repos are stored in path defined by
GIT_ROOT
in settings.py
in <project>/<subproject>
directories.
Updating repositories¶
You should set up some way how backend repositories are updated from their source. You can either use hooks (see Interacting with others) or just regularly run ./manage.py updategit --all.
With Gettext po files, you might be often bitten by conflict in PO file
headers. To avoid it, you can use shipped merge driver
(scripts/git-merge-gettext-po
). To use it just put following
configuration to your .gitconfig
:
[merge "merge-gettext-po"]
name = merge driver for gettext po files
driver = /path/to/weblate/scripts/git-merge-gettext-po %O %A %B
And enable it’s use by defining proper attributes in given repository (eg. in
.git/info/attribute
):
*.po merge=merge-gettext-po
Nota
This merge driver assumes the changes in POT files always are done in brach we’re trying to merge.
Interacting with others¶
You can trigger update of underlaying git repository for every subproject by
accessing URL /hooks/p/project/subproject/update/
.
For GitHub, there is a special URL /hooks/github/
, which parses GitHub
notifications and updates related projects automatically.
Nota
The GitHub notification relies on Git urls you use to be in form git://github.com/owner/repo.git
Access control¶
Weblate uses privileges system based on Django. It defines following extra privileges:
- Can upload translation
- Can overwrite with translation upload
- Can save translation
- Can accept suggestion
- Can accept suggestion
The default setup (after you run ./manage.py setupgroups) consists of single group Users which has all above privileges and all users are automatically added to this group.
To customize this setup, it is recommended to remove privileges from Users group and create additional groups with finer privileges (eg. Translators group, which will be allowed to save translations and manage suggestions) and add selected users to this group. You can do all this from Django admin interface.
Management commands¶
The ./manage.py is extended with following commands:
-
checkgit
¶
Prints current state of backend git repository.
You can either define which subproject to check (eg.
weblate/master
) or use--all
to check all existing subprojects.
-
cleanuptrans
¶
Cleanups orphnaed checks and translation suggestions.
-
loadpo
¶
Reloads translations from disk (eg. in case you did some updates in Git repository).
-
rebuild_index
¶
Rebuilds index for fulltext search. This might be lengthy operation if you have huge set of translation units.
You can use
--clean
to remove all words from database prior updating.
-
setupgroups
¶
Configures default groups and (if called with
--move
) assigns all users to default group.Ver también
-
setuplang
¶
Setups list of languages (it has own list and all defined in translate-toolkit).
-
updategit
¶
Fetches remote Git repositories and updates internal cache.
You can either define which subproject to update (eg.
weblate/master
) or use--all
to update all existing subprojects.
License¶
Copyright (C) 2012 Michal Čihař <michal@cihar.com>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.