~knitzsche/+junk/lp-l10n-stats

« back to all changes in this revision

Viewing changes to ul10n_stats/ul10n_stats_calc.py

  • Committer: David Planella
  • Date: 2010-09-26 10:31:51 UTC
  • Revision ID: david.planella@ubuntu.com-20100926103151-xiqut7f8kli1renz
Theme updated to Ubuntu light

Other changes:

* Added the translated percentage setting to define which languages we consider
  translated and want to show on the first pagination page on the report.
* Made symlinks in the reports folder relative.

Show diffs side-by-side

added added

removed removed

Lines of Context:
100
100
    variables['gen_date'] = gen_date
101
101
 
102
102
    f = codecs.open(report_filename, 'w', 'utf-8')
103
 
    f.write(html_report_template.page_template % variables)
 
103
    f.write(html_report_template.ubuntu_template % variables)
104
104
    f.close()
105
105
 
106
106
 
111
111
 
112
112
    # set up some vars
113
113
    pkg_stats = options.pkg_stats
 
114
    translated_percent = int(settings['translated_percent'])
114
115
 
115
116
    TOTAL = 0
116
117
    working_templates = set()
148
149
            total = int(total.strip())
149
150
 
150
151
            if (pkg, domain) in working_templates and lang in lang_names:
151
 
                addToLanguage(lang, translated, total)
 
152
                addToLanguage(stats, lang, translated, total)
152
153
            #print >> sys.stderr, "%(lang)s, %(trans)d, %(total)d " \
153
154
            #    % {'lang': lang, 'trans': translated, 'total':total}
154
155
 
172
173
                "language": lang_names[lang],
173
174
                "translated": int(percent)
174
175
                })
175
 
        if percent > 0:
 
176
        if percent >= translated_percent:
176
177
            translated_langs.append(lang_names[lang])
177
178
 
178
179
    translated_langs.sort()