[translations] generating missing strings (#3577)
This commit is contained in:
parent
e95132ddc3
commit
e9804aedff
|
|
@ -344,10 +344,6 @@ navigation bar.
|
|||
'zh': {'flag': 'cn', 'name': 'Chinese'},
|
||||
}
|
||||
|
||||
We need to extract the string to be translated, run the following command:
|
||||
|
||||
pybabel extract -F ./babel/babel.cfg -k _ -k __ -k t -k tn -k tct -o ./babel/messages.pot .
|
||||
|
||||
As per the [Flask AppBuilder documentation] about translation, to create a
|
||||
new language dictionary, run the following command:
|
||||
|
||||
|
|
@ -356,7 +352,7 @@ new language dictionary, run the following command:
|
|||
Then it's a matter of running the statement below to gather all strings that
|
||||
need translation
|
||||
|
||||
fabmanager babel-extract --target superset/translations/
|
||||
fabmanager babel-extract --target superset/translations/ -k _ -k __ -k t -k tn -k tct
|
||||
|
||||
You can then translate the strings gathered in files located under
|
||||
`superset/translation`, where there's one per language. For the translations
|
||||
|
|
|
|||
1384
babel/messages.pot
1384
babel/messages.pot
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because it is too large
Load Diff
|
|
@ -2285,14 +2285,16 @@ class Superset(BaseSupersetView):
|
|||
for role in user.roles:
|
||||
perms = set()
|
||||
for perm in role.permissions:
|
||||
perms.add(
|
||||
(perm.permission.name, perm.view_menu.name)
|
||||
)
|
||||
if perm.permission.name in ('datasource_access', 'database_access'):
|
||||
permissions[perm.permission.name].add(perm.view_menu.name)
|
||||
if perm.permission and perm.view_menu:
|
||||
perms.add(
|
||||
(perm.permission.name, perm.view_menu.name)
|
||||
)
|
||||
if perm.permission.name in ('datasource_access', 'database_access'):
|
||||
permissions[perm.permission.name].add(perm.view_menu.name)
|
||||
roles[role.name] = [
|
||||
[perm.permission.name, perm.view_menu.name]
|
||||
for perm in role.permissions
|
||||
if perm.permission and perm.view_menu
|
||||
]
|
||||
payload = {
|
||||
'user': {
|
||||
|
|
|
|||
Loading…
Reference in New Issue