Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
flask-admin
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Python-Dev
flask-admin
Commits
3c6b7a87
Commit
3c6b7a87
authored
Jul 01, 2015
by
Serge S. Koval
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed #922 - Support category localization
parent
e3abe658
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
base.py
flask_admin/base.py
+5
-3
No files found.
flask_admin/base.py
View file @
3c6b7a87
...
@@ -4,7 +4,7 @@ from functools import wraps
...
@@ -4,7 +4,7 @@ from functools import wraps
from
flask
import
Blueprint
,
current_app
,
render_template
,
abort
,
g
,
url_for
from
flask
import
Blueprint
,
current_app
,
render_template
,
abort
,
g
,
url_for
from
flask_admin
import
babel
from
flask_admin
import
babel
from
flask_admin._compat
import
with_metaclass
from
flask_admin._compat
import
with_metaclass
,
as_unicode
from
flask_admin
import
helpers
as
h
from
flask_admin
import
helpers
as
h
# For compatibility reasons import MenuLink
# For compatibility reasons import MenuLink
...
@@ -541,11 +541,13 @@ class Admin(object):
...
@@ -541,11 +541,13 @@ class Admin(object):
def
_add_menu_item
(
self
,
menu_item
,
target_category
):
def
_add_menu_item
(
self
,
menu_item
,
target_category
):
if
target_category
:
if
target_category
:
category
=
self
.
_menu_categories
.
get
(
target_category
)
cat_text
=
as_unicode
(
target_category
)
category
=
self
.
_menu_categories
.
get
(
cat_text
)
if
category
is
None
:
if
category
is
None
:
category
=
MenuCategory
(
target_category
)
category
=
MenuCategory
(
target_category
)
self
.
_menu_categories
[
target_category
]
=
category
self
.
_menu_categories
[
cat_text
]
=
category
self
.
_menu
.
append
(
category
)
self
.
_menu
.
append
(
category
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment