Add a new metric "translations"

Registered by Ying Chun Guo

Translators contributions are another kind of important contributions. So it is needed to add translators contributions as a metric to stackalytics.

The new translation tool - Zanata - has plan to support APIs to query individual translator statistics, ref to https://bugzilla.redhat.com/show_bug.cgi?id=1092193. We could figure out how to add these data to stackalytics.

Blueprint information

Status:
Not started
Approver:
Ilya Shakhat
Priority:
Medium
Drafter:
Ying Chun Guo
Direction:
Approved
Assignee:
Ilya Alekseyev
Definition:
Approved
Series goal:
None
Implementation:
Unknown
Milestone target:
None

Related branches

Sprints

Whiteboard

Spec: https://docs.google.com/document/d/1veum4qVbe_w62oYR1S4BZd6YXW9gbqkiwwPqHtNg6zU
Test project: https://translate-dev.openstack.org/project/view/test

Zanata API tasks:
    - https://zanata.atlassian.net/browse/ZNTA-742
    - https://zanata.atlassian.net/browse/ZNTA-743
    - https://zanata.atlassian.net/browse/ZNTA-744

1. Data retrieval

* In Stackalytics all data is stored as records. Every record has a list of mandantory fields, which values are used for aggregations. Mandatory fields: user-id, date, module, record_type, primary_key. User can be specified by email or Launchpad id or Gerrit id. If we introduce a new type of id there should be a way to convert it to one of existing.
* The data retrieval module should query Zanata for the data and convert it into records. For example API may provide a list of translated strings in the specified project during the specified period of time.
* There is two types of records: translation and translation review
* Translation and translation review metrics should be in words
* Stackalytics refers to projects by their git names (organization/module). If projects are set in Zanata differently then default-data schema will need to be updated.
* Release is mapped automatically by data period. However if Zanata can provide this the release can be stored in the corresponding field in record.
* Language is stored as separate field in the record.

2. UI

* Translations is added in the list of metrics.
* Language break-down chart is added on all summary screens. It shows the usual round chart and a table. User may choose a language from the table, in this case it becomes active and all further stats are shown for this particular language.
* Selected language is exposed in URI and shown in text block in the right column.
* Translation stats should be visible in the activity log.
* Translation stats should be visible in contribution summary block.

(?)

Work Items

Work items:
1. Make sure that Zanata API for translators list is ready: TODO
2. Read data from Zanata API and convert it into Stackalytics records: INPROGRESS
3. UI: TODO

This blueprint contains Public information 
Everyone can see this information.