diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 10551721..0dce07d7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -5,7 +5,7 @@ on: branches: [main] pull_request: branches: - - '**' + - "**" jobs: cypress-run: @@ -23,7 +23,7 @@ jobs: - uses: actions/setup-python@v5 id: setup_python with: - python-version: '3.12' + python-version: "3.12" - name: install dependencies of xblock-sdk working-directory: xblock-sdk run: | @@ -38,8 +38,8 @@ jobs: - name: Run xblock workbench working-directory: xblock-sdk env: - EXCLUDE_SAMPLE_XBLOCKS: yes - run: | + EXCLUDE_SAMPLE_XBLOCKS: yes + run: | python3 manage.py migrate --noinput python3 ./manage.py runserver & diff --git a/.github/workflows/publish_pypi.yml b/.github/workflows/publish_pypi.yml index d1c1ca66..22fd1f15 100644 --- a/.github/workflows/publish_pypi.yml +++ b/.github/workflows/publish_pypi.yml @@ -3,31 +3,30 @@ name: Publish package to PyPi on: push: tags: - - '*' + - "*" jobs: + push: + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/project/h5p-xblock + permissions: + id-token: write + steps: + - name: Checkout + uses: actions/checkout@v4 - push: - runs-on: ubuntu-latest - environment: - name: pypi - url: https://pypi.org/project/h5p-xblock - permissions: - id-token: write - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: '3.12' + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" - - name: Install setuptools and wheel - run: python -m pip install --upgrade pip setuptools wheel + - name: Install setuptools and wheel + run: python -m pip install --upgrade pip setuptools wheel - - name: Build package - run: python setup.py sdist bdist_wheel + - name: Build package + run: python setup.py sdist bdist_wheel - - name: Publish to PyPi - uses: pypa/gh-action-pypi-publish@release/v1 + - name: Publish to PyPi + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/README.md b/README.md index df8bd4de..b4a3271f 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,13 @@ on LMS You can help by translating this project. Follow the steps below: +1. You need `i18n_tool` to "collect" and "compile" translations. If you already have it, proceed to the next item; otherwise: + +```bash +pip install git+https://github.com/openedx/i18n-tools +``` + 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. +1. Run `make compile_translations`, this will generate the `text.mo` file. +1. Create a pull request with your changes. diff --git a/h5pxblock/locale/en/LC_MESSAGES/text.po b/h5pxblock/locale/en/LC_MESSAGES/text.po index 054b263a..eaef01f2 100644 --- a/h5pxblock/locale/en/LC_MESSAGES/text.po +++ b/h5pxblock/locale/en/LC_MESSAGES/text.po @@ -21,121 +21,151 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: h5pxblock.py:41 +#: h5pxblock.py:63 +msgid "Not attempted" +msgstr "" + +#: h5pxblock.py:64 +msgid "Completed" +msgstr "" + +#: h5pxblock.py:75 msgid "H5P Player Id" msgstr "" -#: h5pxblock.py:42 +#: h5pxblock.py:76 msgid "Unique ID for player instance" msgstr "" -#: h5pxblock.py:48 +#: h5pxblock.py:82 msgid "Display Name" msgstr "" -#: h5pxblock.py:49 +#: h5pxblock.py:83 msgid "Display name for this module" msgstr "" -#: h5pxblock.py:55 h5pxblock.py:56 +#: h5pxblock.py:89 h5pxblock.py:90 msgid "Upload H5P content" msgstr "" -#: h5pxblock.py:61 +#: h5pxblock.py:95 msgid "Show H5P player frame" msgstr "" -#: h5pxblock.py:62 +#: h5pxblock.py:96 msgid "whether to show H5P player frame and button" msgstr "" -#: h5pxblock.py:68 +#: h5pxblock.py:102 msgid "Show copyright button" msgstr "" -#: h5pxblock.py:69 +#: h5pxblock.py:103 msgid "whether to show copyright button" msgstr "" -#: h5pxblock.py:75 +#: h5pxblock.py:109 msgid "Show h5p icon" msgstr "" -#: h5pxblock.py:76 +#: h5pxblock.py:110 msgid "whether to show h5p icon" msgstr "" -#: h5pxblock.py:82 +#: h5pxblock.py:116 msgid "Show fullscreen button" msgstr "" -#: h5pxblock.py:83 +#: h5pxblock.py:117 msgid "whether to show fullscreen button" msgstr "" -#: h5pxblock.py:89 +#: h5pxblock.py:123 msgid "Is Scorable" msgstr "" -#: h5pxblock.py:91 +#: h5pxblock.py:125 msgid "Select True if this component will save score" msgstr "" -#: h5pxblock.py:98 +#: h5pxblock.py:132 msgid "User content state save frequency" msgstr "" -#: h5pxblock.py:100 +#: h5pxblock.py:134 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:108 +#: h5pxblock.py:142 msgid "User previous content interaction states" msgstr "" -#: h5pxblock.py:114 +#: h5pxblock.py:148 msgid "Problem Weight" msgstr "" -#: h5pxblock.py:116 +#: h5pxblock.py:150 msgid "" -"Defines the number of points this problem is worth. If the value is not set, " -"the problem is worth one point." +"Defines the number of points this problem is worth. If the value is not set," +" the problem is worth one point." msgstr "" -#: h5pxblock.py:125 +#: h5pxblock.py:159 msgid "Maximum score" msgstr "" -#: h5pxblock.py:126 +#: h5pxblock.py:160 msgid "Maximum grade score given to assignment by staff." msgstr "" -#: h5pxblock.py:217 +#: h5pxblock.py:166 +msgid "Problem weighted score" +msgstr "" + +#: h5pxblock.py:168 +msgid "" +"Defines the weighted score of this problem. If the value is not set, the " +"problem is worth one point." +msgstr "" + +#: h5pxblock.py:176 +msgid "Submission status" +msgstr "" + +#: h5pxblock.py:177 +msgid "The submission status of the assignment." +msgstr "" + +#: h5pxblock.py:263 msgid "Uploading" msgstr "" -#: h5pxblock.py:218 +#: h5pxblock.py:264 msgid "Uploaded" msgstr "" -#: h5pxblock.py:219 +#: h5pxblock.py:265 msgid "Extracting" msgstr "" -#: static/html/h5pxblock.html:7 +#: static/html/h5pxblock.html:6 +msgid "points" +msgstr "" + +#: static/html/h5pxblock.html:10 msgid "Loading..." msgstr "" -#: static/html/h5pxblock.html:13 +#: static/html/h5pxblock.html:16 msgid "" -"The due date for this subsection has passed. Your response will be recorded, " -"but not graded." +"The due date for this subsection has passed. Your response will be recorded," +" but not graded." msgstr "" -#: static/html/h5pxblock.html:18 +#: static/html/h5pxblock.html:21 msgid "No content. Please upload H5P content." msgstr "" @@ -153,8 +183,8 @@ msgstr "" #: static/html/studio.html:31 msgid "" -"Enter path of existing content or copy path to reuse this content in another " -"block" +"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 diff --git a/h5pxblock/locale/fa/LC_MESSAGES/text.mo b/h5pxblock/locale/fa/LC_MESSAGES/text.mo new file mode 100644 index 00000000..b2eed3dd Binary files /dev/null and b/h5pxblock/locale/fa/LC_MESSAGES/text.mo differ diff --git a/h5pxblock/locale/fa/LC_MESSAGES/text.po b/h5pxblock/locale/fa/LC_MESSAGES/text.po new file mode 100644 index 00000000..0053824a --- /dev/null +++ b/h5pxblock/locale/fa/LC_MESSAGES/text.po @@ -0,0 +1,216 @@ +# H5P XBlock translations. +# Copyright (C) 2024 edly +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Emad Rad , 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-08-16 12:00+0330\n" +"PO-Revision-Date: 2024-08-16 12:30+0330\n" +"Last-Translator: Emad Rad \n" +"Language-Team: Persian \n" +"Language: fa\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:63 +msgid "Not attempted" +msgstr "تلاش نشده" + +#: h5pxblock.py:64 +msgid "Completed" +msgstr "تکمیل شد" + +#: h5pxblock.py:75 +msgid "H5P Player Id" +msgstr "شناسه پخش‌کننده H5P" + +#: h5pxblock.py:76 +msgid "Unique ID for player instance" +msgstr "شناسه یکتای نمونه پخش‌کننده" + +#: h5pxblock.py:82 +msgid "Display Name" +msgstr "نام نمایش" + +#: h5pxblock.py:83 +msgid "Display name for this module" +msgstr "نام نمایشی برای این ماژول" + +#: h5pxblock.py:89 h5pxblock.py:90 +msgid "Upload H5P content" +msgstr "بارگذاری محتوای H5P" + +#: h5pxblock.py:95 +msgid "Show H5P player frame" +msgstr "نمایش فریم پخش‌کننده H5P" + +#: h5pxblock.py:96 +msgid "whether to show H5P player frame and button" +msgstr "آیا فریم و دکمه پخش‌کننده H5P نشان داده شود" + +#: h5pxblock.py:102 +msgid "Show copyright button" +msgstr "نمایش دکمه حق نشر" + +#: h5pxblock.py:103 +msgid "whether to show copyright button" +msgstr "آیا دکمه حق نشر نشان داده شود" + +#: h5pxblock.py:109 +msgid "Show h5p icon" +msgstr "نمایش آیکون h5p" + +#: h5pxblock.py:110 +msgid "whether to show h5p icon" +msgstr "آیا آیکون h5p نشان داده شود" + +#: h5pxblock.py:116 +msgid "Show fullscreen button" +msgstr "نمایش دکمه تمام‌صفحه" + +#: h5pxblock.py:117 +msgid "whether to show fullscreen button" +msgstr "آیا دکمه تمام‌صفحه نشان داده شود" + +#: h5pxblock.py:123 +msgid "Is Scorable" +msgstr "قابل نمره‌دهی است" + +#: h5pxblock.py:125 +msgid "Select True if this component will save score" +msgstr "اگر این بخش نمره را ذخیره می‌کند، صحیح را انتخاب کنید" + +#: h5pxblock.py:132 +msgid "User content state save frequency" +msgstr "تناوب ذخیره‌سازی حالت محتوای کاربر" + +#: h5pxblock.py:134 +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:142 +msgid "User previous content interaction states" +msgstr "حالت‌های تعامل محتوای قبلی کاربر" + +#: h5pxblock.py:148 +msgid "Problem Weight" +msgstr "وزن مسئله" + +#: h5pxblock.py:150 +msgid "" +"Defines the number of points this problem is worth. If the value is not set," +" the problem is worth one point." +msgstr "تعداد امتیازاتی که این مسئله ارزش دارد را تعیین می‌کند. اگر مقدار تنظیم نشود، مسئله یک امتیاز ارزش دارد." + +#: h5pxblock.py:159 +msgid "Maximum score" +msgstr "حداکثر نمره" + +#: h5pxblock.py:160 +msgid "Maximum grade score given to assignment by staff." +msgstr "حداکثر نمره‌ای که توسط کارکنان به تکلیف داده می‌شود." + +#: h5pxblock.py:166 +msgid "Problem weighted score" +msgstr "نمره وزن‌دار مسئله" + +#: h5pxblock.py:168 +msgid "" +"Defines the weighted score of this problem. If the value is not set, the " +"problem is worth one point." +msgstr "نمره وزن‌دار این مسئله را تعیین می‌کند. اگر مقدار تنظیم نشود، مسئله یک امتیاز ارزش دارد." + +#: h5pxblock.py:176 +msgid "Submission status" +msgstr "وضعیت ارسال" + +#: h5pxblock.py:177 +msgid "The submission status of the assignment." +msgstr "وضعیت ارسال تکلیف." + +#: h5pxblock.py:263 +msgid "Uploading" +msgstr "در حال بارگذاری" + +#: h5pxblock.py:264 +msgid "Uploaded" +msgstr "بارگذاری شده" + +#: h5pxblock.py:265 +msgid "Extracting" +msgstr "در حال استخراج" + +#: static/html/h5pxblock.html:6 +msgid "points" +msgstr "امتیازات" + +#: static/html/h5pxblock.html:10 +msgid "Loading..." +msgstr "در حال بارگذاری..." + +#: static/html/h5pxblock.html:16 +msgid "" +"The due date for this subsection has passed. Your response will be recorded," +" but not graded." +msgstr "تاریخ موعد این بخش گذشته است. پاسخ شما ثبت خواهد شد، اما نمره‌گذاری نمی‌شود." + +#: static/html/h5pxblock.html:21 +msgid "No content. Please upload H5P content." +msgstr "محتوایی وجود ندارد. لطفاً محتوای H5P بارگذاری کنید." + +#: 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 "استفاده مجدد از محتوای موجود H5P" + +#: 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:141 +msgid "Save" +msgstr "ذخیره" + +#: static/html/studio.html:144 +msgid "Cancel" +msgstr "لغو"