GithubHelp home page GithubHelp logo

weblateorg / weblate Goto Github PK

View Code? Open in Web Editor NEW
4.2K 4.2K 944.0 2.63 GB

Web based localization tool with tight version control integration.

Home Page: https://weblate.org/

License: GNU General Public License v3.0

Shell 0.66% Python 85.88% HTML 9.97% CSS 2.00% JavaScript 1.45% PHP 0.01% Dockerfile 0.03% Fluent 0.01% Lua 0.01%
continuous-localization crowdsourcing django gettext hacktoberfest i18n internationalization l10n localization python translation

weblate's People

Contributors

aga-c avatar andriykopanytsia avatar bourock avatar comradekingu avatar dependabot[bot] avatar fenio avatar filhocf avatar fitojb avatar franconian avatar geeyun-jy3 avatar jsmakaayb avatar julroy67 avatar kyotaro avatar ldmpub avatar lem9 avatar milotype avatar nijel avatar panos78 avatar renovate[bot] avatar rffontenelle avatar rimy avatar ruleant avatar santossi avatar sr093906 avatar vfbfan avatar victorenator avatar vistaus avatar weblate avatar yarons avatar yurchor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

weblate's Issues

Error after failed merge (and corrupted po file)

Traceback (most recent call last):

  File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py", line 111, in get_response
    response = callback(request, *callback_args, **callback_kwargs)

  File "/var/lib/django/l10n/weblate/trans/views.py", line 619, in translate
    unit.save_backend(request)

  File "/var/lib/django/l10n/weblate/trans/models.py", line 1080, in save_backend
    (saved, pounit) = self.translation.update_unit(self, request)

  File "/var/lib/django/l10n/weblate/trans/models.py", line 889, in update_unit
    return need_save, pounit

UnboundLocalError: local variable 'pounit' referenced before assignment

Add support for locking subproject for translations

Sometimes it is good idea to prevent translation to happen in web interface - for example when some complex merge is going on outside weblate. Weblate should provide possibility to lock subproject for translation in this time.

User did not receive the confirmation email

Hi,

When a user register, Weblate tells him that he will receive a confirmation email, but he did not.

Is there something I should configure?
Weblate is running on a VPS with no SMTP filter; and Postfix is installed.

Regards,
Valentin

privilege based access control

It should be possible to limit access to translating only to set of users. However the default setup should still be to allow everybody logged in to translate.

This requires:

  • add set of privileges
  • let various operations check whether user has this privilege
  • add generic group Users, which will have all privileges
  • make all new users be automatically part of this group

This basic setup would work as current system, allowing administrators to customize it (limit rights for Users group and adding separate groups for more fine grained access control).

Mask validation

There should be validation of file mask whether it does match at least one file.

Show source on related tab

From Dieter: Could you add the branch name to which the related messages belong in the related messages tab?

Most likely it should be consistent with all locations tab.

Encoding issues with MySQL

Hi,

When I "update from Git" with the Django admin, I get this error:

Environment:


Request Method: POST
Request URL: http://weblate.progval.net/admin/trans/subproject/

Django Version: 1.4
Python Version: 2.7.3
Installed Applications:
('django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django.contrib.admin',
 'django.contrib.admindocs',
 'registration',
 'weblate.trans',
 'weblate.lang',
 'weblate.accounts',
 'weblate')
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.locale.LocaleMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware')


Traceback:
File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response
  111.                         response = callback(request, *callback_args, **callback_kwargs)
File "/usr/lib/python2.7/dist-packages/django/contrib/admin/options.py" in wrapper
  366.                 return self.admin_site.admin_view(view)(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/django/utils/decorators.py" in _wrapped_view
  91.                     response = view_func(request, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/django/views/decorators/cache.py" in _wrapped_view_func
  89.         response = view_func(request, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/django/contrib/admin/sites.py" in inner
  196.             return view(request, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/django/utils/decorators.py" in _wrapper
  25.             return bound_func(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/django/utils/decorators.py" in _wrapped_view
  91.                     response = view_func(request, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/django/utils/decorators.py" in bound_func
  21.                 return func(self, *args2, **kwargs2)
File "/usr/lib/python2.7/dist-packages/django/contrib/admin/options.py" in changelist_view
  1153.                 response = self.response_action(request, queryset=cl.get_query_set(request))
File "/usr/lib/python2.7/dist-packages/django/contrib/admin/options.py" in response_action
  908.             response = func(self, request, queryset)
File "/home/weblate/weblate/weblate/trans/admin.py" in update_from_git
  38.             s.do_update()
File "/home/weblate/weblate/weblate/trans/models.py" in do_update
  309.         self.create_translations()
File "/home/weblate/weblate/weblate/trans/models.py" in create_translations
  411.             Translation.objects.update_from_blob(self, code, path, blob_hash, force)
File "/home/weblate/weblate/weblate/trans/managers.py" in update_from_blob
  87.         translation.update_from_blob(blob_hash, force)
File "/home/weblate/weblate/weblate/trans/models.py" in update_from_blob
  650.             newunit = Unit.objects.update_from_unit(self, unit, pos)
File "/home/weblate/weblate/weblate/trans/managers.py" in update_from_unit
  123.         dbunit.update_from_unit(unit, pos, force)
File "/home/weblate/weblate/weblate/trans/models.py" in update_from_unit
  988.         self.save(force_insert = force, backend = True, same_content = same_content)
File "/home/weblate/weblate/weblate/trans/models.py" in save
  1082.         super(Unit, self).save(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/django/db/models/base.py" in save
  463.         self.save_base(using=using, force_insert=force_insert, force_update=force_update)
File "/usr/lib/python2.7/dist-packages/django/db/models/base.py" in save_base
  551.                 result = manager._insert([self], fields=fields, return_id=update_pk, using=using, raw=raw)
File "/usr/lib/python2.7/dist-packages/django/db/models/manager.py" in _insert
  203.         return insert_query(self.model, objs, fields, **kwargs)
File "/usr/lib/python2.7/dist-packages/django/db/models/query.py" in insert_query
  1576.     return query.get_compiler(using=using).execute_sql(return_id)
File "/usr/lib/python2.7/dist-packages/django/db/models/sql/compiler.py" in execute_sql
  910.             cursor.execute(sql, params)
File "/usr/lib/python2.7/dist-packages/django/db/backends/util.py" in execute
  40.             return self.cursor.execute(sql, params)
File "/usr/lib/python2.7/dist-packages/django/db/backends/mysql/base.py" in execute
  114.             return self.cursor.execute(query, args)
File "/usr/lib/python2.7/dist-packages/MySQLdb/cursors.py" in execute
  176.         if not self._defer_warnings: self._warning_check()
File "/usr/lib/python2.7/dist-packages/MySQLdb/cursors.py" in _warning_check
  92.                     warn(w[-1], self.Warning, 3)

Exception Type: Warning at /admin/trans/subproject/
Exception Value: Incorrect string value: '\xC5\x91v\xC3\xADt...' for column 'target' at row 1

Here are some informations about the file which triggers it:

progval@Andromede:~/workspace/Supybot/Limnoria$ grep `python -c "print '\xC5\x91v\xC3\xADt'"` plugins/Anonymous/locale/hu.po
msgstr "Meghatározza, hogy a bot megkövetelje-e, hogy a bővítményt használni kívánó emberek abban a csatornában legyenek, ahová névtelenül szeretnének küldeni."
msgstr "Meghatározza, hogy a bot megkövetelje-e, hogy a bővítményt használni kívánó emberek regisztrálva legyenek."
msgstr "Meghatározza, hogy milyen képesség (ha van ilyen) legyen szükséges a bővítmény használatához."
msgstr "Ez a bővítmény megengedi a felhasználóknak, hogy névtelenül cselekedjenek a boton keresztül. A 'do' parancs hatására a bot végrehajt egy névtelen tevékenységet egy megadott csatornában, és a 'say' parancs megengedi másoknak, hogy a boton keresztül beszéljenek. Mivel ezzel elég könnyen vissza lehet élni, érdemes beállítani a supybot.plugins.Anonymous.requireCapability-t, hogy csak az adott képességgel rendelkező felhasználók használhassák ezt a bővítményt. Extra biztonságért a supybot.plugins.Anonymous.requirePresenceInChannel-lel megkövetelheted, hogy a felhasználó abban a csatornában legyen, amelyet névtelenül szeretnének megcímezni, vagy a supybot.plugins.Anonymous.requireRegistration-nel megkövetelheted, hogy a felhasználó regisztálva legyen."
msgstr "A megadott csatornában nem használhatod a bővítményt a csatorna képességei miatt."
progval@Andromede:~/workspace/Supybot/Limnoria$ head plugins/Anonymous/locale/hu.po -n 15
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR ORGANIZATION
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: Limnoria Anonymous\n"
"POT-Creation-Date: 2011-06-09 18:26+CEST\n"
"PO-Revision-Date: 2011-07-21 17:32+0100\n"
"Last-Translator: nyuszika7h <[email protected]>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: pygettext.py 1.5\n"

Regards,
Valentin

A way to group translation changes in fewer commits

I wish it was possible for weblate to create fewer commits than one per msgstr change.

Our 9-year old project has about 11000 commits. Our ".pot" file currently has 2647 messages. That means that fully translating just 5 languages with weblate will create more commits than the entire rest of the project! (even more, since weblate will be creating commits on 'maint' and 'master' branches and then we'll double the length of the history when merging 'maint' into master!)

I don't know what the implementation would be like, but for example all changes by the same author without a pause longer than 15 minutes could be placed in a single commit.

Improved indication were you are when translating

When translating, you get an indictation of which string from total strings your are translating, but this is an absolute position.
It would be nice to have an indication of how many strings there are left in the current filter (untranslated, fuzzy, ...)

Support for django-registration 0.8

When i try to register an account I have this traceback. why it happen, is it a bug or i mis samething?

note : i used xubuntu 12.04 and postgresql.

Environment:

Request Method: GET
Request URL: http://192.168.1.5:8000/accounts/register/

Django Version: 1.4
Python Version: 2.7.3
Installed Applications:
('django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
'django.contrib.admindocs',
'registration',
'weblate.trans',
'weblate.lang',
'weblate.accounts',
'weblate')
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware')

Traceback:
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response

  1.                     response = callback(request, _callback_args, *_callback_kwargs)
    

Exception Type: TypeError at /accounts/register/
Exception Value: register() takes at least 2 arguments (3 given)

TypeError: 'Project' object is not callable

Hi,

I wanted to create subprojects automatically (I have around 50 of them), so I used ./manage.py shell to do it. And here is the result:

>>> def create(name):
...  subproject = SubProject(name=name, slug=name.lower(), project=limnoria, push='[email protected]:ProgVal/Limnoria.git', repo='[email protected]:ProgVal/Limnoria.git', branch='testing', filemask='plugins/%s/locale/*.po' % name, template='plugins/%s/messages.pot')
...  subproject.save()
... 
>>> create('Admin')
INFO updating repo Limnoria/Admin
INFO updating repo Limnoria/Admin
INFO merged remote into repo Limnoria/Admin
INFO checking plugins/Admin/locale/de.po
INFO processing plugins/Admin/locale/de.po, revision has changed
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "<console>", line 3, in create
  File "/home/weblate/weblate/weblate/trans/models.py", line 482, in save
    self.create_translations()
  File "/home/weblate/weblate/weblate/trans/models.py", line 411, in create_translations
    Translation.objects.update_from_blob(self, code, path, blob_hash, force)
  File "/home/weblate/weblate/weblate/trans/managers.py", line 87, in update_from_blob
    translation.update_from_blob(blob_hash, force)
  File "/home/weblate/weblate/weblate/trans/models.py", line 646, in update_from_blob
    store = self.get_store()
  File "/home/weblate/weblate/weblate/trans/models.py", line 618, in get_store
    store = factory.getobject(self.get_filename())
  File "/usr/lib/python2.7/dist-packages/translate/storage/factory.py", line 178, in getobject
    storeclass = getclass(storefile, ignore, classes=classes, classes_str=classes_str, hiddenclasses=hiddenclasses)
  File "/usr/lib/python2.7/dist-packages/translate/storage/factory.py", line 157, in getclass
    module = __import__("translate.storage.%s" % _module, globals(), {}, _module)
  File "/usr/lib/python2.7/dist-packages/translate/storage/po.py", line 43, in <module>
    from translate.storage.pypo import * # pylint: disable-msg=W0401
  File "/usr/lib/python2.7/dist-packages/translate/storage/pypo.py", line 33, in <module>
    from translate.storage import pocommon, base, poparser
  File "/usr/lib/python2.7/dist-packages/translate/storage/pocommon.py", line 191, in <module>
    class pofile(poheader.poheader, base.TranslationStore):
  File "/usr/lib/python2.7/dist-packages/translate/storage/pocommon.py", line 192, in pofile
    Name = _("Gettext PO file") # pylint: disable-msg=E0602
TypeError: 'Project' object is not callable

According to the traceback it is probably not your fault, but I notify you, just in case.

Regards,
Valentin

Index 'source' does not exist in FileStorage

Hi guys,

I'm experiencing a new issue that I just found, when trying to save a translation I got this :

EmptyIndexError at /projects/aum/www/de_DE/translate/
Index 'source' does not exist in FileStorage('/home/esya/public_html/weblate/whoosh-index')

Here's the traceback:

Environment:

Request Method: POST

Django Version: 1.4
Python Version: 2.6.6
Installed Applications:
('django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
'django.contrib.admindocs',
'registration',
'trans',
'lang',
'accounts',
'weblate')
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware')

Traceback:
File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/base.py" in get_response

  1.                     response = callback(request, _callback_args, *_callback_kwargs)
    
    File "/home/esya/public_html/weblate/trans/views.py" in translate
  2.         obj.check_sync()
    
    File "/home/esya/public_html/weblate/trans/models.py" in check_sync
  3.     self.update_from_blob()
    
    File "/home/esya/public_html/weblate/trans/models.py" in update_from_blob
  4.         newunit = Unit.objects.update_from_unit(self, unit, pos)
    
    File "/home/esya/public_html/weblate/trans/managers.py" in update_from_unit
  5.     dbunit.update_from_unit(unit, pos, force)
    
    File "/home/esya/public_html/weblate/trans/models.py" in update_from_unit
  6.     self.save(force_insert = force, backend = True, same_content = same_content)
    
    File "/home/esya/public_html/weblate/trans/models.py" in save
  7.         Unit.objects.add_to_index(self)
    
    File "/home/esya/public_html/weblate/trans/managers.py" in add_to_index
  8.         writer_source = trans.search.index.source_writer()
    
    File "/home/esya/public_html/weblate/trans/search.py" in source_writer
  9.         self._source_writer = BufferedWriter(self.source())
    
    File "/home/esya/public_html/weblate/trans/search.py" in source
  10.             indexname = 'source'
    
    File "/usr/local/lib/python2.6/dist-packages/whoosh/index.py" in open_dir
  11. return storage.open_index(indexname)
    
    File "/usr/local/lib/python2.6/dist-packages/whoosh/filedb/filestore.py" in open_index
  12.     return FileIndex(self, schema=schema, indexname=indexname)
    
    File "/usr/local/lib/python2.6/dist-packages/whoosh/filedb/fileindex.py" in init
  13.     _read_toc(self.storage, self._schema, self.indexname)
    
    File "/usr/local/lib/python2.6/dist-packages/whoosh/filedb/fileindex.py" in _read_toc
  14.                           % (indexname, storage))
    

Exception Type: EmptyIndexError at /projects/aum/www/de_DE/translate/
Exception Value: Index 'source' does not exist in FileStorage('/home/esya/public_html/weblate/whoosh-index')

Any idea ?

Missing trans

Buttons on "Suggestions" of translate page, "Accept" and "Delete", are not used trans.

check message for correctness

There should be some checks whether message is actually correct.

Right now at least following things make sense:

  • \n at beginning/end (gettext complains on this)
  • php-format
  • python-format

"list index out of range"

Hi guys,

First of all, weblate seems great, but the thing is, the documentation really isn't clear enough, and is not user friendly.

Now I've been stuck for 2 days with the same error "list index out of range". On our website, we use PO files, so when I added the subproject I used *.po as a mask but it showed nothing on the client side (I mean no language and nothing to translate).

I tried adding a Translation and entering the po filename, now I can see a language on the homepage of weblate, but when I click on it I got :

Error during template rendering

In template /home/esya/public_html/weblate/html/translation.html, error at line 17
list index out of range

I have the latest weblate version and I'm using Django 1.4, any idea ?

Improve lookup for similar messages

The lookup for similar messages is currently quite slow, it should be improved to use much more of Whoosh capabilities. Best would be to have just have own calculator of key terms and use more_like_this.

add glossary

Each project should have assigned glossary of frequently used terms.

show related strings

To improve consistency of translations, the interface should show related strings while translating. It might be simply strings around current one in po file or somehow close matches.

Error on finding similar strings

Traceback (most recent call last):

File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py", line 111, in get_response
response = callback(request, _callback_args, *_callback_kwargs)

File "/var/lib/django/l10n/weblate/trans/views.py", line 848, in get_similar
similar = Unit.objects.similar(unit)

File "/var/lib/django/l10n/weblate/trans/managers.py", line 252, in similar
terms = [kw for kw, score in searcher.key_terms_from_text('source', unit.source, numterms = 10) if not kw in IGNORE_SIMILAR]

File "/usr/lib/python2.7/dist-packages/whoosh/searching.py", line 471, in key_terms_from_text
return expander.expanded_terms(numterms, normalize=normalize)

File "/usr/lib/python2.7/dist-packages/whoosh/classify.py", line 177, in expanded_terms
norm = model.normalizer(maxweight, self.top_total)

File "/usr/lib/python2.7/dist-packages/whoosh/classify.py", line 58, in normalizer
return (maxweight * log((1.0 + f) / f) + log(1.0 + f)) / log(2.0)

ZeroDivisionError: float division by zero

automatic translation

Add button to automatically translate subproject using already available traslations (from other subprojects).

UnboundLocalError at /projects/linuxcnc/linuxcnc-master/de/translate/

With weblate-0.4-1073-gee219c8 I am getting

Traceback:
File "/usr/src/weblate/venv/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/django/core/handlers/base.py" in get_response
  111.                         response = callback(request, *callback_args, **callback_kwargs)
File "/usr/src/weblate/trans/views.py" in translate
  324.         'search_exact': bool2str(search_exact),

Exception Type: UnboundLocalError at /projects/linuxcnc/linuxcnc-master/de/translate/
Exception Value: local variable 'search_exact' referenced before assignment

after clicking the "all strings" link from a language page. It appears that in the 'not is_valid()' arm of a test you're not setting search_exact to a default value.

A possible fix may look like

diff --git a/trans/views.py b/trans/views.py
index 725330a..0ea5ee8 100644
--- a/trans/views.py
+++ b/trans/views.py
@@ -152,6 +152,7 @@ def translate(request, project, subproject, lang):
         search_target = True
         search_context = True
         search_url = ''
+        search_exact = True
 
     # Any form submitted?
     if request.method == 'POST':

'Use this translation' button when translations are inconsistent

It would be nice to have a 'Use this translation' button next to each translation when translations are inconsistent between branches. This button, when clicked, should commit to branches that has a translation different from the correct translation chosen.

ZeroDivisionError: float division by zero

Hi,

The URL /languages/ gives this error:

Environment:


Request Method: GET
Request URL: http://weblate.progval.net/languages/

Django Version: 1.4
Python Version: 2.7.3
Installed Applications:
('django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django.contrib.admin',
 'django.contrib.admindocs',
 'registration',
 'weblate.trans',
 'weblate.lang',
 'weblate.accounts',
 'weblate')
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.locale.LocaleMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware')


Template error:
In template /home/weblate/weblate/weblate/html/languages.html, error at line 19
   float division by zero
   9 : {% block content %}


   10 : 


   11 : <table class="sort">


   12 : <thead>


   13 : <tr>


   14 : <th>{% trans "Language" %}</th>


   15 : <th colspan="2">{% trans "Translated" %}</th>


   16 : </tr>


   17 : <tbody>


   18 : {% for lang in languages %}


   19 :  {% with lang.get_translated_percent as percent %} 


   20 : {% if lang.has_translations %}


   21 : <tr>


   22 : <th><a href="{{ lang.get_absolute_url }}">{{ lang }}</a></th>


   23 : <td class="progress"><div class="progress" id="{{ percent|floatformat:0 }}"></div></td>


   24 : <td class="percent">{{ percent }}%</td>


   25 : </tr>


   26 : {% endif %}


   27 : {% endwith %}


   28 : {% endfor %}


   29 : </tbody>


Traceback:
File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response
  111.                         response = callback(request, *callback_args, **callback_kwargs)
File "/home/weblate/weblate/weblate/trans/views.py" in show_languages
  141.         'title': _('Languages'),
File "/usr/lib/python2.7/dist-packages/django/shortcuts/__init__.py" in render_to_response
  20.     return HttpResponse(loader.render_to_string(*args, **kwargs), **httpresponse_kwargs)
File "/usr/lib/python2.7/dist-packages/django/template/loader.py" in render_to_string
  171.         return t.render(Context(dictionary))
File "/usr/lib/python2.7/dist-packages/django/template/base.py" in render
  140.             return self._render(context)
File "/usr/lib/python2.7/dist-packages/django/template/base.py" in _render
  134.         return self.nodelist.render(context)
File "/usr/lib/python2.7/dist-packages/django/template/base.py" in render
  823.                 bit = self.render_node(node, context)
File "/usr/lib/python2.7/dist-packages/django/template/debug.py" in render_node
  74.             return node.render(context)
File "/usr/lib/python2.7/dist-packages/django/template/loader_tags.py" in render
  123.         return compiled_parent._render(context)
File "/usr/lib/python2.7/dist-packages/django/template/base.py" in _render
  134.         return self.nodelist.render(context)
File "/usr/lib/python2.7/dist-packages/django/template/base.py" in render
  823.                 bit = self.render_node(node, context)
File "/usr/lib/python2.7/dist-packages/django/template/debug.py" in render_node
  74.             return node.render(context)
File "/usr/lib/python2.7/dist-packages/django/template/loader_tags.py" in render
  62.             result = block.nodelist.render(context)
File "/usr/lib/python2.7/dist-packages/django/template/base.py" in render
  823.                 bit = self.render_node(node, context)
File "/usr/lib/python2.7/dist-packages/django/template/debug.py" in render_node
  74.             return node.render(context)
File "/usr/lib/python2.7/dist-packages/django/template/defaulttags.py" in render
  185.                         nodelist.append(node.render(context))
File "/usr/lib/python2.7/dist-packages/django/template/defaulttags.py" in render
  474.                        self.extra_context.iteritems()])
File "/usr/lib/python2.7/dist-packages/django/template/base.py" in resolve
  571.                 obj = self.var.resolve(context)
File "/usr/lib/python2.7/dist-packages/django/template/base.py" in resolve
  721.             value = self._resolve_lookup(context)
File "/usr/lib/python2.7/dist-packages/django/template/base.py" in _resolve_lookup
  772.                             current = current()
File "/home/weblate/weblate/weblate/lang/models.py" in get_translated_percent
  161.         return round(translations['translated__sum'] * 100.0 / translations['total__sum'], 1)

Exception Type: ZeroDivisionError at /languages/
Exception Value: float division by zero

Regards,
Valentin

Support for shared git repos

Subprojects sharing same upstream repository could also share local copy. This way we can hugely reduce required disk space. Also exporting such repositories will be much easier.

It could be done by using special URLs for internal git repos, for example weblate://project/subproject

Incorrect trailing stop in Japanese

If a sentence with trailing colon translates to end with full stop, it has no trailing colon, but trailing stop is appeared.
In the case, it's better that both of failing checks aren't shown.

Race on push

With two branches of single repository and notification hooks, it is quite easy to hit race condition - one repo was just pushed and triggered notification, which is doing update and we're about to push/update the second branch.

Backtrace:

File "/var/lib/django/l10n/trans/models.py", line 133, in do_push
ret &= s.do_push(request)

File "/var/lib/django/l10n/trans/models.py", line 278, in do_push
if not self.do_update(request):

File "/var/lib/django/l10n/trans/models.py", line 264, in do_update
ret = self.update_branch(request)

File "/var/lib/django/l10n/trans/models.py", line 312, in update_branch
gitrepo.remotes.origin.update()

File "/usr/lib/pymodules/python2.7/git/remote.py", line 510, in update
self.repo.git.remote("update", self.name)

File "/usr/lib/pymodules/python2.7/git/cmd.py", line 227, in
return lambda _args, *_kwargs: self._call_process(name, _args, *_kwargs)

File "/usr/lib/pymodules/python2.7/git/cmd.py", line 456, in _call_process
return self.execute(call, **_kwargs)

File "/usr/lib/pymodules/python2.7/git/cmd.py", line 377, in execute
raise GitCommandError(command, status, stderr_value)

GitCommandError: 'git remote update origin' returned exit status 1: fatal: Unable to create '/var/lib/django/l10n/repos/weblate/master/.git/refs/remotes/origin/master.lock': File exists.

If no other git process is currently running, this probably means a
git process crashed in this repository earlier. Make sure no other git
process is running and remove the file manually to continue.
error: Could not fetch origin

Automatic mask

For most projects, it should be pretty easy to automatically figure out path mask to translatable files. In such case empty mask should be automatically filled in with correct one.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Use SSL for translation services

If possible, otherwise uses get warning about insecure transfer. Alternative might be to do the requests from server and transparently hide this.

Modularize checks

The checks should be more configurable and extendible:

  • make class out of each check
  • add configuration variable TRANSLATION_CHECKS = ('trans.checks.Foo', 'trans.checks.Bar',...)

This way users could add custom classes or remove checks which produce too much false positives for them.

Mass creation of subprojects

Sometimes there will be more subprojects from single repo (with dozen of po files). It should be possible to import them all at once without need to fill in all parameters.

This depends on issue #48.

Merged translations

It should be possible to support merged translations mode - all po files for given language would be merged in database and would behave like single subproject.

Some projects have quite split po files and want to translate them at once and not separately.

Actually this would be useful for Weblate as well, as currently javascript po file is quite hidden for translators.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Whoosh filewriting LockError

When saving a translation, sometimes it just works ok, others will fail with the following error. Is there something I'm doing wrong? Thank you.
On:

  • Debian stable
  • python 2.6.6
  • Whoosh==2.4.0

Environment:

Request Method: POST
Request URL: http://xxx/projects/test/testweb/es/translate/

Django Version: 1.4
Python Version: 2.6.6
Installed Applications:
('django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
'django.contrib.admindocs',
'registration',
'weblate.trans',
'weblate.lang',
'weblate.accounts',
'weblate')
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware')

Traceback:
File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/base.py" in get_response

  1.                     response = callback(request, _callback_args, *_callback_kwargs)
    
    File "/weblate/weblate/trans/views.py" in translate
  2.                 unit.save_backend(request)
    
    File "/weblate/weblate/trans/models.py" in save_backend
  3.     self.save(backend = True)
    
    File "/weblate/weblate/trans/models.py" in save
  4.         Unit.objects.add_to_index(self)
    
    File "/weblate/weblate/trans/managers.py" in add_to_index
  5.         writer_source)
    
    File "/weblate/weblate/trans/managers.py" in add_to_source_index
  6.         context = unicode(context),
    
    File "/usr/local/lib/python2.6/dist-packages/whoosh/util.py" in synchronized_wrapper
  7.         return func(self, _args, *_kwargs)
    
    File "/usr/local/lib/python2.6/dist-packages/whoosh/writing.py" in update_document
  8.     self._get_writer()
    
    File "/usr/local/lib/python2.6/dist-packages/whoosh/writing.py" in _get_writer
  9.         self.writer = self.index.writer(**self.writerargs)
    
    File "/usr/local/lib/python2.6/dist-packages/whoosh/filedb/fileindex.py" in writer
  10.         return SegmentWriter(self, **kwargs)
    
    File "/usr/local/lib/python2.6/dist-packages/whoosh/filedb/filewriting.py" in init
  11.             raise LockError
    

Exception Type: LockError at /projects/test/testweb/es/translate/
Exception Value:

Smart merge of po files

It should be possible to write smarter po file merger for git, actually using content of the files and pushing translations to new template. It might be indeed complex, but should by doable.

Incorrect checks

Hi,
The English message is
"SQL query on database %s:"
The French translation is
"Requête SQL sur la base %s : "

When I delete the check about the ending space (which is correct), I get two other checks, this time about exclamation mark and question mark.

Trouble using gitweb URLs

I've got "Repoweb" set to "http://git.linuxcnc.org/gitweb?p=emc2.git&a=blob&f=%(file)&hb=master#%l(line)" but when I try to visit a page like http://lamp:8000/projects/linuxcnc/linuxcnc-master/de/translate/?type=untranslated
I get an error message like

Template error

In template /usr/src/weblate/html/translate.html, error at line 99
Caught ValueError while rendering: unsupported format character '&' (0x26) at index 58

The same problem exists when the URL contains ";"s, the default flavor of gitweb. On the demo webserver I notice that your URLs are to gitweb where there are no "&"s or ";".

The behavior above was with:
$ git describe
weblate-0.4-873-g5a52303
as I test this before submitting I am getting a different, probably unrelated error with weblate-0.4-1073-gee219c8:

Traceback:
File "/usr/src/weblate/venv/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/django/core/handlers/base.py" in get_response
  111.                         response = callback(request, *callback_args, **callback_kwargs)
File "/usr/src/weblate/trans/views.py" in translate
  324.         'search_exact': bool2str(search_exact),

Exception Type: UnboundLocalError at /projects/linuxcnc/linuxcnc-master/de/translate/
Exception Value: local variable 'search_exact' referenced before assignment

ability to check what has been changed

Hello.

Would be great to be able to see what has been changed in translation of some project last time.
Or even better - display changes made by some particular person.

regards
fEnIo

Lock for updating po files

Once there is po scanning in progress, it might take some time. As the events for this might come in short intervals, it can quite easily happen that there more concurrent updates, basically doing same work multiple times. This should be avoided either by locking or by delegating such work to background process.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Highlight search match in results

It is difficult to spot matching words in case string is too long, so the matched phrase should be highlighted.

  • Right now only full search phrase is highlighted even though it is searched by words.
  • The highlighter does not understand the search syntax, so it looks for source:literal in all strings instead of looking for literal in the source string.

create logo

For 1.0 release Weblate really should have some logo - to promote it and to use as favicon.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.