From 3a6dea295256468c8c4b69b99be1be2ac9bf0e3b Mon Sep 17 00:00:00 2001 From: David CM Date: Thu, 4 Jan 2024 18:36:17 -0600 Subject: [PATCH] version 24.1.1 * added support for nvda NVDA 24.2. * updated the github workflow to include the body of the first header in the release description. * Updated the description to inform the user that the feature exists in NVDA, but this add-on adds improvements. * added spanish locale strings. * updated locale strings template. --- .github/workflows/release-on-tag.yaml | 69 ++++++++++++++ .github/workflows/upload-on-tag.yaml | 71 --------------- EnhancedPhoneticReading.pot | 34 ++++--- .../globalPlugins/enhancedPhoneticReading.py | 3 +- addon/locale/es/LC_MESSAGES/nvda.po | 91 +++++++++++++++++++ buildVars.py | 8 +- changelog.md | 8 +- readme.md | 4 +- sconstruct | 12 ++- style.css | 26 ++++++ 10 files changed, 226 insertions(+), 100 deletions(-) create mode 100644 .github/workflows/release-on-tag.yaml delete mode 100644 .github/workflows/upload-on-tag.yaml create mode 100644 addon/locale/es/LC_MESSAGES/nvda.po create mode 100644 style.css diff --git a/.github/workflows/release-on-tag.yaml b/.github/workflows/release-on-tag.yaml new file mode 100644 index 0000000..4c93430 --- /dev/null +++ b/.github/workflows/release-on-tag.yaml @@ -0,0 +1,69 @@ +permissions: + contents: write +name: Upload on new tags +on: + push: + tags: + ['*'] + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + - run: echo -e "scons\nmarkdown">requirements.txt + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: 3.11 + cache: 'pip' + - name: Install dependencies + run: | + pip install scons markdown + sudo apt update + sudo apt install gettext + + - name: Set add-on version from tag + run: | + import re + with open("buildVars.py", 'r+', encoding='utf-8') as f: + text = f.read() + version = "${{ github.ref }}".split("/")[-1] + text = re.sub('"addon_version" *:.*,', '"addon_version" : "%s",' % version, text) + f.seek(0) + f.write(text) + f.truncate() + shell: python + + - name: Build add-on + run: scons + - name: load latest changes from changelog + run: awk '/^# / && !flag {flag=1; next} /^# / && flag {exit} flag && NF' changelog.md > newChanges.md + - name: Calculate sha256 + run: sha256sum *.nvda-addon >> newChanges.md + - uses: actions/upload-artifact@v3 + with: + name: packaged_addon + path: | + ./*.nvda-addon + ./newChanges.md + + upload_release: + runs-on: ubuntu-latest + if: ${{ startsWith(github.ref, 'refs/tags/') }} + needs: ["build"] + steps: + - name: download releases files + uses: actions/download-artifact@v3 + - name: Display structure of downloaded files + run: ls -R + + - name: Release + uses: softprops/action-gh-release@v1 + with: + body_path: packaged_addon/newChanges.md + files: packaged_addon/*.nvda-addon + fail_on_unmatched_files: true + prerelease: ${{ contains(github.ref, '-') }} diff --git a/.github/workflows/upload-on-tag.yaml b/.github/workflows/upload-on-tag.yaml deleted file mode 100644 index 49641b3..0000000 --- a/.github/workflows/upload-on-tag.yaml +++ /dev/null @@ -1,71 +0,0 @@ -permissions: - contents: write -name: Upload on new tags -on: - push: - tags: - ['*'] - workflow_dispatch: - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v3 - - run: echo -e "pre-commit\nscons\nmarkdown">requirements.txt - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: 3.9 - cache: 'pip' - - - name: Install dependencies - run: | - pip install scons markdown - sudo apt update - sudo apt install gettext - - - name: Add add-on version - run: | - import re - with open("buildVars.py", 'r+', encoding='utf-8') as f: - text = f.read() - version = "${{ github.ref }}".split("/")[-1] - text = re.sub('"addon_version" *:.*,', '"addon_version" : "%s",' % version, text) - f.seek(0) - f.write(text) - f.truncate() - shell: python - - - name: Build add-on - run: scons - - name: Calculate sha256 - run: sha256sum *.nvda-addon >> changelog.md - - - uses: actions/upload-artifact@v3 - with: - name: packaged_addon - path: | - ./*.nvda-addon - ./*.json - - upload_release: - runs-on: ubuntu-latest - if: ${{ startsWith(github.ref, 'refs/tags/') }} - needs: ["build"] - steps: - - uses: actions/checkout@v3 - - name: download releases files - uses: actions/download-artifact@v3 - - name: Display structure of downloaded files - run: ls -R - - - name: Release - uses: softprops/action-gh-release@v1 - with: - files: | - packaged_addon/*.nvda-addon - packaged_addon/*.json - fail_on_unmatched_files: true - prerelease: ${{ contains(github.ref, '-') }} diff --git a/EnhancedPhoneticReading.pot b/EnhancedPhoneticReading.pot index 92672f7..996d4b2 100644 --- a/EnhancedPhoneticReading.pot +++ b/EnhancedPhoneticReading.pot @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: 'EnhancedPhoneticReading' '1.1.3'\n" -"Report-Msgid-Bugs-To: 'nvda-translations@freelists.org'\n" -"POT-Creation-Date: 2023-04-15 09:26-0600\n" +"Report-Msgid-Bugs-To: 'nvda-translations@groups.io'\n" +"POT-Creation-Date: 2024-01-04 18:11-0600\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,49 +18,49 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #. Translators: This is the label for the Enhanced phonetic reading settings category in NVDA Settings screen. -#: addon\globalPlugins\enhancedPhoneticReading.py:87 +#: addon\globalPlugins\enhancedPhoneticReading.py:88 msgid "Enhanced phonetic reading" msgstr "" #. Translators: label for a checkbox option in the settings panel. -#: addon\globalPlugins\enhancedPhoneticReading.py:92 +#: addon\globalPlugins\enhancedPhoneticReading.py:93 msgid "&Enable delayed descriptions for characters" msgstr "" #. Translators: label for a edit field option in the settings panel. -#: addon\globalPlugins\enhancedPhoneticReading.py:95 +#: addon\globalPlugins\enhancedPhoneticReading.py:96 msgid "&Delay to announce character descriptions (in ms)" msgstr "" #. Translators: message spoken if the user enables or disables delayed character descriptions. -#: addon\globalPlugins\enhancedPhoneticReading.py:114 +#: addon\globalPlugins\enhancedPhoneticReading.py:115 #, python-format msgid "Delayed descriptions %s" msgstr "" -#: addon\globalPlugins\enhancedPhoneticReading.py:114 -#: addon\globalPlugins\enhancedPhoneticReading.py:123 +#: addon\globalPlugins\enhancedPhoneticReading.py:115 +#: addon\globalPlugins\enhancedPhoneticReading.py:124 msgid "on" msgstr "" -#: addon\globalPlugins\enhancedPhoneticReading.py:114 -#: addon\globalPlugins\enhancedPhoneticReading.py:123 +#: addon\globalPlugins\enhancedPhoneticReading.py:115 +#: addon\globalPlugins\enhancedPhoneticReading.py:124 msgid "off" msgstr "" #. Translators: input help message for a delayed character descriptions command. -#: addon\globalPlugins\enhancedPhoneticReading.py:116 +#: addon\globalPlugins\enhancedPhoneticReading.py:117 msgid "Toggles delayed character descriptions on or off" msgstr "" #. Translators: message spoken if the user enables or disables instant character descriptions. -#: addon\globalPlugins\enhancedPhoneticReading.py:123 +#: addon\globalPlugins\enhancedPhoneticReading.py:124 #, python-format msgid "instant character descriptions %s" msgstr "" #. Translators: input help message for a Enhanced phonetic reading command. -#: addon\globalPlugins\enhancedPhoneticReading.py:125 +#: addon\globalPlugins\enhancedPhoneticReading.py:126 msgid "Toggles instant character descriptions on or off" msgstr "" @@ -74,11 +74,9 @@ msgstr "" #. Translators: Long description to be shown for this add-on on add-on information from add-ons manager #: buildVars.py:20 msgid "" -"This add-on add some features to phonetic reading as the following:\n" -"\tannounce the character description for the last read character after n " -"milliseconds when the character was read by character review commands, E.G. " -"left and right arrow keys, left, current or right character review commands, " -"ETC.\n" +"This add-on improves the delaied phonetic reading of NVDA:\n" +"\tallows you to set the delay to announce the description in ms, more " +"customizable than the native feature.\n" "\tRead the character description instead of the current character. This " "feature must be enabled or disabled manually and will be deactivated when " "NVDA is closed." diff --git a/addon/globalPlugins/enhancedPhoneticReading.py b/addon/globalPlugins/enhancedPhoneticReading.py index 929c387..213ab14 100644 --- a/addon/globalPlugins/enhancedPhoneticReading.py +++ b/addon/globalPlugins/enhancedPhoneticReading.py @@ -43,6 +43,7 @@ def cancelSpeech(): origCancelSpeech() cancelTimer() + class _FakeTextInfo(): """ this class is used to preserve the information of the old object that contain the text. Its useful to use with delayed descriptions. @@ -82,7 +83,7 @@ def speakDelayedDescription(info: _FakeTextInfo): if description: speech.spellTextInfo(info, useCharacterDescriptions=True) -class EnhancedPhoneticReadingPanel(gui.SettingsPanel): +class EnhancedPhoneticReadingPanel(gui.settingsDialogs.SettingsPanel): # Translators: This is the label for the Enhanced phonetic reading settings category in NVDA Settings screen. title = _("Enhanced phonetic reading") diff --git a/addon/locale/es/LC_MESSAGES/nvda.po b/addon/locale/es/LC_MESSAGES/nvda.po new file mode 100644 index 0000000..2d7de5b --- /dev/null +++ b/addon/locale/es/LC_MESSAGES/nvda.po @@ -0,0 +1,91 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the 'EnhancedPhoneticReading' package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: 'EnhancedPhoneticReading' '1.1.3'\n" +"Report-Msgid-Bugs-To: 'nvda-translations@groups.io'\n" +"POT-Creation-Date: 2024-01-04 18:11-0600\n" +"PO-Revision-Date: 2024-01-04 18:30-0600\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 3.4.2\n" + +#. Translators: This is the label for the Enhanced phonetic reading settings category in NVDA Settings screen. +#: addon\globalPlugins\enhancedPhoneticReading.py:88 +msgid "Enhanced phonetic reading" +msgstr "Lectura fonética mejorada" + +#. Translators: label for a checkbox option in the settings panel. +#: addon\globalPlugins\enhancedPhoneticReading.py:93 +msgid "&Enable delayed descriptions for characters" +msgstr "&Habilitar descripciones retrasadas de caracteres" + +#. Translators: label for a edit field option in the settings panel. +#: addon\globalPlugins\enhancedPhoneticReading.py:96 +msgid "&Delay to announce character descriptions (in ms)" +msgstr "&Retraso para anunciar descripciones de caracteres (en ms)" + +#. Translators: message spoken if the user enables or disables delayed character descriptions. +#: addon\globalPlugins\enhancedPhoneticReading.py:115 +#, python-format +msgid "Delayed descriptions %s" +msgstr "Descripciones retrasadas %s" + +#: addon\globalPlugins\enhancedPhoneticReading.py:115 +#: addon\globalPlugins\enhancedPhoneticReading.py:124 +msgid "on" +msgstr "Activado" + +#: addon\globalPlugins\enhancedPhoneticReading.py:115 +#: addon\globalPlugins\enhancedPhoneticReading.py:124 +msgid "off" +msgstr "Desactivado" + +#. Translators: input help message for a delayed character descriptions command. +#: addon\globalPlugins\enhancedPhoneticReading.py:117 +msgid "Toggles delayed character descriptions on or off" +msgstr "Alterna la función de descripciones retrasadas de caracteres" + +#. Translators: message spoken if the user enables or disables instant character descriptions. +#: addon\globalPlugins\enhancedPhoneticReading.py:124 +#, python-format +msgid "instant character descriptions %s" +msgstr "descripciones instantáneas de caracteres %s" + +#. Translators: input help message for a Enhanced phonetic reading command. +#: addon\globalPlugins\enhancedPhoneticReading.py:126 +msgid "Toggles instant character descriptions on or off" +msgstr "Activa o desactiva las descripciones instantáneas de caracteres" + +#. Add-on summary, usually the user visible name of the addon. +#. Translators: Summary for this add-on to be shown on installation and add-on information. +#: buildVars.py:17 +msgid "Enhanced Phonetic Reading" +msgstr "Lectura fonética mejorada" + +#. Add-on description +#. Translators: Long description to be shown for this add-on on add-on information from add-ons manager +#: buildVars.py:20 +msgid "" +"This add-on improves the delaied phonetic reading of NVDA:\n" +"\tallows you to set the delay to announce the description in ms, more " +"customizable than the native feature.\n" +"\tRead the character description instead of the current character. This " +"feature must be enabled or disabled manually and will be deactivated when " +"NVDA is closed." +msgstr "" +"Este complemento mejora el anunciado retrasado de descripción de " +"caracteres de NVDA:\n" +"\tle permite configurar el retraso para anunciar la descripción en ms, " +"más personalizable que la característica nativa.\\n\n" +"\\tLeer la descripción del carácter en lugar del carácter actual. Esta " +"característica debe habilitarse o deshabilitarse manualmente y se " +"desactivará cuando se cierre NVDA." diff --git a/buildVars.py b/buildVars.py index aeb61cb..3ce74fe 100644 --- a/buildVars.py +++ b/buildVars.py @@ -17,11 +17,11 @@ "addon_summary" : _("Enhanced Phonetic Reading"), # Add-on description # Translators: Long description to be shown for this add-on on add-on information from add-ons manager - "addon_description" : _("""This add-on add some features to phonetic reading as the following: - announce the character description for the last read character after n milliseconds when the character was read by character review commands, E.G. left and right arrow keys, left, current or right character review commands, ETC. + "addon_description" : _("""This add-on improves the delaied phonetic reading of NVDA: + allows you to set the delay to announce the description in ms, more customizable than the native feature. Read the character description instead of the current character. This feature must be enabled or disabled manually and will be deactivated when NVDA is closed."""), # version - "addon_version" : "1.1.3", + "addon_version" : "24.1.1", # Author(s) "addon_author" : u"David CM ", # URL for the add-on documentation support @@ -31,7 +31,7 @@ # Minimum NVDA version supported (e.g. "2018.3.0") "addon_minimumNVDAVersion" : "2018.3.0", # Last NVDA version supported/tested (e.g. "2018.4.0", ideally more recent than minimum version) - "addon_lastTestedNVDAVersion" : "2023.1", + "addon_lastTestedNVDAVersion" : "2024.2", # Add-on update channel (default is stable or None) "addon_updateChannel": "stable", # Add-on license such as GPL 2 diff --git a/changelog.md b/changelog.md index 949896e..b7050f6 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,9 @@ -## Changes for 1.1.3 ## +# version 24.1.1 + +* added support for nvda NVDA 24.2. +* Updated the description to inform the user that the feature exists in NVDA, but this add-on adds improvements. +* added spanish locale strings. + +# version 1.1.3 ## * Updated manifest to add compatibility with NVDA 2023.1. diff --git a/readme.md b/readme.md index 21c498a..e3ef442 100644 --- a/readme.md +++ b/readme.md @@ -1,5 +1,5 @@ # Enhanced phonetic reading NVDA Add-on # -This add-on add some features to phonetic reading like delayed character descriptions and instant character descriptions. +This add-on add some features to phonetic reading like delayed character descriptions and instant character descriptions. Those are enhancements for the native feature implemented in NVDA. Copyright (C) 2022 - 2023 David CM @@ -7,7 +7,7 @@ This package is distributed under the terms of the GNU General Public License, v ## Download. The latest release is available to -[download in this link](https://davidacm.github.io/getlatest/gh/davidacm/EnhancedPhoneticReading/?index=1) +[download in this link](https://davidacm.github.io/getlatest/gh/davidacm/EnhancedPhoneticReading/) ## Features. diff --git a/sconstruct b/sconstruct index 8aa914b..dde28af 100644 --- a/sconstruct +++ b/sconstruct @@ -101,7 +101,7 @@ if env["dev"]: buildDate = datetime.datetime.now() year, month, day = str(buildDate.year), str(buildDate.month), str(buildDate.day) versionTimestamp = "".join([year, month.zfill(2), day.zfill(2)]) - env["addon_version"] = f"{versionTimestamp}-dev" + env["addon_version"] = f"{versionTimestamp}.0.0" env["versionNumber"] = f"{versionTimestamp}.0.0" env["channel"] = "dev" elif env["version"] is not None: @@ -170,7 +170,8 @@ def createAddonBundleFromPath(path, dest): absPath = os.path.join(dir, filename) if pathInBundle not in buildVars.excludedFiles: z.write(absPath, pathInBundle) - createAddonStoreJson(dest) + # Add-on store does not require submitting json files. + # createAddonStoreJson(dest) return dest @@ -299,7 +300,12 @@ for file in pythonFiles: createAddonHelp("addon") for mdFile in env.Glob(os.path.join('addon', 'doc', '*', '*.md')): htmlFile = env.markdown(mdFile) - env.Depends(htmlFile, mdFile) + try: # It is possible that no moFile was set, because an add-on has no translations. + moFile + except NameError: # Runs if there is no moFile + env.Depends(htmlFile, mdFile) + else: # Runs if there is a moFile + env.Depends(htmlFile, [mdFile, moFile]) env.Depends(addon, htmlFile) # Pot target diff --git a/style.css b/style.css new file mode 100644 index 0000000..90f99d1 --- /dev/null +++ b/style.css @@ -0,0 +1,26 @@ +@charset "utf-8"; +body { +font-family : Verdana, Arial, Helvetica, Sans-serif; +line-height: 1.2em; +} +h1, h2 {text-align: center} +dt { +font-weight : bold; +float : left; +width: 10%; +clear: left +} +dd { +margin : 0 0 0.4em 0; +float : left; +width: 90%; +display: block; +} +p { clear : both; +} +a { text-decoration : underline; +} +:active { +text-decoration : none; +} +a:focus, a:hover {outline: solid}