Fix plugins for multi languages #82
Merged
Conversation
We could just check if the metadata fields match the new syntax. Adding that and merging. |
The plugin was not migrating the metadata for non default languages, this patch fixes that.
Please do not squash commits! |
@Kwpolska sorry I was to remove the unused ext var |
I would have fixed that, too. |
Kwpolska
added a commit
that referenced
this pull request
May 21, 2015
if lang == post.default_lang or len(post.translated_to) == 1: | ||
fname = post.metadata_path | ||
else: | ||
fname = self.site.config['TRANSLATIONS_PATTERN'].format(path=post.post_name, lang=lang, ext='meta') |
Kwpolska
May 21, 2015
Member
It’s better to use os.path.splitext(post.translated_source_path(lang))
— this is more-or-less what post.py
does to find the meta files. Fixed on master.
It’s better to use os.path.splitext(post.translated_source_path(lang))
— this is more-or-less what post.py
does to find the meta files. Fixed on master.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
The plugin was not migrating the metadata for non default languages, this patch fixes that.
Note: this plugin is not idenpotent if you have a post with default language in new metadata style, and a translation in the old style.