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

Fix qtranslate-x import #3275

merged 6 commits into from Jul 21, 2019


Copy link

Pull Request Checklist

  • I’ve read the guidelines for contributing.
  • I updated AUTHORS.txt and CHANGES.txt (if the change is non-trivial) and documentation (if applicable).
  • I tested my changes.


Make the import of an old wordpress blog with content generate from various generations (yes "generations"... :) ) of qtranslate plugins work smoother. Including the ability to recover translation titles (provided that the user does a little bit of hacking on wordpress side as docummented here)

Concerns image attachment medata and I observed the bug for old french
posts of mine => an exception occured because floats were saved and
exported with a ',' instead of a '.'
This fixes wordpress import error when there are translations.

- The "context" provided to get the translation candidate was the
context to generate the config file and not the actual dictionary of
options (resulting in TRANSLATIONS being a string instead of the
expected dict)

- If user forgot to provide one (with the qtranslate mode), the import
would fail for not finding any key 'TRANSLATIONS_PATTERN'.
This supports "up to" qtranslateX format for translations.

It also allows to recover the titles' translation on the condition
that the wordpress exports is made with the following specific hack
taken from qtranslate/qtranslate-xt#199 :

In wp-admin/includes/export.php change
`echo apply_filters( 'the_title_rss', $post->post_title );

`echo apply_filters( 'the_title_export', $post->post_title );
Copy link

Please fix pydocstyle warnings:

nikola/plugins/command/ in public function `get_default_translations_dict`:
        D400: First line should end with a period (not "'")
nikola/plugins/command/ in public function `modernize_qtranslate_tags`:
        D205: 1 blank line required between summary line and description (found 0)
nikola/plugins/command/ in public function `modernize_qtranslate_tags`:
        D400: First line should end with a period (not 's')

Copy link
Contributor Author

Please fix pydocstyle warnings

Sure, sorry for missing those.

Copy link

@Kwpolska Kwpolska left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


@Kwpolska Kwpolska merged commit 041717c into getnikola:master Jul 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

None yet

2 participants