From 1ed45c302a02eff8c1a39e63aee0341dd870db9d Mon Sep 17 00:00:00 2001 From: Emad Rad Date: Fri, 20 Sep 2024 09:05:36 +0330 Subject: [PATCH] feat: Persian translations added (#41) * feat: Persian translations added * docs: i18_tool step added to work with translations --- .github/workflows/main.yml | 8 +- .github/workflows/publish_pypi.yml | 43 +++-- README.md | 10 +- h5pxblock/locale/en/LC_MESSAGES/text.po | 98 +++++++---- h5pxblock/locale/fa/LC_MESSAGES/text.mo | Bin 0 -> 5012 bytes h5pxblock/locale/fa/LC_MESSAGES/text.po | 216 ++++++++++++++++++++++++ 6 files changed, 313 insertions(+), 62 deletions(-) create mode 100644 h5pxblock/locale/fa/LC_MESSAGES/text.mo create mode 100644 h5pxblock/locale/fa/LC_MESSAGES/text.po 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 57491ec7..6676e41a 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,13 @@ Please ensure that your bucket is publicly accessible to enable seamless content 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 0000000000000000000000000000000000000000..b2eed3dd9c5a172be460bb1e638973c6704ac684 GIT binary patch literal 5012 zcmc(hO>7)z8OPt!Lcyg_8p=2HEzs7c*~Lj(8a6RBI1aV)QOkA`6(OPV?z_7~XJ?lA zh+_^_6FIh}TI#7%j})Xhag(@CoP;6~i31!sa+^d-fishQPmlh(BEK-mBEdz(0c@0sopm{{!sf z`2)}c@4ru}3K)YQ2V0={`wKV@-uvOq{shQB=Mek^&#!==0bc{Z0G<8CC z@$*OU%iw$9!=USgdL@EoY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4O^g$p>6t!GSZ}KGDB)HTpy_J_d z&r<&xX?WJrcJ+1~?-D_EcY#QR$aE;(lrS>y(st2F>($<-$$tjYEwyy?NWf(g9p?(Z zII>#v3h&Id)p2Ui9>#|Rq?_3*OPhr4w&A&3sBE}IZj1^iTW>;Lb0jj{6pP9wk&g#S zquUP6d7C$-l{054mV+$4o?b>gmvci{w_`!eJLP7T&@AzbPO`J`F7sil&TK{5q)i7e zx6Wovt#Vfuy~-!eba#cOPxr6cmd>J@my zgl`3}NmW#2DY2qlqjMx=X{YK)D@MUvFook91BYvpm(GHPq@G37hDb#pFY z>TI82!dTBP(Ys9K0;4guPfF0-jMZ;PbXcZ63t zTDtS+z~Q*rvRnA?`r<3mgfyfh#{~|DTyA%u%>L)z&Z<3D+Q&%y!;m@aIOx(Vt$?5Z RYSVTR|L4s;%D%h#zX5Plo}K^z literal 0 HcmV?d00001 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 "لغو"