From 4f7fb7369bfcf32debfbaaf61ab9265ecfa334ba Mon Sep 17 00:00:00 2001 From: Oksana Slusarenko Date: Wed, 21 Oct 2020 18:27:44 +0300 Subject: [PATCH] Add po file for Latvian and apply translations (#36) Co-authored-by: Iana Vasylieva --- scormxblock/scormxblock.py | 25 ++++- .../translations/en/LC_MESSAGES/text.mo | Bin 0 -> 489 bytes .../translations/en/LC_MESSAGES/text.po | 88 +++++++++++++++ .../translations/es_419/LC_MESSAGES/text.mo | Bin 0 -> 1120 bytes .../translations/es_419/LC_MESSAGES/text.po | 55 +++++++++ .../translations/lv/LC_MESSAGES/text.mo | Bin 0 -> 1662 bytes .../translations/lv/LC_MESSAGES/text.po | 104 ++++++++++++++++++ setup.py | 2 +- 8 files changed, 267 insertions(+), 7 deletions(-) create mode 100644 scormxblock/translations/en/LC_MESSAGES/text.mo create mode 100644 scormxblock/translations/en/LC_MESSAGES/text.po create mode 100644 scormxblock/translations/es_419/LC_MESSAGES/text.mo create mode 100644 scormxblock/translations/es_419/LC_MESSAGES/text.po create mode 100644 scormxblock/translations/lv/LC_MESSAGES/text.mo create mode 100644 scormxblock/translations/lv/LC_MESSAGES/text.po diff --git a/scormxblock/scormxblock.py b/scormxblock/scormxblock.py index c23aa841..27f2390c 100644 --- a/scormxblock/scormxblock.py +++ b/scormxblock/scormxblock.py @@ -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( @@ -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( @@ -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")) @@ -118,7 +123,11 @@ 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")) @@ -126,7 +135,11 @@ def studio_view(self, context=None): 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 diff --git a/scormxblock/translations/en/LC_MESSAGES/text.mo b/scormxblock/translations/en/LC_MESSAGES/text.mo new file mode 100644 index 0000000000000000000000000000000000000000..196d48e0834fd89cd4745db64be8d6e5d4873d72 GIT binary patch literal 489 zcma)&&rZTX5XP&~OOKvC%*BhaSV)MZqM^cqjs0gS7`?4@Th_oX*)B#BU&F`oReTl) zW74Z%=9k&SH?!aF_sP+xg*rq|ktTAC^pU+1(2#Qs~pr^Mipm8l`kPy+Nxix2)tO z<819h;6;, 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 \n" +"Language-Team: LANGUAGE \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 "" diff --git a/scormxblock/translations/es_419/LC_MESSAGES/text.mo b/scormxblock/translations/es_419/LC_MESSAGES/text.mo new file mode 100644 index 0000000000000000000000000000000000000000..2fe9a2aaf6a1eeb265161b17a596d509f697496a GIT binary patch literal 1120 zcmZXT&yN&E6vtZug;5j41UPVb2Te3=;S35{njfLr>4k|sGn<)N2wX^Q_nVo5>Z(q4 z^}zZkc=zUoa3CB!5pUk+|1j|{Q12f6*3Rs%#!9~VbXC7s?^X4;e>->b#|WbZU4k_9 z3G^!z#-Gq<&|lCw=+t|wxQpOf%&&nTf!p8?I08QfUxSyyU%;^6?_h}e1G<3u^%GHa z9vpz5gA9heAHdMdPv8W61BUv4gZIF*C!^?Na13Ir=nNF%KZM?g5Oy?9;py~x_5p~L zDC(-Z(sG|3u$s+1eObNy>S*neD*XJvOGcJVQ|rjjRZXQW8qLu<*G@@I9Ri}v+UKMU zW&Lq9X3e>$ZK-R<`&D9Y%gP!yo?a-e$yiU0b5;u`Nv0{;sa$HRbL&vf*%E0?V@%6v zx6)P?2k%OnD%4-~c~pKQl;N`S`x^&o1y5z8J$2gcFQQONdLLeM5$!np4Bd%dAs(`; zl{GQ#BwODl_fvY9j>f&=pf%#kIxqV5Ocml@GpohK#?;ywPQ;dD>5(M5(sN8#+nr6( zz9zouQ0IEwzKZ8|8-ZfP3l%nB$30Gyk?0RaH=zf^xZk_{WH?A$nXJ8-IB9Avy>&5d z?`9bdl733J(tgs*?k3&tC>@XQAk@qnIb$(lS;mwlgZsOoHSF0=5&5mPY;`-^g zog1xwub&>DvU8=~+Oo#u8;Hq%h3-AS^k2gZ%G{)UE?v$3_U>d`Y#zsj=BDgKYI0jB zGmB|+Px)4qXx}(V1yd!Bms-n}YZ8;s?f;htw%o&a#ho-#tM6rDk%xS)JyW@S2UFSO zJ@uih@P&x~WvU!E$_K`>RI63?k+B%23Z7DX$}L|}V, 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 \n" +"Language-Team: LANGUAGE \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" + diff --git a/scormxblock/translations/lv/LC_MESSAGES/text.mo b/scormxblock/translations/lv/LC_MESSAGES/text.mo new file mode 100644 index 0000000000000000000000000000000000000000..97835fb4ee84e6cbf36fd3be4cdee7e32a2e6b26 GIT binary patch literal 1662 zcmaKrzi%T&6vr0`zYNF0fkeR}y%SvS4zgkGL=YTVQSc=Ykp%1F%OQk>=DcHP;@z2L ze)y6!C=DG|L_ve(f-2Q@NSr9px`&Pm3jPEnC}{Z3uI)>N#7OJUyxF(!ec$t&-!9F3 z9bmnL=Q5rLcwWWx=_B~T`Wbuz`~|Flzk)AhR`|m+t z$4{Ww`8)Uu_$NrAg z1sA|3=KfYg2;ql*j&5&C3&g+{jlo_A}MX!B7{PO>Y z*Z!P0CacM0hbKYPY0afg4(q{9VX}lB(g$4h_AFh`4sJ}(wpq%j#vKvcz4PxS-cwg; zvU|c%s$!S$VC_Iy>bfK$)6tyEV4Wp~2kU1}#<^6NL|6M9n@aUbNZQ=m30e$ktU^qV zqnIC1#(I8>cuJ?#6-ctf2Ka%^<6ws;ykn_IgMg)&j!H8nQ6t?GkRp{O%{yESI5Cng zO4g}zi)TvPaLe>W9KPpzCTuGlw?1lzP0g8wS9p_IUZ+}Ai^Ayb za3P{-vA$Rfqs1tKV|a@XgpYR4?_KX#t<|G<-i#LDx5;GBp>uUg2A^&2R<<^_)*i~J z&PSD|k`^5b+lLvvEI+VsVHAX1rp_MIhTF#N_IkMV&`&dIx?G2AvZG=ldv#j6D{Q5e zIL(r99lbMkl38Jz#=~ww{=cl6~ zlgto9zpYD6ImhFd$0@`34)S9i<3Bt90UGkZ{xlkjv>bhr1{+6$TMQdzB9Xk0)RJND zMnC4KDGRoFCj8;4bwTUD4kjpX!&GFjnwdVc@GmY#ljjdcLvlyOwdfm03CrAMLYYYN zW88~g!tUnBHrUNiw9QX2g&RkM{3O9va6{M5h`2UK`^*<$2v;b@C>WC5u+f(s9YShh z6Jh!ettn#dyVUvO%3IQ!*0Sn)qoG4>P!J=}8A)zZ)1;4Ce$qjVe&S4if`E*K_E+X= Qp~brXXlR1W$-WiAzue`@EdT%j literal 0 HcmV?d00001 diff --git a/scormxblock/translations/lv/LC_MESSAGES/text.po b/scormxblock/translations/lv/LC_MESSAGES/text.po new file mode 100644 index 00000000..ac48e403 --- /dev/null +++ b/scormxblock/translations/lv/LC_MESSAGES/text.po @@ -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 , 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" diff --git a/setup.py b/setup.py index ad101ddf..bbb15bc1 100644 --- a/setup.py +++ b/setup.py @@ -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",