Skip to content

Commit

Permalink
Linting, removing obsolete imports
Browse files Browse the repository at this point in the history
  • Loading branch information
gogobd committed Jan 23, 2024
1 parent ca37082 commit cd0d948
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 2 additions & 0 deletions news/445.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Implement a more reasonable default for "connect translations" dialog.
[gogobd]
6 changes: 2 additions & 4 deletions src/plone/app/multilingual/browser/interfaces.py
Original file line number Diff line number Diff line change
@@ -1,32 +1,30 @@
from Acquisition import aq_parent
from plone.app.multilingual import _
from plone.app.multilingual.browser.vocabularies import untranslated_languages
from plone.app.multilingual.interfaces import ITranslationManager
from plone.app.z3cform.widget import RelatedItemsFieldWidget
from plone.autoform import directives
from plone.autoform.interfaces import IFormFieldProvider
from plone.base.interfaces import IPloneSiteRoot
from plone.supermodel import model
from z3c.relationfield.schema import RelationChoice
from zope import interface
from zope import schema
from zope.browsermenu.interfaces import IBrowserMenu
from zope.browsermenu.interfaces import IBrowserSubMenuItem
from zope.component.hooks import getSite
from zope.interface import provider
from zope.schema.interfaces import IContextAwareDefaultFactory


def make_relation_root_path(context):
current_object = context
target_language = context.REQUEST.get('language')
target_language = context.REQUEST.get("language")
closest_translation = None
while closest_translation is None:
current_object = current_object.aq_parent
tm = ITranslationManager(current_object)
closest_translation = tm.get_translation(target_language)
return "/".join(closest_translation.getPhysicalPath())


class IMultilingualLayer(interface.Interface):
"""browser layer"""

Expand Down

0 comments on commit cd0d948

Please sign in to comment.