Code review comment for lp:~ursinha/launchpad/add-translation-focus

Revision history for this message
Ursula Junque (ursinha) wrote :

= Summary =

This branch fixes bug 422056, adding a way to set translation focus of a product, as we can do with distributions.

== Proposed fix ==

Adding a field with all series of a project on its +changetranslators page.

== Implementation details ==

The implementation is simple: I've added the translation_focus field in product model and interface, and changed the primary_translatable to choose translation_focus if available (and translatable).

== Tests ==

./bin/test -vvt lp.translations.*
./bin/test -vvt lp.registry.*

== Demo and Q/A ==

Preparing:
 1) Go to a project page, such as https://launchpad.dev/alsa-utils
 2) Add another series to the project

A) Choosing non-translatable series as translation focus:
 1) Go to the translations page of the project, https://translations.launchpad.dev/alsa-utils
 2) As an admin user, you'll see the Change permissions option, choose it: https://translations.launchpad.dev/alsa-utils/+changetranslators
 3) Choose the series you just added, and save it
    Result: You should notice the message in the project translations page saying "Launchpad currently recommends translating alsa-utils trunk series", which means that it chose the development focus series because the one chosen as translation focus isn't translatable.

B) Choosing translatable series as translation focus:
 1) Add information to the series you added so it becomes translatable
    Result: You should notice the message in the project translations page saying "Launchpad currently recommends translating <the series you added>", which means that it chose the translation focus now that it's a translatable series.

C) Choosing no translation focus at all:
 1) Choose no series as translation focus
    Result: You should notice that it will recommend to translate the development focus.

= Launchpad lint =

Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.

Linting changed files:
  lib/lp/registry/configure.zcml
  lib/lp/registry/interfaces/product.py
  lib/lp/registry/stories/webservice/xx-project-registry.txt
  lib/lp/translations/browser/product.py
  lib/lp/registry/model/product.py

== Pylint notices ==

lib/lp/registry/interfaces/product.py
    593: [C0301] Line too long (83/78)
    34: [F0401] Unable to import 'lazr.enum' (No module named enum)
    72: [F0401] Unable to import 'lazr.restful.fields' (No module named restful)
    73: [F0401] Unable to import 'lazr.restful.interface' (No module named restful)
    74: [F0401] Unable to import 'lazr.restful.declarations' (No module named restful)
    778: [C0322, IProductSet.createProduct] Operator not preceded by a space
    freshmeatproject='freshmeat_project', wikiurl='wiki_url',
    ^
    downloadurl='download_url',
    sourceforgeproject='sourceforge_project',
    programminglang='programming_lang')
    @export_factory_operation(
    IProduct, ['name', 'displayname', 'title', 'summary', 'description',
    'project', 'homepageurl', 'screenshotsurl',
    'downloadurl', 'freshmeatproject', 'wikiurl',
    'sourceforgeproject', 'programminglang',
    'license_reviewed', 'licenses', 'license_info',
    'registrant'])
    @export_operation_as('new_project')
    def createProduct(owner, name, displayname, title, summary,
    description=None, project=None, homepageurl=None,
    screenshotsurl=None, wikiurl=None,
    downloadurl=None, freshmeatproject=None,
    sourceforgeproject=None, programminglang=None,
    license_reviewed=False, mugshot=None, logo=None,
    icon=None, licenses=None, license_info=None,
    registrant=None):

lib/lp/registry/model/product.py
    28: [F0401] Unable to import 'lazr.delegates' (No module named delegates)

« Back to merge proposal