Skip to content

Commit

Permalink
Merge pull request #50 from plone/maurits-canonical-translation
Browse files Browse the repository at this point in the history
Fix traceback when translation group does not have the default language.
  • Loading branch information
mauritsvanrees authored Jan 31, 2025
2 parents ba480e3 + 795f060 commit 49174f8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions news/50.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix traceback when translation group does not have the default language.
@mauritsvanrees
2 changes: 1 addition & 1 deletion src/plone/exportimport/utils/translations.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def _get_all_translation_groups(portal_catalog: CatalogTool) -> Tuple[str]:


def _prepare_translation_group(default_language: str, translations: dict) -> dict:
canonical = translations.pop(default_language)
canonical = translations.pop(default_language, None)
if not canonical:
first_key = [key for key in translations][0]
canonical = translations.pop(first_key)
Expand Down

0 comments on commit 49174f8

Please sign in to comment.