diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9a39fbc5..42de6b4d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,7 +16,7 @@ jobs: uses: actions/checkout@v2 - name: install pip - run: | + run: | apt update -qq apt install -y python3-pip pip3 --version @@ -34,8 +34,12 @@ jobs: pip install -qr requirements/dev.txt pip install -qr requirements/local.txt + - name: Setup dependencies + run: | + pip install xblock-utils==3.4.1 + - name: setup h5p xblock - run: | + run: | pip install . - name: Run xblock workbench diff --git a/.gitignore b/.gitignore index 09641ff1..aab68264 100644 --- a/.gitignore +++ b/.gitignore @@ -54,7 +54,6 @@ coverage.xml .pytest_cache/ # Translations -*.mo *.pot # Django stuff: diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..0faefef3 --- /dev/null +++ b/Makefile @@ -0,0 +1,21 @@ +PACKAGE_NAME := h5pxblock +EXTRACT_DIR := $(PACKAGE_NAME)/locale/en/LC_MESSAGES +EXTRACTED_DJANGO := $(EXTRACT_DIR)/django-partial.po +EXTRACTED_DJANGOJS := $(EXTRACT_DIR)/djangojs-partial.po +EXTRACTED_TEXT := $(EXTRACT_DIR)/text.po +JS_TARGET := public/js/translations +TRANSLATIONS_DIR := $(PACKAGE_NAME)/translations + +extract_translations: symlink_translations ## extract strings to be translated, outputting .po files + cd $(PACKAGE_NAME) && i18n_tool extract + mv $(EXTRACTED_DJANGO) $(EXTRACTED_TEXT) + if [ -f "$(EXTRACTED_DJANGOJS)" ]; then cat $(EXTRACTED_DJANGOJS) >> $(EXTRACTED_TEXT); rm $(EXTRACTED_DJANGOJS); fi + +compile_translations: symlink_translations ## compile translation files, outputting .mo files for each supported language + cd $(PACKAGE_NAME) && i18n_tool generate + +detect_changed_source_translations: + cd $(PACKAGE_NAME) && i18n_tool changed + +symlink_translations: + if [ ! -d "$(TRANSLATIONS_DIR)" ]; then ln -s locale/ $(TRANSLATIONS_DIR); fi diff --git a/README.md b/README.md index 3832cb15..df8bd4de 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ H5P Xblock provides ability to host and play H5P content in open edX. It has few more features 1. Ability to mark H5P content complete in open edX -2. Ablity to capture score of H5P content in open edX +2. Ability to capture score of H5P content in open edX 3. Save learner state which can be retrieved later 4. Ability to host H5P content on cloud storage like AWS S3 @@ -36,3 +36,12 @@ on LMS ![Preview H5P content in LMS](https://github.com/edly-io/h5pxblock/blob/master/docs/images/preview_content.png?raw=true) + +# Working with translations + +You can help by translating this project. Follow the steps below: + +1. Create a folder for the translations in `locale/`, eg: `locale/es_419/LC_MESSAGES/`, and create your `text.po` file +with all the translations. +2. Run `make compile_translations`, this will generate the `text.mo` file. +3. Create a pull request with your changes. diff --git a/h5pxblock/h5pxblock.py b/h5pxblock/h5pxblock.py index 0af52bea..0cfe3b39 100644 --- a/h5pxblock/h5pxblock.py +++ b/h5pxblock/h5pxblock.py @@ -6,7 +6,6 @@ import pkg_resources from django.conf import settings -from django.template import Context, Template from django.utils import timezone from webob import Response @@ -14,6 +13,8 @@ from xblock.core import XBlock from xblock.fields import Scope, String, Boolean, Integer, Dict, DateTime, UNIQUE_ID from xblock.fragment import Fragment +from xblockutils.resources import ResourceLoader + from h5pxblock.utils import get_h5p_storage, str2bool, unpack_and_upload_on_cloud, unpack_package_local_path @@ -21,6 +22,7 @@ _ = lambda text: text log = logging.getLogger(__name__) +loader = ResourceLoader(__name__) H5P_ROOT = os.path.join(settings.MEDIA_ROOT, "h5pxblockmedia") H5P_URL = os.path.join(settings.MEDIA_URL, "h5pxblockmedia") @@ -94,8 +96,8 @@ class H5PPlayerXBlock(XBlock, CompletableXBlockMixin): save_freq = Integer( display_name=_("User content state save frequency"), help=_( - "How often current user content state should be autosaved (in seconds). \ - Set it to zero if you don't want to save content state." + "How often current user content state should be autosaved (in seconds). " + "Set it to zero if you don't want to save content state." ), default=0, scope=Scope.settings, @@ -116,9 +118,22 @@ def resource_string(self, path): return data.decode("utf8") def render_template(self, template_path, context): - template_str = self.resource_string(template_path) - template = Template(template_str) - return template.render(Context(context)) + """ + Render a template with the given context. The template is translated + according to the user's language. + + Args: + template_path (str): The path to the template + context(dict, optional): The context to render in the template + + Returns: + str: The rendered template + """ + return loader.render_django_template( + template_path, + context, + i18n_service=self.runtime.service(self, 'i18n'), + ) @property def store_content_on_local_fs(self): diff --git a/h5pxblock/locale/__init__.py b/h5pxblock/locale/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/h5pxblock/locale/config.yaml b/h5pxblock/locale/config.yaml new file mode 100644 index 00000000..291bdddb --- /dev/null +++ b/h5pxblock/locale/config.yaml @@ -0,0 +1,93 @@ +# Configuration for i18n workflow. + +locales: + - en # English - Source Language + # - am # Amharic + - ar # Arabic + # - az # Azerbaijani + # - bg_BG # Bulgarian (Bulgaria) + # - bn_BD # Bengali (Bangladesh) + # - bn_IN # Bengali (India) + # - bs # Bosnian + # - ca # Catalan + # - ca@valencia # Catalan (Valencia) + # - cs # Czech + # - cy # Welsh + # - da # Danish + # - de_DE # German (Germany) + # - el # Greek + # - en_GB # English (United Kingdom) + # # Don't pull these until we figure out why pages randomly display in these locales, + # # when the user's browser is in English and the user is not logged in. + # #- en@lolcat # LOLCAT English + # #- en@pirate # Pirate English + - es_419 # Spanish (Latin America) + # - es_AR # Spanish (Argentina) + # - es_EC # Spanish (Ecuador) + - es_ES # Spanish (Spain) + # - es_MX # Spanish (Mexico) + # - es_PE # Spanish (Peru) + # - et_EE # Estonian (Estonia) + # - eu_ES # Basque (Spain) + # - fa # Persian + # - fa_IR # Persian (Iran) + # - fi_FI # Finnish (Finland) + # - fil # Filipino + - fr # French + # - gl # Galician + # - gu # Gujarati + - he # Hebrew + - hi # Hindi + # - hr # Croatian + # - hu # Hungarian + # - hy_AM # Armenian (Armenia) + # - id # Indonesian + # - it_IT # Italian (Italy) + # - ja_JP # Japanese (Japan) + # - kk_KZ # Kazakh (Kazakhstan) + # - km_KH # Khmer (Cambodia) + # - kn # Kannada + - ko_KR # Korean (Korea) + # - lt_LT # Lithuanian (Lithuania) + # - ml # Malayalam + # - mn # Mongolian + # - mr # Marathi + # - ms # Malay + # - nb # Norwegian Bokmål + # - ne # Nepali + # - nl_NL # Dutch (Netherlands) + # - or # Oriya + # - pl # Polish + - pt_BR # Portuguese (Brazil) + # - pt_PT # Portuguese (Portugal) + # - ro # Romanian + - ru # Russian + # - si # Sinhala + # - sk # Slovak + # - sl # Slovenian + # - sq # Albanian + # - sr # Serbian + # - sv # Swedish + # - sw # Swahili + # - ta # Tamil + # - te # Telugu + # - th # Thai + # - tr_TR # Turkish (Turkey) + # - uk # Ukranian + # - ur # Urdu + # - uz # Uzbek + # - vi # Vietnamese + - zh_CN # Chinese (China) + # - zh_HK # Chinese (Hong Kong) + # - zh_TW # Chinese (Taiwan) + + +# The locales used for fake-accented English, for testing. +dummy_locales: + - eo + - rtl # Fake testing language for Arabic + +# Directories we don't search for strings. +ignore_dirs: + - '*/css' + - 'public/js/translations' diff --git a/h5pxblock/locale/en/LC_MESSAGES/text.mo b/h5pxblock/locale/en/LC_MESSAGES/text.mo new file mode 100644 index 00000000..06cd654b Binary files /dev/null and b/h5pxblock/locale/en/LC_MESSAGES/text.mo differ diff --git a/h5pxblock/locale/en/LC_MESSAGES/text.po b/h5pxblock/locale/en/LC_MESSAGES/text.po new file mode 100644 index 00000000..a15f2575 --- /dev/null +++ b/h5pxblock/locale/en/LC_MESSAGES/text.po @@ -0,0 +1,172 @@ +# 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. +# +# Translators: +# Bryann Valderrama , 2023 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-08-17 11:22-0500\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: Bryann Valderrama \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" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: h5pxblock.py:40 +msgid "H5P Player Id" +msgstr "" + +#: h5pxblock.py:41 +msgid "Unique ID for player instance" +msgstr "" + +#: h5pxblock.py:47 +msgid "Display Name" +msgstr "" + +#: h5pxblock.py:48 +msgid "Display name for this module" +msgstr "" + +#: h5pxblock.py:54 h5pxblock.py:55 +msgid "Upload H5P content" +msgstr "" + +#: h5pxblock.py:60 +msgid "Show H5P player frame" +msgstr "" + +#: h5pxblock.py:61 +msgid "whether to show H5P player frame and button" +msgstr "" + +#: h5pxblock.py:67 +msgid "Show copyright button" +msgstr "" + +#: h5pxblock.py:68 +msgid "whether to show copyright button" +msgstr "" + +#: h5pxblock.py:74 +msgid "Show h5p icon" +msgstr "" + +#: h5pxblock.py:75 +msgid "whether to show h5p icon" +msgstr "" + +#: h5pxblock.py:81 +msgid "Show fullscreen button" +msgstr "" + +#: h5pxblock.py:82 +msgid "whether to show fullscreen button" +msgstr "" + +#: h5pxblock.py:88 +msgid "Is Scorable" +msgstr "" + +#: h5pxblock.py:90 +msgid "Select True if this component will save score" +msgstr "" + +#: h5pxblock.py:97 +msgid "User content state save frequency" +msgstr "" + +#: h5pxblock.py:99 +msgid "" +"How often current user content state should be autosaved (in seconds). Set " +"it to zero if you don't want to save content state." +msgstr "" + +#: h5pxblock.py:107 +msgid "User previous content interaction states" +msgstr "" + +#: h5pxblock.py:182 +msgid "Uploading" +msgstr "" + +#: h5pxblock.py:183 +msgid "Uploaded" +msgstr "" + +#: h5pxblock.py:184 +msgid "Extracting" +msgstr "" + +#: static/html/author_view.html:3 +msgid "Content can be previewed inside LMS only" +msgstr "" + +#: static/html/author_view.html:4 +msgid "" +"Please upload H5P content by clicking the \"Edit\" button if you have not " +"already uploaded it." +msgstr "" + +#: static/html/h5pxblock.html:7 +msgid "Loading..." +msgstr "" + +#: static/html/h5pxblock.html:13 +msgid "No content. Please upload H5P content." +msgstr "" + +#: static/html/studio.html:22 +msgid "Currently:" +msgstr "" + +#: static/html/studio.html:22 +msgid "Upload time:" +msgstr "" + +#: static/html/studio.html:27 +msgid "Reuse Existing H5P Content" +msgstr "" + +#: static/html/studio.html:31 +msgid "" +"Enter path of existing content or copy path to reuse this content in another " +"block" +msgstr "" + +#: static/html/studio.html:40 static/html/studio.html:57 +#: static/html/studio.html:73 static/html/studio.html:89 +#: static/html/studio.html:105 +msgid "True" +msgstr "" + +#: static/html/studio.html:40 static/html/studio.html:43 +#: static/html/studio.html:57 static/html/studio.html:60 +#: static/html/studio.html:73 static/html/studio.html:76 +#: static/html/studio.html:89 static/html/studio.html:92 +#: static/html/studio.html:105 static/html/studio.html:108 +msgid "(Default)" +msgstr "" + +#: static/html/studio.html:43 static/html/studio.html:60 +#: static/html/studio.html:76 static/html/studio.html:92 +#: static/html/studio.html:108 +msgid "False" +msgstr "" + +#: static/html/studio.html:127 +msgid "Save" +msgstr "" + +#: static/html/studio.html:130 +msgid "Cancel" +msgstr "" diff --git a/h5pxblock/locale/es_419/LC_MESSAGES/text.mo b/h5pxblock/locale/es_419/LC_MESSAGES/text.mo new file mode 100644 index 00000000..bc68228b Binary files /dev/null and b/h5pxblock/locale/es_419/LC_MESSAGES/text.mo differ diff --git a/h5pxblock/locale/es_419/LC_MESSAGES/text.po b/h5pxblock/locale/es_419/LC_MESSAGES/text.po new file mode 100644 index 00000000..91cb0de8 --- /dev/null +++ b/h5pxblock/locale/es_419/LC_MESSAGES/text.po @@ -0,0 +1,179 @@ +# 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. +# +# Translators: +# Bryann Valderrama , 2023 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-08-16 19:01-0500\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: Bryann Valderrama \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" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: h5pxblock.py:40 +msgid "H5P Player Id" +msgstr "ID del reproductor H5P" + +#: h5pxblock.py:41 +msgid "Unique ID for player instance" +msgstr "ID único para la instancia del reproductor" + +#: h5pxblock.py:47 +msgid "Display Name" +msgstr "Nombre para mostrar" + +#: h5pxblock.py:48 +msgid "Display name for this module" +msgstr "Nombre para mostrar para este módulo" + +#: h5pxblock.py:54 h5pxblock.py:55 +msgid "Upload H5P content" +msgstr "Subir contenido H5P" + +#: h5pxblock.py:60 +msgid "Show H5P player frame" +msgstr "Mostrar marco del reproductor H5P" + +#: h5pxblock.py:61 +msgid "whether to show H5P player frame and button" +msgstr "Si se debe mostrar el marco y el botón del reproductor H5P" + +#: h5pxblock.py:67 +msgid "Show copyright button" +msgstr "Mostrar botón de derechos de autor" + +#: h5pxblock.py:68 +msgid "whether to show copyright button" +msgstr "Si se debe mostrar el botón de derechos de autor" + +#: h5pxblock.py:74 +msgid "Show h5p icon" +msgstr "Mostrar icono h5p" + +#: h5pxblock.py:75 +msgid "whether to show h5p icon" +msgstr "Si se debe mostrar el icono h5p" + +#: h5pxblock.py:81 +msgid "Show fullscreen button" +msgstr "Mostrar botón de pantalla completa" + +#: h5pxblock.py:82 +msgid "whether to show fullscreen button" +msgstr "Si se debe mostrar el botón de pantalla completa" + +#: h5pxblock.py:88 +msgid "Is Scorable" +msgstr "¿Es puntuable?" + +#: h5pxblock.py:90 +msgid "Select True if this component will save score" +msgstr "Seleccione Verdadero si este componente guardará la puntuación" + +#: h5pxblock.py:97 +msgid "User content state save frequency" +msgstr "Frecuencia de guardado del estado del contenido del usuario" + +#: h5pxblock.py:99 +msgid "" +"How often current user content state should be autosaved (in seconds). Set " +"it to zero if you don't want to save content state." +msgstr "" +"Con qué frecuencia se debe guardar automáticamente el estado actual del " +"contenido del usuario (en segundos). Establézcalo en cero si no desea " +"guardar el estado del contenido." + +#: h5pxblock.py:107 +msgid "User previous content interaction states" +msgstr "Estados previos de interacción del contenido por parte del usuario" + +#: h5pxblock.py:182 +msgid "Uploading" +msgstr "Subiendo" + +#: h5pxblock.py:183 +msgid "Uploaded" +msgstr "Subido" + +#: h5pxblock.py:184 +msgid "Extracting" +msgstr "Extrayendo" + +#: static/html/author_view.html:3 +msgid "Content can be previewed inside LMS only" +msgstr "El contenido solo se puede previsualizar dentro del LMS" + +#: static/html/author_view.html:4 +msgid "" +"Please upload H5P content by clicking the \"Edit\" button if you have not " +"already uploaded it." +msgstr "" +"Por favor, si aún no lo ha hecho, cargue el contenido H5P haciendo clic en " +"el botón \"Editar\"." + +#: static/html/h5pxblock.html:7 +msgid "Loading..." +msgstr "Cargando..." + +#: static/html/h5pxblock.html:13 +msgid "No content. Please upload H5P content." +msgstr "No hay contenido. Por favor, suba contenido de H5P." + +#: static/html/studio.html:22 +msgid "Currently:" +msgstr "Actualmente:" + +#: static/html/studio.html:22 +msgid "Upload time:" +msgstr "Tiempo de subida:" + +#: static/html/studio.html:27 +msgid "Reuse Existing H5P Content" +msgstr "Reutilizar contenido H5P existente" + +#: static/html/studio.html:31 +msgid "" +"Enter path of existing content or copy path to reuse this content in another " +"block" +msgstr "" +"Introduzca la ruta del contenido existente o copie la ruta para reutilizar " +"este contenido en otro bloque" + +#: static/html/studio.html:40 static/html/studio.html:57 +#: static/html/studio.html:73 static/html/studio.html:89 +#: static/html/studio.html:105 +msgid "True" +msgstr "Verdadero" + +#: static/html/studio.html:40 static/html/studio.html:43 +#: static/html/studio.html:57 static/html/studio.html:60 +#: static/html/studio.html:73 static/html/studio.html:76 +#: static/html/studio.html:89 static/html/studio.html:92 +#: static/html/studio.html:105 static/html/studio.html:108 +msgid "(Default)" +msgstr "(Predeterminado)" + +#: static/html/studio.html:43 static/html/studio.html:60 +#: static/html/studio.html:76 static/html/studio.html:92 +#: static/html/studio.html:108 +msgid "False" +msgstr "Falso" + +#: static/html/studio.html:127 +msgid "Save" +msgstr "Guardar" + +#: static/html/studio.html:130 +msgid "Cancel" +msgstr "Cancelar" diff --git a/h5pxblock/locale/es_ES/LC_MESSAGES/text.mo b/h5pxblock/locale/es_ES/LC_MESSAGES/text.mo new file mode 100644 index 00000000..bc68228b Binary files /dev/null and b/h5pxblock/locale/es_ES/LC_MESSAGES/text.mo differ diff --git a/h5pxblock/locale/es_ES/LC_MESSAGES/text.po b/h5pxblock/locale/es_ES/LC_MESSAGES/text.po new file mode 100644 index 00000000..91cb0de8 --- /dev/null +++ b/h5pxblock/locale/es_ES/LC_MESSAGES/text.po @@ -0,0 +1,179 @@ +# 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. +# +# Translators: +# Bryann Valderrama , 2023 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-08-16 19:01-0500\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: Bryann Valderrama \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" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: h5pxblock.py:40 +msgid "H5P Player Id" +msgstr "ID del reproductor H5P" + +#: h5pxblock.py:41 +msgid "Unique ID for player instance" +msgstr "ID único para la instancia del reproductor" + +#: h5pxblock.py:47 +msgid "Display Name" +msgstr "Nombre para mostrar" + +#: h5pxblock.py:48 +msgid "Display name for this module" +msgstr "Nombre para mostrar para este módulo" + +#: h5pxblock.py:54 h5pxblock.py:55 +msgid "Upload H5P content" +msgstr "Subir contenido H5P" + +#: h5pxblock.py:60 +msgid "Show H5P player frame" +msgstr "Mostrar marco del reproductor H5P" + +#: h5pxblock.py:61 +msgid "whether to show H5P player frame and button" +msgstr "Si se debe mostrar el marco y el botón del reproductor H5P" + +#: h5pxblock.py:67 +msgid "Show copyright button" +msgstr "Mostrar botón de derechos de autor" + +#: h5pxblock.py:68 +msgid "whether to show copyright button" +msgstr "Si se debe mostrar el botón de derechos de autor" + +#: h5pxblock.py:74 +msgid "Show h5p icon" +msgstr "Mostrar icono h5p" + +#: h5pxblock.py:75 +msgid "whether to show h5p icon" +msgstr "Si se debe mostrar el icono h5p" + +#: h5pxblock.py:81 +msgid "Show fullscreen button" +msgstr "Mostrar botón de pantalla completa" + +#: h5pxblock.py:82 +msgid "whether to show fullscreen button" +msgstr "Si se debe mostrar el botón de pantalla completa" + +#: h5pxblock.py:88 +msgid "Is Scorable" +msgstr "¿Es puntuable?" + +#: h5pxblock.py:90 +msgid "Select True if this component will save score" +msgstr "Seleccione Verdadero si este componente guardará la puntuación" + +#: h5pxblock.py:97 +msgid "User content state save frequency" +msgstr "Frecuencia de guardado del estado del contenido del usuario" + +#: h5pxblock.py:99 +msgid "" +"How often current user content state should be autosaved (in seconds). Set " +"it to zero if you don't want to save content state." +msgstr "" +"Con qué frecuencia se debe guardar automáticamente el estado actual del " +"contenido del usuario (en segundos). Establézcalo en cero si no desea " +"guardar el estado del contenido." + +#: h5pxblock.py:107 +msgid "User previous content interaction states" +msgstr "Estados previos de interacción del contenido por parte del usuario" + +#: h5pxblock.py:182 +msgid "Uploading" +msgstr "Subiendo" + +#: h5pxblock.py:183 +msgid "Uploaded" +msgstr "Subido" + +#: h5pxblock.py:184 +msgid "Extracting" +msgstr "Extrayendo" + +#: static/html/author_view.html:3 +msgid "Content can be previewed inside LMS only" +msgstr "El contenido solo se puede previsualizar dentro del LMS" + +#: static/html/author_view.html:4 +msgid "" +"Please upload H5P content by clicking the \"Edit\" button if you have not " +"already uploaded it." +msgstr "" +"Por favor, si aún no lo ha hecho, cargue el contenido H5P haciendo clic en " +"el botón \"Editar\"." + +#: static/html/h5pxblock.html:7 +msgid "Loading..." +msgstr "Cargando..." + +#: static/html/h5pxblock.html:13 +msgid "No content. Please upload H5P content." +msgstr "No hay contenido. Por favor, suba contenido de H5P." + +#: static/html/studio.html:22 +msgid "Currently:" +msgstr "Actualmente:" + +#: static/html/studio.html:22 +msgid "Upload time:" +msgstr "Tiempo de subida:" + +#: static/html/studio.html:27 +msgid "Reuse Existing H5P Content" +msgstr "Reutilizar contenido H5P existente" + +#: static/html/studio.html:31 +msgid "" +"Enter path of existing content or copy path to reuse this content in another " +"block" +msgstr "" +"Introduzca la ruta del contenido existente o copie la ruta para reutilizar " +"este contenido en otro bloque" + +#: static/html/studio.html:40 static/html/studio.html:57 +#: static/html/studio.html:73 static/html/studio.html:89 +#: static/html/studio.html:105 +msgid "True" +msgstr "Verdadero" + +#: static/html/studio.html:40 static/html/studio.html:43 +#: static/html/studio.html:57 static/html/studio.html:60 +#: static/html/studio.html:73 static/html/studio.html:76 +#: static/html/studio.html:89 static/html/studio.html:92 +#: static/html/studio.html:105 static/html/studio.html:108 +msgid "(Default)" +msgstr "(Predeterminado)" + +#: static/html/studio.html:43 static/html/studio.html:60 +#: static/html/studio.html:76 static/html/studio.html:92 +#: static/html/studio.html:108 +msgid "False" +msgstr "Falso" + +#: static/html/studio.html:127 +msgid "Save" +msgstr "Guardar" + +#: static/html/studio.html:130 +msgid "Cancel" +msgstr "Cancelar" diff --git a/h5pxblock/static/html/h5pxblock.html b/h5pxblock/static/html/h5pxblock.html index 586267d8..c40e000e 100644 --- a/h5pxblock/static/html/h5pxblock.html +++ b/h5pxblock/static/html/h5pxblock.html @@ -1,12 +1,14 @@ +{% load i18n %} + {% if h5pblock.h5p_content_json_path %}
- Loading... + {% trans "Loading..." %}
-
+
{% else %} -

