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

commented Jul 19, 2019

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)

tibonihoo added some commits Jul 19, 2019

Fix float representation mismatch for some locale.
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 '.'
Ensure there is a default translation pattern.
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'.
Enhance support for qtranslate titles and recent formats.
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 );

This comment has been minimized.

Copy link

commented Jul 20, 2019

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')

This comment has been minimized.

Copy link
Contributor Author

commented Jul 21, 2019

Please fix pydocstyle warnings

Sure, sorry for missing those.

Copy link

left a comment


@Kwpolska Kwpolska merged commit 041717c into getnikola:master Jul 21, 2019

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
continuous-integration/travis-ci/pr The Travis CI build passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.