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 translations_path #2521

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions flask_admin/babel.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,16 @@ class CustomDomain(Domain):
def __init__(self):
super(CustomDomain, self).__init__(translations.__path__[0], domain='admin')

def get_translations_path(self, ctx):
@property
def translation_directories(self):
view = get_current_view()

if view is not None:
dirname = view.admin.translations_path
if dirname is not None:
return dirname
return [dirname] + super().translation_directories

return super(CustomDomain, self).get_translations_path(ctx)
return super().translation_directories

domain = CustomDomain()

Expand Down