'Get the percentages of translated strings per module for
the given language code.
@param lang_code: the language code'

@classmethod
def get_translation_percentages(cls, lang_code):

    pickle_file = os.path.join(current.request.folder, 'uploads', 'temp.pkl')
    if (not os.path.exists(pickle_file)):
        cls.create_master_file()
    db = current.db
    ptable = current.s3db.translate_percentage
    query = (ptable.code == lang_code)
    fields = ('dirty', 'translated', 'untranslated', 'module')
    rows = db(query).select(*fields)
    if ((not rows) or rows.first().dirty):
        cls.update_string_counts(lang_code)
        rows = db(query).select(*fields)
    percentage = {}
    total_strings = 0
    total_translated = 0
    total_untranslated = 0
    for row in rows:
        num_translated = row.translated
        num_untranslated = row.untranslated
        total_strings += (num_translated + num_untranslated)
        if (not num_untranslated):
            percentage[row.module] = 100
        else:
            total = (num_translated + num_untranslated)
            total_translated += num_translated
            total_untranslated += num_untranslated
            percentage[row.module] = round(((float(num_translated) / total) * 100), 2)
    if (not total_untranslated):
        percentage['complete_file'] = 100
    else:
        percentage['complete_file'] = round(((float(total_translated) / total_strings) * 100), 2)
    return percentage
