def METHOD_NAME(self, pkg):
    files = list(pkg.files.keys())
    files.sort()
    locales = []                      # list of locales for this packages
    webapp = False
    i18n_tags = pkg[rpm.RPMTAG_HEADERI18NTABLE] or ()
    for i in i18n_tags:
        try:
            correct = INCORRECT_LOCALES[i]
            self.output.add_info('E', pkg, 'incorrect-i18n-tag-' + correct, i)
        except KeyError:
            pass
    # as some webapps have their files under /var/www/html, and
    # others in /usr/share or /usr/lib, the only reliable way
    # sofar to detect them is to look for an apache configuration file
    for f in files:
        if f.startswith('/etc/apache2/') or \
                f.startswith('/etc/httpd/conf.d/'):
            webapp = True
    for f in files:
        res = locale_regex.search(f)
        if res:
            locale = res.group(2)
            # checks the same locale only once
            if locale not in locales:
                locales.append(locale)
                res2 = correct_subdir_regex.search(locale)
                if not res2:
                    if locale not in EXCEPTION_DIRS:
                        self.output.add_info('E', pkg, 'incorrect-locale-subdir', f)
                else:
                    locale_name = res2.group(2)
                    try:
                        correct = INCORRECT_LOCALES[locale_name]
                        self.output.add_info('E', pkg, 'incorrect-locale-' + correct, f)
                    except KeyError:
                        pass
        res = lc_messages_regex.search(f)
        subdir = None
        if res:
            subdir = res.group(1)
            if not is_valid_lang(subdir):
                self.output.add_info('E', pkg, 'invalid-lc-messages-dir', f)
        else:
            res = man_regex.search(f)
            if res:
                subdir = res.group(1)
                if is_valid_lang(subdir):
                    subdir = None
                else:
                    self.output.add_info('E', pkg, 'invalid-locale-man-dir', f)
        if (f.endswith('.mo') or subdir) and (pkg.files[f].lang == '' and not webapp):
            self.output.add_info('W', pkg, 'file-not-in-%lang', f)
    main_dir, main_lang = ('', '')
    for f in files:
        lang = pkg.files[f].lang
        if main_lang and lang == '' and is_prefix(main_dir + '/', f):
            self.output.add_info('E', pkg, 'subfile-not-in-%lang', f)
        if main_lang != lang:
            main_dir, main_lang = f, lang
    name = pkg.name
    res = package_regex.search(name)
    if res:
        locales = 'locales-' + res.group(1)
        if locales != name and locales not in (x[0] for x in pkg.requires):
            self.output.add_info('E', pkg, 'no-dependency-on', locales)