Project

General

Profile

Bug #15674

Feature #10034: Translation web platform

Feature #15075: Design and set up user roles, languages and reviewing process

Change all Weblate components to use correct committer name and email

Added by u over 1 year ago. Updated 4 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
Internationalization
Target version:
Start date:
06/19/2018
Due date:
% Done:

100%

Feature Branch:
Type of work:
Sysadmin
Blueprint:
Starter:
Affected tool:

Description

Currently, the components use Tails developers <> as default committer name and email.

We have to change this to comply with our new rules and use Tails translators <> As the master of this interface it would be nice if you could take care of this. I've not found a way to script this rapidly, so I did not.

DEFAULT_COMMITTER_NAME and DEFAULT_COMMITTER_EMAIL should also be changed or even added in settings.py, see https://docs.weblate.org/en/latest/admin/config.html


Related issues

Related to Tails - Bug #15185: Automatically update Weblate components on mdwn file add/rename/delete in tails.bo git Resolved 02/27/2019
Related to Tails - Feature #16225: merge hefee/dev/translation-server Resolved 12/14/2018

History

#1 Updated by u over 1 year ago

I'm not allowed to edit /var/lib/weblate/config/settings.py → This part should be done by groente I suppose.

#2 Updated by u over 1 year ago

  • Description updated (diff)

#3 Updated by intrigeri over 1 year ago

  • Target version changed from Tails_3.8 to Tails_3.9

#4 Updated by emmapeel over 1 year ago

  • Status changed from Confirmed to In Progress
  • QA Check set to Ready for QA

I have changed the settings of all components by:

- logging on weblate's shell in the server:

cd /usr/local/share/weblate/
sudo -u weblate ./manage.py shell

- once inside the shell, i ran this:
from weblate.trans.models import *         
todos = SubProject.objects.all() 

for i in todos:                            
    i.committer_email = u'tails-l10n@boum.org'
    i.committer_name = u'Tails translators'
    i.save()

Is a bit punk maybe, but I think it works.

I leave here the script for future reference.

#5 Updated by emmapeel over 1 year ago

  • Assignee changed from emmapeel to u

#6 Updated by u about 1 year ago

thanks @emmapeel!

#7 Updated by u about 1 year ago

  • Target version changed from Tails_3.9 to Tails_3.10.1

Won't be able to review this in the next 48 hours (release of 3.9)

#8 Updated by intrigeri 12 months ago

  • Target version changed from Tails_3.10.1 to Tails_3.11

#9 Updated by u 12 months ago

  • Assignee changed from u to hefee

#10 Updated by hefee 12 months ago

If a new components are added what parameters those get.

#11 Updated by hefee 12 months ago

  • Related to Bug #15185: Automatically update Weblate components on mdwn file add/rename/delete in tails.bo git added

#12 Updated by hefee 10 months ago

#13 Updated by hefee 10 months ago

When #16225 got merged. We only need to run @emmapeels snipset once again (#15674#note-4) and we can close this issue.

#14 Updated by emmapeel 10 months ago

hefee wrote:

When #16225 got merged. We only need to run @emmapeels snipset once again (#15674#note-4) and we can close this issue.

I have ran the script again. But what about all the other default values mentioned at https://redmine.tails.boum.org/code/issues/15185#note-25 ?

file_format = u'po'
license = u'GPL v3'
committer_email = u'tails-l10n@boum.org'
committer_name = u'Tails translators'
i.name = i.filemask
suggestion_voting = True  # this is what makes our review
suggestion_autoaccept = 2 # process work by now
enable_suggestions = True #
allow_translation_propagation = True

do they also need to be updated?

#15 Updated by hefee 10 months ago

emmapeel wrote:

hefee wrote:

When #16225 got merged. We only need to run @emmapeels snipset once again (#15674#note-4) and we can close this issue.

I have ran the script again. But what about all the other default values mentioned at https://redmine.tails.boum.org/code/issues/15185#note-25 ?

[...]

do they also need to be updated?

#16225 is not merged, so new components have still not the correct settings by default. AFTER #16225 has merged we need to run this script again. Also fix the other values as well. But we should use python3 to run manage.py, as we configured weblate to use python3:

cd /usr/local/share/weblate/
sudo -u weblate python3 manage.py shell

(only enable the save = True line after running it once without)

from weblate.trans.models import *         
todos = SubProject.objects.all() 

