Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xblock-utils
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
xblock-utils
Commits
ca86d73b
Commit
ca86d73b
authored
Mar 20, 2015
by
Braden MacDonald
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Translate XBlock field display_name and help strings
parent
c21aa4c0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
xblockutils/studio_editable.py
+3
-2
No files found.
xblockutils/studio_editable.py
View file @
ca86d73b
...
@@ -13,6 +13,7 @@ StudioEditableXBlockMixin to your XBlock.
...
@@ -13,6 +13,7 @@ StudioEditableXBlockMixin to your XBlock.
import
json
import
json
import
logging
import
logging
from
django.utils.translation
import
ugettext
from
xblock.core
import
XBlock
from
xblock.core
import
XBlock
from
xblock.fields
import
Scope
,
JSONField
,
List
,
Integer
,
Float
,
Boolean
,
String
from
xblock.fields
import
Scope
,
JSONField
,
List
,
Integer
,
Float
,
Boolean
,
String
from
xblock.exceptions
import
JsonHandlerError
from
xblock.exceptions
import
JsonHandlerError
...
@@ -107,12 +108,12 @@ class StudioEditableXBlockMixin(object):
...
@@ -107,12 +108,12 @@ class StudioEditableXBlockMixin(object):
)
)
info
=
{
info
=
{
'name'
:
field_name
,
'name'
:
field_name
,
'display_name'
:
field
.
display_name
,
'display_name'
:
ugettext
(
field
.
display_name
)
if
field
.
display_name
else
""
,
'is_set'
:
field
.
is_set_on
(
self
),
'is_set'
:
field
.
is_set_on
(
self
),
'default'
:
field
.
default
,
'default'
:
field
.
default
,
'value'
:
field
.
read_from
(
self
),
'value'
:
field
.
read_from
(
self
),
'has_values'
:
False
,
'has_values'
:
False
,
'help'
:
field
.
help
,
'help'
:
ugettext
(
field
.
help
)
if
field
.
help
else
""
,
'allow_reset'
:
field
.
runtime_options
.
get
(
'resettable_editor'
,
True
),
'allow_reset'
:
field
.
runtime_options
.
get
(
'resettable_editor'
,
True
),
'list_values'
:
None
,
# Only available for List fields
'list_values'
:
None
,
# Only available for List fields
'has_list_values'
:
False
,
# True if list_values_provider exists, even if it returned no available options
'has_list_values'
:
False
,
# True if list_values_provider exists, even if it returned no available options
...
...
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