Skip to content

Commit

Permalink
mark strings for translation (openedx#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
msaqib52 authored and pomegranited committed Feb 23, 2018
1 parent ee25af5 commit a92a7be
Show file tree
Hide file tree
Showing 7 changed files with 248 additions and 24 deletions.
14 changes: 7 additions & 7 deletions image_explorer/image_explorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

from StringIO import StringIO

from .utils import loader, AttrDict
from .utils import loader, AttrDict, _

log = logging.getLogger(__name__)

Expand All @@ -23,25 +23,25 @@ class ImageExplorerBlock(XBlock): # pylint: disable=no-init
XBlock that renders an image with tooltips
"""
display_name = String(
display_name="Display Name",
help="This name appears in the horizontal navigation at the top of the page.",
display_name=_("Display Name"),
help=_("This name appears in the horizontal navigation at the top of the page."),
scope=Scope.settings,
default="Image Explorer"
default=_("Image Explorer")
)

_hotspot_coordinates_centered = Boolean(
display_name="Hot Spots Coordinates Centered",
display_name=_("Hot Spots Coordinates Centered"),
scope=Scope.settings,
default=False,
)

opened_hotspots = List(
help="Store hotspots opened by student, for completion",
help=_("Store hotspots opened by student, for completion"),
default=[],
scope=Scope.user_state,
)

data = String(help="XML contents to display for this module", scope=Scope.content, default=textwrap.dedent("""\
data = String(help=_("XML contents to display for this module"), scope=Scope.content, default=textwrap.dedent("""\
<image_explorer schema_version='2'>
<background src="//upload.wikimedia.org/wikipedia/commons/thumb/a/ac/MIT_Dome_night1_Edit.jpg/800px-MIT_Dome_night1_Edit.jpg" />
<description>
Expand Down
2 changes: 1 addition & 1 deletion image_explorer/templates/html/image_explorer_edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<ul class="list-input settings-list">
<li class="field comp-setting-entry is-set">
<div class="wrapper-comp-setting">
<label class="label setting-label" for="edit_display_name">Title</label>
<label class="label setting-label" for="edit_display_name">{% trans "Title" %}</label>
<input class="input setting-input edit-display-name" id="edit_display_name" value="{{ self.display_name }}" type="text">
</div>
<span class="tip setting-help">{% trans "The title of the Image Explorer that is displayed to the user" %}</span>
Expand Down
66 changes: 65 additions & 1 deletion image_explorer/translations/ar/LC_MESSAGES/text.po
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#
#
# Translators:
# shefaa abu jabel <[email protected]>, 2016
msgid ""
Expand All @@ -14,6 +14,70 @@ msgstr ""
"Language: ar\n"
"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n"

#: image_explorer/image_explorer.py
msgid "Display Name"
msgstr ""

#: image_explorer/image_explorer.py
msgid "This name appears in the horizontal navigation at the top of the page."
msgstr ""

#: image_explorer/image_explorer.py
msgid "Image Explorer"
msgstr ""

#: image_explorer/image_explorer.py
msgid "Hot Spots Coordinates Centered"
msgstr ""

#: image_explorer/image_explorer.py
msgid "Store hotspots opened by student, for completion"
msgstr ""

#: image_explorer/image_explorer.py
msgid "XML contents to display for this module"
msgstr ""

#: image_explorer.py:128
msgid "Missing event_type in JSON data"
msgstr "نوع الحدث ناقص في بيانات JSON"

#: image_explorer/templates/html/image_explorer_edit.html
msgid "Title"
msgstr ""

#: image_explorer/templates/html/image_explorer_edit.html
msgid "The title of the Image Explorer that is displayed to the user"
msgstr ""

#: image_explorer/templates/html/image_explorer_edit.html
msgid "Hotspot coordinates centered"
msgstr ""

#: image_explorer/templates/html/image_explorer_edit.html
msgid ""
"If set to true, hotspot coordinates interpreted to point to the center of "
"the hotspot"
msgstr ""

#: image_explorer/templates/html/image_explorer_edit.html
msgid ""
"If set to false, assumed to point to the top left corner of the hotspot "
"image"
msgstr ""

#: image_explorer/templates/html/image_explorer_edit.html
msgid "Definition"
msgstr ""

#: image_explorer/templates/html/image_explorer_edit.html
msgid "The XML definition for the Image Explorer"
msgstr ""

#: image_explorer/templates/html/image_explorer_edit.html
msgid "Save"
msgstr ""

#: image_explorer/templates/html/image_explorer_edit.html
msgid "Cancel"
msgstr ""
85 changes: 77 additions & 8 deletions image_explorer/translations/en/LC_MESSAGES/text.po
Original file line number Diff line number Diff line change
@@ -1,16 +1,85 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: 2016-05-25 15:49+0500\n"
"PO-Revision-Date: 2016-05-25 15:49+0500\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: en\n"
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-02-07 15:42+0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#: image_explorer.py:128
#: image_explorer/image_explorer.py
msgid "Display Name"
msgstr ""

#: image_explorer/image_explorer.py
msgid "This name appears in the horizontal navigation at the top of the page."
msgstr ""

#: image_explorer/image_explorer.py
msgid "Image Explorer"
msgstr ""

#: image_explorer/image_explorer.py
msgid "Hot Spots Coordinates Centered"
msgstr ""

#: image_explorer/image_explorer.py
msgid "Store hotspots opened by student, for completion"
msgstr ""

#: image_explorer/image_explorer.py
msgid "XML contents to display for this module"
msgstr ""

#: image_explorer/image_explorer.py
msgid "Missing event_type in JSON data"
msgstr ""

#: image_explorer/templates/html/image_explorer_edit.html
msgid "Title"
msgstr ""

#: image_explorer/templates/html/image_explorer_edit.html
msgid "The title of the Image Explorer that is displayed to the user"
msgstr ""

#: image_explorer/templates/html/image_explorer_edit.html
msgid "Hotspot coordinates centered"
msgstr ""

#: image_explorer/templates/html/image_explorer_edit.html
msgid ""
"If set to true, hotspot coordinates interpreted to point to the center of "
"the hotspot"
msgstr ""

#: image_explorer/templates/html/image_explorer_edit.html
msgid ""
"If set to false, assumed to point to the top left corner of the hotspot "
"image"
msgstr ""

#: image_explorer/templates/html/image_explorer_edit.html
msgid "Definition"
msgstr ""

#: image_explorer/templates/html/image_explorer_edit.html
msgid "The XML definition for the Image Explorer"
msgstr ""

#: image_explorer/templates/html/image_explorer_edit.html
msgid "Save"
msgstr ""

#: image_explorer/templates/html/image_explorer_edit.html
msgid "Cancel"
msgstr ""
Binary file not shown.
98 changes: 91 additions & 7 deletions image_explorer/translations/eo/LC_MESSAGES/text.po
Original file line number Diff line number Diff line change
@@ -1,16 +1,100 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: 2016-05-25 15:49+0500\n"
"PO-Revision-Date: 2016-05-25 15:49+0500\n"
"Last-Translator: \n"
"Language-Team: \n"
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-02-07 15:42+0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"Language: eo\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#: image_explorer.py:128
#: image_explorer/image_explorer.py
msgid "Display Name"
msgstr "Dïspläý Nämé Ⱡ'σяєм ιρѕυм ∂σłσя ѕ#"

#: image_explorer/image_explorer.py
msgid "This name appears in the horizontal navigation at the top of the page."
msgstr ""
"Thïs nämé äppéärs ïn thé hörïzöntäl nävïgätïön ät thé töp öf thé pägé. "
"Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмєт, ¢σηѕє¢тєтυя #"

#: image_explorer/image_explorer.py
msgid "Image Explorer"
msgstr "Ìmägé Éxplörér Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт#"

#: image_explorer/image_explorer.py
msgid "Hot Spots Coordinates Centered"
msgstr "Höt Spöts Çöördïnätés Çéntéréd Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмєт, ¢σηѕє¢т#"

#: image_explorer/image_explorer.py
msgid "Store hotspots opened by student, for completion"
msgstr ""
"Störé hötspöts öpénéd ßý stüdént, för çömplétïön Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт "
"αмєт, ¢σηѕє¢тєтυя α#"

#: image_explorer/image_explorer.py
msgid "XML contents to display for this module"
msgstr ""
"XML çönténts tö dïspläý för thïs mödülé Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмєт, "
"¢σηѕє¢тєтυя#"

#: image_explorer/image_explorer.py
msgid "Missing event_type in JSON data"
msgstr "Mïssmïng évént_typé ïn JSÖN dätä Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмєт, ¢σηѕє¢#"
msgstr "Mïssïng évént_týpé ïn JSÖN dätä Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмєт, ¢σηѕє¢т#"

#: image_explorer/templates/html/image_explorer_edit.html
msgid "Title"
msgstr "Tïtlé Ⱡ'σяєм ιρѕ#"

#: image_explorer/templates/html/image_explorer_edit.html
msgid "The title of the Image Explorer that is displayed to the user"
msgstr ""
"Thé tïtlé öf thé Ìmägé Éxplörér thät ïs dïspläýéd tö thé üsér Ⱡ'σяєм ιρѕυм "
"∂σłσя ѕιт αмєт, ¢σηѕє¢тєтυя α#"

#: image_explorer/templates/html/image_explorer_edit.html
msgid "Hotspot coordinates centered"
msgstr "Hötspöt çöördïnätés çéntéréd Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмєт, ¢σηѕє¢#"

#: image_explorer/templates/html/image_explorer_edit.html
msgid ""
"If set to true, hotspot coordinates interpreted to point to the center of "
"the hotspot"
msgstr ""
"Ìf sét tö trüé, hötspöt çöördïnätés ïntérprétéd tö pöïnt tö thé çéntér öf "
"thé hötspöt Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмєт, ¢σηѕє¢#"

#: image_explorer/templates/html/image_explorer_edit.html
msgid ""
"If set to false, assumed to point to the top left corner of the hotspot "
"image"
msgstr ""
"Ìf sét tö fälsé, ässüméd tö pöïnt tö thé töp léft çörnér öf thé hötspöt "
"ïmägé Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмєт, ¢σηѕє¢тєт#"

#: image_explorer/templates/html/image_explorer_edit.html
msgid "Definition"
msgstr "Défïnïtïön Ⱡ'σяєм ιρѕυм ∂σłσ#"

#: image_explorer/templates/html/image_explorer_edit.html
msgid "The XML definition for the Image Explorer"
msgstr ""
"Thé XML défïnïtïön för thé Ìmägé Éxplörér Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмєт, "
"¢σηѕє¢тєтυя #"

#: image_explorer/templates/html/image_explorer_edit.html
msgid "Save"
msgstr "Sävé Ⱡ'σяєм ι#"

#: image_explorer/templates/html/image_explorer_edit.html
msgid "Cancel"
msgstr "Çänçél Ⱡ'σяєм ιρѕυ#"
7 changes: 7 additions & 0 deletions image_explorer/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@
loader = ResourceLoader(__name__)


def _(text):
"""
Dummy `gettext` replacement to make string extraction tools scrape strings marked for translation
"""
return text


class AttrDict(dict):
def __init__(self, *args, **kwargs):
super(AttrDict, self).__init__(*args, **kwargs)
Expand Down

0 comments on commit a92a7be

Please sign in to comment.