Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[i18n_subsites] Annoying but harmless warnings #1300

Open
jorgesumle opened this issue Sep 17, 2020 · 2 comments
Open

[i18n_subsites] Annoying but harmless warnings #1300

jorgesumle opened this issue Sep 17, 2020 · 2 comments

Comments

@jorgesumle
Copy link
Contributor

An example from one of my websites:

WARNING: There are 3 original (not translated) items with slug "recargar-la-configuracion-de-bash-bashrc": 
  | /var/www/html/deponejo/Freak-Spot/content/recargar-la-configuracion-de-bash-bashrc.de.md
  | /var/www/html/deponejo/Freak-Spot/content/recargar-la-configuracion-de-bash-bashrc.md
  | /var/www/html/deponejo/Freak-Spot/content/recargar-la-configuracion-de-bash-bashrc.eo.md
@jorgesumle
Copy link
Contributor Author

jorgesumle commented Oct 4, 2020

They appear because when i18n_subsites generates a subsite that is not the main language, it thinks that it is the main language. So i18n_subsites changes what is perceived as a translation.

        # to change what is perceived as translations
        overrides['DEFAULT_LANG'] = lang

The warnings are harmless, so they could be filtered safely. However, it's seems like you cannot filter them with the LOG_FILTER setting, because the template in this case is generated by a function.

    def _warn_source_paths(msg, items, *extra):
        args = [len(items)]
        args.extend(extra)
        args.extend(x.source_path for x in items)
        logger.warning('{}: {}'.format(msg, '\n%s' * len(items)), *args)

@jorgesumle
Copy link
Contributor Author

To get rid of the warnings, you can comment the following lines from pelican/utils.py (Pelican source code):

    if len(original_items) > 1:
        _warn_source_paths('There are %s original (not translated) items %s',
                           original_items, with_str)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant