-
-
Notifications
You must be signed in to change notification settings - Fork 630
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
add ability to translate the user guide on Crowdin #17050
Conversation
WalkthroughThe changes encompass the introduction of a new GitHub Actions workflow for automating user documentation updates, modifications to Python scripts for improved formatting and readability, and various minor adjustments across multiple files to enhance code consistency. The updates include changes to string formatting, function signatures, and the organization of code, while maintaining the existing functionality and logic throughout the project. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant GitHub Actions
participant Python Script
participant Crowdin
User->>GitHub Actions: Push changes to markdown files
GitHub Actions->>Python Script: Trigger update documentation process
Python Script->>Python Script: Process modified markdown files
Python Script->>Crowdin: Upload updated .xliff files
Crowdin-->>Python Script: Confirmation of upload
Python Script->>GitHub Actions: Commit changes
GitHub Actions-->>User: Documentation updated
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
@seanbudd It seems that precommit is reformatting all files in the repo which makes this pr impossible to review. I guess I'll need to wait for all the reformatting to reach beta and then remove the final precommit here before I can make it ready for review? |
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.
Actionable comments posted: 8
Outside diff range, codebase verification and nitpick comments (16)
source/NVDAObjects/IAccessible/sysListView32.py (2)
Line range hint
421-466
: LGTM! But address the static analysis hints.The methods within the
ListItem
class are correctly defined. However, address the static analysis hints about undefined imports.Apply this diff to explicitly import the required modules:
+from ctypes import byref, sizeof class ListItem(RowWithFakeNavigation, RowWithoutCellObjects, ListItemWithoutColumnSupport): parent: List def _getColumnLocationRawInProc(self, index: int) -> ctypes.wintypes.RECT: """Retrieves rectangle containing coordinates for a given column. Note that this method operates in process and cannot be used in situations where NVDA cannot inject i.e when running as a Windows Store application or when no focus event was received on startup. """ item = self.IAccessibleChildID - 1 subItem = index rect = ctypes.wintypes.RECT() if ( watchdog.cancellableExecute( NVDAHelper.localLib.nvdaInProcUtils_sysListView32_getColumnLocation, self.appModule.helperLocalBindingHandle, self.windowHandle, item, subItem, ctypes.byref(rect), ) != 0 ): return None return rect
Tools
Ruff
452-452:
sizeof
may be undefined, or defined from star imports(F405)
456-456:
byref
may be undefined, or defined from star imports(F405)
456-456:
sizeof
may be undefined, or defined from star imports(F405)
Line range hint
507-560
: LGTM! But address the static analysis hints.The methods within the
ListItem
class are correctly defined. However, address the static analysis hints about undefined imports.Apply this diff to explicitly import the required modules:
+from ctypes import byref, sizeof class ListItem(RowWithFakeNavigation, RowWithoutCellObjects, ListItemWithoutColumnSupport): parent: List def _getColumnContentRawInProc(self, index: int) -> Optional[str]: """Retrieves text for a given column. Note that this method operates in process and cannot be used in situations where NVDA cannot inject i.e when running as a Windows Store application or when no focus event was received on startup. """ item = self.IAccessibleChildID - 1 subItem = index text = AutoFreeBSTR() if ( watchdog.cancellableExecute( NVDAHelper.localLib.nvdaInProcUtils_sysListView32_getColumnContent, self.appModule.helperLocalBindingHandle, self.windowHandle, item, subItem, ctypes.byref(text), ) != 0 ): return None return text.value
Tools
Ruff
531-531:
sizeof
may be undefined, or defined from star imports(F405)
546-546:
byref
may be undefined, or defined from star imports(F405)
546-546:
sizeof
may be undefined, or defined from star imports(F405)
553-553:
byref
may be undefined, or defined from star imports(F405)
553-553:
sizeof
may be undefined, or defined from star imports(F405)
source/NVDAHelper.py (14)
69-70
: Remove unnecessarynoqa
comment.The
noqa
comment is not necessary for this line and can be removed.Apply this diff to remove the
noqa
comment:- cast(getattr(dll, name), POINTER(c_void_p)).contents.value = cast(cfunc, c_void_p).value # noqa: F405 + cast(getattr(dll, name), POINTER(c_void_p)).contents.value = cast(cfunc, c_void_p).value
74-81
: Move import statement to the top of the file.The import statement for
speech
should be at the top of the file to follow best practices.Apply this diff to move the import statement:
74c74 < @WINFUNCTYPE(c_long, c_wchar_p) --- > import speech 81c81 < import speech --- >
Line range hint
90-152
: Move import statements to the top of the file and refactor the function.The import statements for
speech
,SymbolLevel
,SpeechPriority
, and_getSpeakSsmlSpeech
should be at the top of the file to follow best practices. Additionally, the function could be simplified by breaking it down into smaller helper functions.Apply this diff to move the import statements:
90c90 < @WINFUNCTYPE(c_long, c_wchar_p, c_int, c_int, c_bool) --- > import speech > from characterProcessing import SymbolLevel > from speech.priorities import SpeechPriority > from speech.speech import _getSpeakSsmlSpeech > > @WINFUNCTYPE(c_long, c_wchar_p, c_int, c_int, c_bool)Consider refactoring the function into smaller helper functions to improve readability and maintainability.
174-179
: Move import statement to the top of the file.The import statement for
speech
should be at the top of the file to follow best practices.Apply this diff to move the import statement:
174c174 < @WINFUNCTYPE(c_long) --- > import speech 179c179 < import speech --- >
183-190
: Move import statement to the top of the file.The import statement for
braille
should be at the top of the file to follow best practices.Apply this diff to move the import statement:
183c183 < @WINFUNCTYPE(c_long, c_wchar_p) --- > import braille 190c190 < import braille --- >
225-241
: Remove unnecessarynoqa
comments.The
noqa
comments are not necessary for these lines and can be removed.Apply this diff to remove the
noqa
comments:225c225 < windll.rpcrt4.I_RpcBindingInqLocalClientPID(None, byref(pid)) # noqa: F405 --- > windll.rpcrt4.I_RpcBindingInqLocalClientPID(None, byref(pid)) 241c241 < windll.rpcrt4.RpcBindingFree(byref(bindingHandle)) # noqa: F405 --- > windll.rpcrt4.RpcBindingFree(byref(bindingHandle))
Line range hint
252-285
: Move import statements to the top of the file.The import statements for
speech
,braille
,AriaLivePoliteness
, andSpri
should be at the top of the file to follow best practices.Apply this diff to move the import statements:
252c252 < @WINFUNCTYPE(c_long, c_wchar_p, c_wchar_p) --- > import speech > import braille > from aria import AriaLivePoliteness > from speech.priorities import Spri > > @WINFUNCTYPE(c_long, c_wchar_p, c_wchar_p)
289-292
: Move import statement to the top of the file.The import statement for
displayModel
should be at the top of the file to follow best practices.Apply this diff to move the import statement:
289c289 < @WINFUNCTYPE(c_long, c_long, c_long, c_long, c_long, c_long) --- > import displayModel 292c292 < import displayModel --- >
297-304
: Move import statements to the top of the file.The import statements for
eventHandler
andWindow
should be at the top of the file to follow best practices.Apply this diff to move the import statements:
297c297 < @WINFUNCTYPE(c_long, c_long, c_long, c_long, c_long, c_long) --- > import eventHandler > from NVDAObjects.window import Window 304c304 < import eventHandler --- >
309-318
: Move import statement to the top of the file.The import statement for
getAppNameFromProcessID
should be at the top of the file to follow best practices.Apply this diff to move the import statement:
309c309 < @WINFUNCTYPE(c_long, c_long, c_long, c_wchar_p) --- > from appModuleHandler import getAppNameFromProcessID 318c318 < from appModuleHandler import getAppNameFromProcessID --- >
321-354
: Move import statements to the top of the file.The import statements for
speech
,characterProcessing
,InputComposition
, andModernCandidateUICandidateItem
should be at the top of the file to follow best practices.Apply this diff to move the import statements:
321c321 < def handleInputCompositionEnd(result): --- > import speech > import characterProcessing > from NVDAObjects.inputComposition import InputComposition > from NVDAObjects.IAccessible.mscandui import ModernCandidateUICandidateItem > > def handleInputCompositionEnd(result): 327c327 < import speech --- >
363-389
: Move import statements to the top of the file.The import statements for
speech
,InputComposition
, andCandidateItem
should be at the top of the file to follow best practices.Apply this diff to move the import statements:
363c363 < def handleInputCompositionStart(compositionString, selectionStart, selectionEnd, isReading): --- > import speech > from NVDAObjects.inputComposition import InputComposition > from NVDAObjects.behaviors import CandidateItem > > def handleInputCompositionStart(compositionString, selectionStart, selectionEnd, isReading): 367c367 < import speech --- >
395-414
: Move import statements to the top of the file.The import statements for
InputComposition
andModernCandidateUICandidateItem
should be at the top of the file to follow best practices.Apply this diff to move the import statements:
395c395 < @WINFUNCTYPE(c_long, c_wchar_p, c_int, c_int, c_int) --- > from NVDAObjects.inputComposition import InputComposition > from NVDAObjects.IAccessible.mscandui import ModernCandidateUICandidateItem > > @WINFUNCTYPE(c_long, c_wchar_p, c_int, c_int, c_int) 398c398 < from NVDAObjects.inputComposition import InputComposition --- >
418-459
: Move import statements to the top of the file.The import statements for
speech
andCandidateItem
should be at the top of the file to follow best practices.Apply this diff to move the import statements:
418c418 < def handleInputCandidateListUpdate(candidatesString, selectionIndex, inputMethod): --- > import speech > from NVDAObjects.inputComposition import CandidateItem > > def handleInputCandidateListUpdate(candidatesString, selectionIndex, inputMethod): 422c422 < import speech --- >
See test results for failed build of commit 1eeabac94e |
Before merging this PR, could you send a message to the translators mailing list and give a deadline for them to provide up-to-date translations? |
|
…rom markdown files.
…g post table header line and hidden header row.
…iff and English skel files.
…skel files if English user documentation markdown files change.
…file so that it is theoretically possible to regenerate the markdown withonly the xliff. generateMarkdown and translateXliff commands now read the skeleton straight from the xliff file, rather than receiving it as an argument.
…anslate commands.
…t child of the file tag.
…nt, as it already reads the skeleton content from the xliff.
See test results for failed build of commit 71f69ee1fd |
See test results for failed build of commit 52b91b3423 |
.github/workflows/regenerate_english_userDocs_translation_source.yml
Outdated
Show resolved
Hide resolved
.github/workflows/regenerate_english_userDocs_translation_source.yml
Outdated
Show resolved
Hide resolved
.github/workflows/regenerate_english_userDocs_translation_source.yml
Outdated
Show resolved
Hide resolved
See test results for failed build of commit 7bd7ab11ff |
See test results for failed build of commit 32ae2bcc24 |
…ce.yml Co-authored-by: Sean Budd <[email protected]>
@coderabbitai resolve |
Link to issue number:
None.
Summary of the issue:
Currently user documentation such as the user guide are made translatable via a custom (and very old) translation system hosted by NV Access. For many reasons we need to move away from this old system to something more mainstream and maintainable. We have already successfully moved translation of NVDA interface messages to Crowdin, and we should do the same for the user guide and other documentation.
Description of user facing changes
None.
Description of development approach
###
and a suffix of{#Intro}
. The skeleton is also embedded into the xliff file so that it is possible to update the xliff file keeping existing translation IDs, and or generate the existing markdown file from the xliff file.Testing strategy:
Known issues with pull request:
None known.
Code Review Checklist:
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Chores