No content. Please upload H5P content.

+

{% trans "No content. Please upload H5P content." %}

{% endif %} diff --git a/h5pxblock/static/html/studio.html b/h5pxblock/static/html/studio.html index 265a7e8b..17c520e4 100644 --- a/h5pxblock/static/html/studio.html +++ b/h5pxblock/static/html/studio.html @@ -37,10 +37,10 @@ id="xb_field_edit_show_frame" > @@ -54,10 +54,10 @@ id="xb_field_edit_show_copyright" > @@ -70,10 +70,10 @@ id="xb_field_edit_show_h5p" > @@ -86,10 +86,10 @@ id="xb_field_edit_show_fullscreen" > @@ -102,10 +102,10 @@ id="xb_field_edit_is_scorable" > @@ -118,7 +118,7 @@ {% trans save_freq.help %} - +
diff --git a/h5pxblock/translations b/h5pxblock/translations new file mode 120000 index 00000000..4b1102b6 --- /dev/null +++ b/h5pxblock/translations @@ -0,0 +1 @@ +locale/ \ No newline at end of file diff --git a/h5pxblock/translations/README.txt b/h5pxblock/translations/README.txt deleted file mode 100644 index 0493bcc4..00000000 --- a/h5pxblock/translations/README.txt +++ /dev/null @@ -1,4 +0,0 @@ -Use this translations directory to provide internationalized strings for your XBlock project. - -For more information on how to enable translations, visit the Open edX XBlock tutorial on Internationalization: -http://edx.readthedocs.org/projects/xblock-tutorial/en/latest/edx_platform/edx_lms.html diff --git a/setup.py b/setup.py index c384cd56..f30887a2 100644 --- a/setup.py +++ b/setup.py @@ -59,5 +59,5 @@ def package_data(pkg, roots): 'h5pxblock = h5pxblock:H5PPlayerXBlock', ] }, - package_data=package_data("h5pxblock", ["static", "public"]), + package_data=package_data("h5pxblock", ["static", "public", "translations"]), )