Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

Commit

Permalink
Add po file for Latvian and apply translations (#36)
Browse files Browse the repository at this point in the history
Co-authored-by: Iana Vasylieva <[email protected]>
  • Loading branch information
oksana-slu and Iana Vasylieva authored Oct 21, 2020
1 parent b988875 commit 4f7fb73
Show file tree
Hide file tree
Showing 8 changed files with 267 additions and 7 deletions.
25 changes: 19 additions & 6 deletions scormxblock/scormxblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,19 @@
from xblock.core import XBlock
from xblock.fields import Scope, String, Float, Boolean, Dict, DateTime, Integer
from xblock.fragment import Fragment

from xblockutils.resources import ResourceLoader


# Make '_' a no-op so we can scrape strings
_ = lambda text: text

loader = ResourceLoader(__name__)
log = logging.getLogger(__name__)

SCORM_ROOT = os.path.join(settings.MEDIA_ROOT, 'scorm')
SCORM_URL = os.path.join(settings.MEDIA_URL, 'scorm')


@XBlock.needs('i18n')
class ScormXBlock(XBlock):

display_name = String(
Expand Down Expand Up @@ -87,7 +88,7 @@ class ScormXBlock(XBlock):
)
width = Integer(
display_name=_("Display Width (px)"),
help=_('Width of iframe, if empty, the default 100%'),
help=_('Width of iframe, if empty, the default 100'),
scope=Scope.settings
)
height = Integer(
Expand All @@ -106,7 +107,11 @@ def resource_string(self, path):

def student_view(self, context=None):
context_html = self.get_context_student()
template = self.render_template('static/html/scormxblock.html', context_html)
template = loader.render_django_template(
'static/html/scormxblock.html',
context=context_html,
i18n_service=self.runtime.service(self, 'i18n')
)
frag = Fragment(template)
frag.add_css(self.resource_string("static/css/scormxblock.css"))
frag.add_javascript(self.resource_string("static/js/src/scormxblock.js"))
Expand All @@ -118,15 +123,23 @@ def student_view(self, context=None):

def studio_view(self, context=None):
context_html = self.get_context_studio()
template = self.render_template('static/html/studio.html', context_html)
template = loader.render_django_template(
'static/html/studio.html',
context=context_html,
i18n_service=self.runtime.service(self, 'i18n')
)
frag = Fragment(template)
frag.add_css(self.resource_string("static/css/scormxblock.css"))
frag.add_javascript(self.resource_string("static/js/src/studio.js"))
frag.initialize_js('ScormStudioXBlock')
return frag

def author_view(self, context=None):
html = self.render_template("static/html/author_view.html", context)
html = loader.render_django_template(
"static/html/author_view.html",
context=context,
i18n_service=self.runtime.service(self, 'i18n')
)
frag = Fragment(html)
return frag

Expand Down
Binary file added scormxblock/translations/en/LC_MESSAGES/text.mo
Binary file not shown.
88 changes: 88 additions & 0 deletions scormxblock/translations/en/LC_MESSAGES/text.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# 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.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-10-15 17:58+0000\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"

#: scormxblock.py:38
msgid "Display Name"
msgstr ""

#: scormxblock.py:39
msgid "Display name for this module"
msgstr ""

#: scormxblock.py:44
msgid "Upload scorm file"
msgstr ""

#: scormxblock.py:48
msgid "Path to the index page in scorm file"
msgstr ""

#: scormxblock.py:80
msgid "Scored"
msgstr ""

#: scormxblock.py:81
msgid ""
"Select False if this component will not receive a numerical score from the "
"Scorm"
msgstr ""

#: scormxblock.py:90
msgid "Display Width (px)"
msgstr ""

#: scormxblock.py:91
msgid "Width of iframe, if empty, the default 100"
msgstr "Width of iframe, if empty, the default 100%"

#: scormxblock.py:95
msgid "Display Height (px)"
msgstr ""

#: scormxblock.py:96
msgid "Height of iframe"
msgstr ""

#: static/html/author_view.html:3
msgid "Look in LMS"
msgstr ""

#: static/html/scormxblock.html:8
msgid "points"
msgstr ""

#: static/html/scormxblock.html:16
msgid "Full screen"
msgstr ""

#: static/html/scormxblock.html:19
msgid "Exit full screen"
msgstr ""

#: static/html/studio.html:18
msgid "Currently:"
msgstr ""

#: static/html/studio.html:51
msgid "Save"
msgstr ""

#: static/html/studio.html:54
msgid "Cancel"
msgstr ""
Binary file not shown.
55 changes: 55 additions & 0 deletions scormxblock/translations/es_419/LC_MESSAGES/text.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# 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.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-05-31 16:02-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: es_419\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#: scormxblock.py:39
msgid "Display name for this module"
msgstr "Nombre visualizado para este módulo"

#: scormxblock.py:44
msgid "Upload scorm file"
msgstr "Subir archivo scorm"

#: scormxblock.py:57
msgid "not attempted"
msgstr "No intentado"

#: scormxblock.py:77
msgid "Select False if this component will not receive a numerical score from the Scorm"
msgstr "Seleccione Falso si este componente no recibirá una puntuación numérica del Scorm"

#: scormxblock.py:86
msgid "Display Width (px)"
msgstr "Ancho de pantalla (px)"

#: scormxblock.py:87
msgid "Width of iframe, if empty, the default 100%"
msgstr "Ancho del iframe, si está vacío, el valor predeterminado es 100%"

#: scormxblock.py:91
msgid "Display Height (px)"
msgstr "Altura de pantalla (px)"

#: scormxblock.py:92
msgid "Height of iframe"
msgstr "Altura del iframe"

#: static/html/author_view.html:3
msgid "Look in LMS"
msgstr "Ver en LMS"

Binary file added scormxblock/translations/lv/LC_MESSAGES/text.mo
Binary file not shown.
104 changes: 104 additions & 0 deletions scormxblock/translations/lv/LC_MESSAGES/text.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# 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"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-06-30 04:42-0400\n"
"PO-Revision-Date: 2020-09-30 12:07+0300\n"
"Language: lv_LV\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : "
"2);\n"
"Last-Translator: \n"
"Language-Team: \n"
"X-Generator: Poedit 2.4.1\n"

#: scormxblock/scormxblock.py:37
msgid "Display Name"
msgstr "Parādāmais vārds"

#: scormxblock/scormxblock.py:38
msgid "Display name for this module"
msgstr "Parādāmais vārds šim modulim"

#: scormxblock/scormxblock.py:43
msgid "Upload scorm file"
msgstr "Augšupielādēt scorm failu"

#: scormxblock/scormxblock.py:47
msgid "Path to the index page in scorm file"
msgstr "Ceļš uz indeksa lapu scorm failā"

#: scormxblock/scormxblock.py:79
msgid "Scored"
msgstr "Vērtēts"

#: scormxblock/scormxblock.py:80
msgid ""
"Select False if this component will not receive a numerical score from the "
"Scorm"
msgstr ""
"Izvēlēties 'Nepiekrītu', ja šis elements nesaņems skaitlisku vērtējumu no "
"Scorm"

#: scormxblock/scormxblock.py:89
msgid "Display Width (px)"
msgstr "Parādīšanas platums (px)"

#: scormxblock/scormxblock.py:90
msgid "Width of iframe, if empty, the default 100"
msgstr "iframe platums pēc noklusējuma ir 100%, ja tukšs"

#: scormxblock/scormxblock.py:94
msgid "Display Height (px)"
msgstr "Parādīšanas augstums (px)"

#: scormxblock/scormxblock.py:95
msgid "Height of iframe"
msgstr "iframe augstums"

#: scormxblock/static/html/author_view.html:3
msgid "Look in LMS"
msgstr "Apskatīt LMS"

#: scormxblock/static/html/scormxblock.html:8
msgid "points"
msgstr "punkti"

#: scormxblock/static/html/scormxblock.html:16
msgid "Full screen"
msgstr "Pilnekrāna režīms"

#: scormxblock/static/html/scormxblock.html:19
msgid "Exit full screen"
msgstr "Iziet no pilnekrāna režīma"

#: scormxblock/static/html/studio.html:18
msgid "Currently:"
msgstr "Pašlaik:"

#: scormxblock/static/html/studio.html:51
msgid "Save"
msgstr "Saglabāt"

#: scormxblock/static/html/studio.html:54
msgid "Cancel"
msgstr "Atcelt"

msgid "not attempted"
msgstr ""

msgid "unknown"
msgstr ""

msgid "True"
msgstr "Piekrītu"

msgid "False"
msgstr "Nepiekrītu"
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def package_data(pkg, roots):
'scormxblock = scormxblock:ScormXBlock',
]
},
package_data=package_data("scormxblock", ["static", "public", "locale"]),
package_data=package_data("scormxblock", ["static", "public", "translations"]),
license="Apache",
classifiers=[
"License :: OSI Approved :: Apache Software License",
Expand Down

0 comments on commit 4f7fb73

Please sign in to comment.