forked from nvdaes/nvdaL10n
-
Notifications
You must be signed in to change notification settings - Fork 0
Refactor and tidy up #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
nvdaes
wants to merge
67
commits into
nvaccess:main
Choose a base branch
from
nvdaes:addonTemplate
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
67 commits
Select commit
Hold shift + click to select a range
87fa03e
Files for the addon template
nvdaes dc0f4f7
Merge branch 'main' into addonTemplate
nvdaes 4bd037f
Update pyproject
nvdaes c843cde
Merge branch 'main' into addonTemplate
nvdaes 04a4d61
Merge branch 'main' into addonTemplate
nvdaes 4e990e1
Updates by precommit
nvdaes f2e883d
Fix precommit config
nvdaes e84441c
Update files
nvdaes d946cf0
Updates by pre-commit
nvdaes 52f2b7c
Update
nvdaes f170d92
Restore support for xliff in NVDA since it's not used for add-ons
nvdaes f34fc9c
Updates
nvdaes 684438a
Add project and id arguments
nvdaes eef9d94
Add support to build an executable
nvdaes f696549
Update lock
nvdaes c9480b0
Update adding command
nvdaes 50a2e73
Update
nvdaes 9ce384a
Update
nvdaes 3b28afc
Update
nvdaes 4d083f6
Update
nvdaes 7df6298
Improve getFiles
nvdaes f9c8a20
Improvements and tested uploading translationFile
nvdaes 7037b43
Add nvda as default for downloadTranslationFile
nvdaes 0aa414e
Restore files which shouldn't be modified
nvdaes 6d98a76
Make reports true for pyright in pyproject
nvdaes a96d422
Address review: convert spaces to tab
nvdaes 45c5d4b
Add ability to upload source files to NVDA project with the uploadSou…
nvdaes 304ea15
Restore accidentally removed changes
nvdaes 9df7194
Format with ruff
nvdaes cc52b04
Bump to Python 3.13.12
nvdaes 7b38813
Update copyright years
nvdaes bbd6d84
Update source/l10nUtil.py
nvdaes dc667fd
Update readme.md
nvdaes 307f0c5
Update pyproject.toml
nvdaes 7b3dcd3
Update source/l10nUtil.py
nvdaes da9f6c5
Update source/l10nUtil.py
nvdaes 36a67be
Update pyproject.toml
nvdaes 7f9aa74
Update source/l10nUtil.py
nvdaes 8a585d8
Restore commands in the right position
nvdaes 4179bc1
Fix command
nvdaes a9928a6
Import tempfile
nvdaes 171c57b
Import tempfile in the right position
nvdaes dff71a0
Remove specific project ids
nvdaes 7b4d3b3
Improvements
nvdaes d1b4b94
Remove function
nvdaes 756a62e
Use _crowdinProjectId
nvdaes b2a2dc1
Improvements trying to reduce diffs
nvdaes fb0b35b
Remove shutil import
nvdaes e404691
Add removed instruction
nvdaes a240792
Restore shutil import
nvdaes a23b840
Restore command handling to original positions
nvdaes b882409
Remove json from imports
nvdaes e64837c
Don't use refresh to get files
nvdaes e760ac5
Improvements
nvdaes 5a942df
Restore setup files
nvdaes d3423f8
Remove source/setup
nvdaes 0cccfef
Restore files
nvdaes b01f688
Add setup
nvdaes d6c8169
Restore
nvdaes 3ec4a93
Restore files
nvdaes 26b2a02
Reformat
nvdaes ffc78b4
add versions for dependencies
nvdaes 8558b0b
Update source/l10nUtil.py
nvdaes 4103f30
Address review
nvdaes a8c7e0b
Merge branch 'addonTemplate' of https://github.com/nvdaes/nvdal10n in…
nvdaes 3de1afa
Fix name
nvdaes 1f11727
Encapsulate variables in dataclass
nvdaes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 3.13 | ||
| 3.13.12 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,194 @@ | ||
| [build-system] | ||
| requires = ["setuptools~=80.9", "wheel"] | ||
| build-backend = "setuptools.build_meta" | ||
| [project] | ||
| name = "nvdal10n" | ||
| version = "0.1.0" | ||
| description = "Add your description here" | ||
| readme = "README.md" | ||
| requires-python = ">=3.13" | ||
| dependencies = [] | ||
| name = "nvdaL10n" | ||
| dynamic = ["version"] | ||
| description = "Utilities for translations in NVDA and the add-on template" | ||
| maintainers = [ | ||
| {name = "NV Access", email = "info@nvaccess.org"}, | ||
| ] | ||
| requires-python = ">=3.13,<3.14" | ||
| classifiers = [ | ||
| "Development Status :: 5 - Production/Stable", | ||
| "Intended Audience :: End Users/Desktop", | ||
| "License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)", | ||
| "Operating System :: Microsoft :: Windows", | ||
| "Programming Language :: Python :: 3", | ||
| "Topic :: Accessibility", | ||
| ] | ||
| readme = "readme.md" | ||
| license = {file = "license"} | ||
| dependencies = [ | ||
| "crowdin-api-client==1.21.0", | ||
| "lxml>=6.0.2", | ||
| "markdown>=3.10", | ||
| "markdown-link-attr-modifier==0.2.1", | ||
| "mdx-gh-links==0.4", | ||
| "mdx-truly-sane-lists==1.3", | ||
| "nh3==0.2.19", | ||
| "requests>=2.32.5", | ||
| "ruff==0.8.1", | ||
| "pre-commit==4.0.1", | ||
| "pyright==1.1.396", | ||
| ] | ||
| [project.urls] | ||
| Repository = "https://github.com/nvaccess/nvdaL10n" | ||
|
|
||
| [project.optional-dependencies] | ||
| windows-packaging = [ | ||
| "pyinstaller==6.3.0", | ||
| ] | ||
|
|
||
| [tool.ruff] | ||
| line-length = 110 | ||
|
|
||
| builtins = [ | ||
| # translation lookup | ||
| "_", | ||
| # translation lookup | ||
| "ngettext", | ||
| # translation lookup | ||
| "pgettext", | ||
| # translation lookup | ||
| "npgettext", | ||
| ] | ||
|
|
||
| include = [ | ||
| "*.py", | ||
| ] | ||
|
|
||
| exclude = [ | ||
| ".git", | ||
| "__pycache__", | ||
| ".venv", | ||
| ] | ||
|
|
||
| [tool.ruff.format] | ||
| indent-style = "tab" | ||
| line-ending = "lf" | ||
|
|
||
| [tool.ruff.lint.mccabe] | ||
| max-complexity = 15 | ||
|
|
||
| [tool.ruff.lint] | ||
| ignore = [ | ||
| # indentation contains tabs | ||
| "W191", | ||
| ] | ||
| logger-objects = ["logHandler.log"] | ||
|
|
||
| [tool.pyright] | ||
| venvPath = ".venv" | ||
| venv = "." | ||
| pythonPlatform = "Windows" | ||
| typeCheckingMode = "strict" | ||
|
|
||
| include = [ | ||
| "**/*.py", | ||
| ] | ||
|
|
||
| exclude = [ | ||
| ".git", | ||
| "__pycache__", | ||
| ".venv", | ||
| # When excluding concrete paths relative to a directory, | ||
| # not matching multiple folders by name e.g. `__pycache__`, | ||
| # paths are relative to the configuration file. | ||
| ] | ||
|
|
||
| # General config | ||
| analyzeUnannotatedFunctions = true | ||
| deprecateTypingAliases = true | ||
|
|
||
| # Stricter typing | ||
| strictParameterNoneValue = true | ||
| strictListInference = true | ||
| strictDictionaryInference = true | ||
| strictSetInference = true | ||
|
|
||
| # Compliant rules | ||
| reportAbstractUsage = true | ||
| reportArgumentType = true | ||
| reportAssertAlwaysTrue = true | ||
| reportAssertTypeFailure = true | ||
| reportAssignmentType = true | ||
| reportAttributeAccessIssue = true | ||
| reportCallInDefaultInitializer = true | ||
| reportCallIssue = true | ||
| reportConstantRedefinition = true | ||
| reportDuplicateImport = true | ||
| reportFunctionMemberAccess = true | ||
| reportGeneralTypeIssues = true | ||
| reportImplicitOverride = true | ||
| reportImplicitStringConcatenation = true | ||
| reportImportCycles = true | ||
| reportIncompatibleMethodOverride = true | ||
| reportIncompatibleVariableOverride = true | ||
| reportIncompleteStub = true | ||
| reportInconsistentConstructor = true | ||
| reportInconsistentOverload = true | ||
| reportIndexIssue = true | ||
| reportInvalidStringEscapeSequence = true | ||
| reportInvalidStubStatement = true | ||
| reportInvalidTypeArguments = true | ||
| reportInvalidTypeForm = true | ||
| reportInvalidTypeVarUse = true | ||
| reportMatchNotExhaustive = true | ||
| reportMissingImports = true | ||
| reportMissingModuleSource = true | ||
| reportMissingParameterType = true | ||
| reportMissingSuperCall = true | ||
| reportMissingTypeArgument = true | ||
| reportNoOverloadImplementation = true | ||
| reportOperatorIssue = true | ||
| reportOptionalCall = true | ||
| reportOptionalContextManager = true | ||
| reportOptionalIterable = true | ||
| reportOptionalMemberAccess = true | ||
| reportOptionalOperand = true | ||
| reportOptionalSubscript = true | ||
| reportOverlappingOverload = true | ||
| reportPossiblyUnboundVariable = true | ||
| reportPrivateImportUsage = true | ||
| reportPrivateUsage = true | ||
| reportPropertyTypeMismatch = true | ||
| reportRedeclaration = true | ||
| reportReturnType = true | ||
| reportSelfClsParameterName = true | ||
| reportShadowedImports = true | ||
| reportTypeCommentUsage = true | ||
| reportTypedDictNotRequiredAccess = true | ||
| reportUnboundVariable = true | ||
| reportUndefinedVariable = true | ||
| reportUnhashable = true | ||
| reportUninitializedInstanceVariable = true | ||
| reportUnknownArgumentType = true | ||
| reportUnknownLambdaType = true | ||
| reportUnknownMemberType = true | ||
| reportUnknownParameterType = true | ||
| reportUnknownVariableType = true | ||
| reportUnnecessaryCast = true | ||
| reportUnnecessaryComparison = true | ||
| reportUnnecessaryContains = true | ||
| reportUnnecessaryIsInstance = true | ||
| reportUnnecessaryTypeIgnoreComment = true | ||
| reportUnsupportedDunderAll = true | ||
| reportUntypedBaseClass = true | ||
| reportUntypedClassDecorator = true | ||
| reportUntypedFunctionDecorator = true | ||
| reportUntypedNamedTuple = true | ||
| reportUnusedCallResult = true | ||
| reportUnusedClass = true | ||
| reportUnusedCoroutine = true | ||
| reportUnusedExcept = true | ||
| reportUnusedExpression = true | ||
| reportUnusedFunction = true | ||
| reportUnusedImport = true | ||
| reportUnusedVariable = true | ||
| reportWildcardImportFromLibrary = true | ||
|
|
||
| reportDeprecated = true | ||
|
|
||
| # Can be enabled by generating type stubs for modules via pyright CLI | ||
| reportMissingTypeStubs = false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,21 @@ | ||
| # Support for translations in NVDA and the add-on template | ||
|
|
||
| This repo is intended to be used as a submodule for [NVDA](https://github.com/nvaccess/nvda) and the [add-on template](https://github.com/nvaccess/addonTemplate). | ||
| This repository is intended to be used as a submodule for [NVDA](https://github.com/nvaccess/nvda) and the [add-on template](https://github.com/nvaccess/addonTemplate). | ||
|
|
||
| ## Installation and Building an Executable | ||
|
|
||
| To install all dependencies (including PyInstaller) and build a standalone executable using [uv](https://github.com/astral-sh/uv): | ||
|
|
||
| 1. Install all dependencies: | ||
|
|
||
| ```sh | ||
| uv pip install . | ||
| ``` | ||
|
|
||
| 2. Build the executable: | ||
|
|
||
| ```sh | ||
| uv run pyinstaller --onefile source/l10nUtil.py | ||
| ``` | ||
|
|
||
| The resulting executable will be located in the `dist` directory. |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The argument handling for the pre-commit config is inconsistent with standard argparse usage. The line uses
args: ["--branch", "main", "--branch", "master", ]but mixing argument names with values in a flat list is potentially confusing. While this is valid YAML, the trailing comma after "master" is unnecessary and non-standard for YAML lists.