for i in todos:
    save = False
    default = {
        "committer_email": 'tails-l10n@boum.org', # no need to use unicode anymore in python3
        "committer_name": 'Tails translators',
        "file_format": 'po',
        "license": 'GPL v3',
        "name": i.filemask,
        "suggestion_voting": True,
        "suggestion_autoaccept": 2,
        "enable_suggestions": True,
        "allow_translation_propagation": True,
    }
    for key,value in default.items():
        if getattr(i, key) != value:
            print("{}[{}]: {} != {}".format(i.name,key,getattr(i,key), value))
            setattr(i, key, value)
            #save = True    # enable this only after checking once the changes
    if save:
        i.save()

With current run (those issues got fixed):

wiki/src/news/2018-fundraiser.*.po[file_format]: auto != po            
wiki/src/news/2018-fundraiser.*.po[license]:  != GPL v3      
wiki/src/news/achievements_in_2018.*.po[suggestion_voting]: False != True
wiki/src/news/achievements_in_2018.*.po[suggestion_autoaccept]: 0 != 2
wiki/src/news/achievements_in_2018.*.po[file_format]: auto != po
wiki/src/news/achievements_in_2018.*.po[license]:  != GPL v3
wiki/src/news/version_3.10.1.*.po[file_format]: auto != po
wiki/src/security/Numerous_security_holes_in_3.8.*.po[suggestion_voting]: False != True
wiki/src/security/Numerous_security_holes_in_3.8.*.po[suggestion_autoaccept]: 0 != 2
wiki/src/security/Numerous_security_holes_in_3.8.*.po[file_format]: auto != po    
wiki/src/security/Numerous_security_holes_in_3.8.*.po[license]:  != GPL v3
wiki/src/security/Numerous_security_holes_in_3.9.*.po[suggestion_voting]: False != True
wiki/src/security/Numerous_security_holes_in_3.9.*.po[suggestion_autoaccept]: 0 != 2
wiki/src/security/Numerous_security_holes_in_3.9.*.po[file_format]: auto != po
wiki/src/security/Numerous_security_holes_in_3.9.*.po[license]:  != GPL v3
wiki/src/security/Numerous_security_holes_in_3.9.1.*.po[suggestion_voting]: False != True
wiki/src/security/Numerous_security_holes_in_3.9.1.*.po[suggestion_autoaccept]: 0 != 2
wiki/src/security/Numerous_security_holes_in_3.9.1.*.po[file_format]: auto != po
wiki/src/security/Numerous_security_holes_in_3.9.1.*.po[license]:  != GPL v3

#16 Updated by emmapeel 10 months ago

I have run now:

from weblate.trans.models import *
todos = SubProject.objects.all()

for i in todos:
i.report_source_bugs = u''
i.repoweb = 'https://git-tails.immerda.ch/weblate/tails/tree/%(file)s?h=%(branch)s#n%(line)s'
i.suggestion_voting = True
i.suggestion_autoaccept = 2
i.enable_suggestions = True

i.committer_name = u'Tails translators'                                      
i.committer_email = u''
i.allow_translation_propagation = True
i.edit_template = False
if (i.file_format == u'auto'):                                               
i.file_format = u'po'
if (i.license == u''):
i.license = u'GPL v3'
i.save()

#17 Updated by hefee 10 months ago

  • Status changed from In Progress to Resolved
  • % Done changed from 0 to 100
  • QA Check changed from Ready for QA to Pass

Okay now #16225 is merged.

I rerun the script again with more values (that from emmapeel):

from weblate.trans.models import *
todos = SubProject.objects.all()

for i in todos:
    save = False
    default = {
        "committer_email": 'tails-l10n@boum.org',
        "committer_name": 'Tails translators',
        "file_format": 'po',
        "license": 'GPL v3',
        "name": i.filemask,
        "suggestion_voting": True,  # this is what makes our review
        "suggestion_autoaccept": 2, # process work by now
        "enable_suggestions": True, #
        "allow_translation_propagation": True,
        "edit_template":False,
        "report_source_bugs": 'tails-l10n@boum.org',
        "repoweb": 'https://git-tails.immerda.ch/weblate/tails/tree/%(file)s?h=%(branch)s#n%(line)s',
    }
    for key,value in default.items():
        if getattr(i,key) != value:
            print("{}[{}]: {} != {}".format(i.name,key,getattr(i,key), value))
            setattr(i,key,value)
            # save = True    # enable this only after checking once the changes
    if save:
        i.save()

#18 Updated by intrigeri 4 months ago

  • Assignee deleted (hefee)

Also available in: Atom PDF