Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
4d5b8e38
Commit
4d5b8e38
authored
Aug 26, 2015
by
Weblate
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
29865697
5cbe3e34
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
29 deletions
+31
-29
weblate/trans/models/subproject.py
weblate/trans/models/subproject.py
+31
-29
No files found.
weblate/trans/models/subproject.py
View file @
4d5b8e38
...
...
@@ -18,7 +18,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
from
django.db
import
models
from
django.db
import
models
,
transaction
from
django.utils.translation
import
ugettext
as
_
,
ugettext_lazy
from
django.core.mail
import
mail_admins
from
django.core.exceptions
import
ValidationError
...
...
@@ -966,40 +966,42 @@ class SubProject(models.Model, PercentMixin, URLMixin, PathMixin):
matches
=
self
.
get_mask_matches
()
language_re
=
re
.
compile
(
self
.
language_regex
)
for
pos
,
path
in
enumerate
(
matches
):
code
=
self
.
get_lang_code
(
path
)
if
langs
is
not
None
and
code
not
in
langs
:
self
.
log_info
(
'skipping %s'
,
path
)
continue
if
not
language_re
.
match
(
code
):
self
.
log_info
(
'skipping language %s'
,
code
)
continue
with
transaction
.
atomic
():
code
=
self
.
get_lang_code
(
path
)
if
langs
is
not
None
and
code
not
in
langs
:
self
.
log_info
(
'skipping %s'
,
path
)
continue
if
not
language_re
.
match
(
code
):
self
.
log_info
(
'skipping language %s'
,
code
)
continue
self
.
log_info
(
'checking %s (%s) [%d/%d]'
,
path
,
code
,
pos
+
1
,
len
(
matches
)
)
lang
=
Language
.
objects
.
auto_get_or_create
(
code
=
code
)
if
lang
.
code
in
languages
:
self
.
log_error
(
'duplicate language found: %s'
,
lang
.
code
)
continue
translation
=
Translation
.
objects
.
check_sync
(
self
,
lang
,
code
,
path
,
force
,
request
=
request
)
translations
.
add
(
translation
.
id
)
languages
.
add
(
lang
.
code
)
self
.
log_info
(
'checking %s (%s) [%d/%d]'
,
path
,
code
,
pos
+
1
,
len
(
matches
)
)
lang
=
Language
.
objects
.
auto_get_or_create
(
code
=
code
)
if
lang
.
code
in
languages
:
self
.
log_error
(
'duplicate language found: %s'
,
lang
.
code
)
continue
translation
=
Translation
.
objects
.
check_sync
(
self
,
lang
,
code
,
path
,
force
,
request
=
request
)
translations
.
add
(
translation
.
id
)
languages
.
add
(
lang
.
code
)
# Delete possibly no longer existing translations
if
langs
is
None
:
todelete
=
self
.
translation_set
.
exclude
(
id__in
=
translations
)
if
todelete
.
exists
():
self
.
log_info
(
'removing stale translations: %s'
,
','
.
join
([
trans
.
language
.
code
for
trans
in
todelete
])
)
todelete
.
delete
()
with
transaction
.
atomic
():
self
.
log_info
(
'removing stale translations: %s'
,
','
.
join
([
trans
.
language
.
code
for
trans
in
todelete
])
)
todelete
.
delete
()
# Process linked repos
for
subproject
in
self
.
get_linked_childs
():
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment