Skip to content

Use static ids in Poedit 3.5+#16889

Merged
seanbudd merged 14 commits into
nvaccess:betafrom
LeonarddeR:poeditStaticIds
Sep 2, 2024
Merged

Use static ids in Poedit 3.5+#16889
seanbudd merged 14 commits into
nvaccess:betafrom
LeonarddeR:poeditStaticIds

Conversation

@LeonarddeR
Copy link
Copy Markdown
Collaborator

@LeonarddeR LeonarddeR commented Jul 20, 2024

Link to issue number:

Related to vslavik/poedit#850

Summary of the issue:

The Poedit appmodule relies on some complex calculation logic to announce several pieces of information with shortcuts, e.g. translator notes/comments/warnings.

Description of user facing changes

None

Description of development approach

@vslavik kindly introduced static ids for the controls we need for our appModule. That work is in vslavik/poedit#850

Testing strategy:

Test with https://download.poedit.net/tmp/Poedit-3.5nvda-setup.exe

  • Translation warnings
  • Commments
  • Old source text
  • Translator notes
  • Pro version
  • Different languages with one or more plural forms

Known issues with pull request:

Breaks compatibility with Poedit versions before this fix, but should stay compatible with all versions to come, as long as these ids stay static.

Code Review Checklist:

  • Documentation:
    • Change log entry
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English
  • API is compatible with existing add-ons.
    -x[ ] Security precautions taken.

Summary by CodeRabbit

  • New Features

    • Consolidated control ID management into a single class for improved maintainability and clarity.
    • Streamlined method signatures for retrieving objects associated with control IDs.
  • Bug Fixes

    • Refined string formatting in the CancellableSpeech class to improve output consistency.
  • Refactor

    • Removed redundant classes and updated method implementations to enhance code readability and structure.

@LeonarddeR
Copy link
Copy Markdown
Collaborator Author

@ruifontes I recall you have the pro version. Would you be able to test with this build of poedit along with this pr?

@CyrilleB79
Copy link
Copy Markdown
Contributor

@LeonarddeR in addition, would you test strings with plurals for:

  • languages with 2 forms (e.g. English); probably already done
  • language with only one form (e.g. Chinese)
  • language with more than 2 forms, e.g. Slovenian.

@vslavik
Copy link
Copy Markdown

vslavik commented Jul 22, 2024

@LeonarddeR in addition, would you test strings with plurals for:

Ah, this is something I meant to ask: do you need static IDs for some or all of the text fields (source plural + singular; translation singular or translation plurals (variable count))?

@LeonarddeR
Copy link
Copy Markdown
Collaborator Author

I don't think we need these now, but people might have different opinions about that

@vslavik
Copy link
Copy Markdown

vslavik commented Jul 26, 2024

I don't think we need these now, but people might have different opinions about that

OK, so let's only add fixed IDs when they become useful for something (feel free to e.g. add comment there to file an issue at poedit in such cases).

@seanbudd seanbudd added the conceptApproved Similar 'triaged' for issues, PR accepted in theory, implementation needs review. label Jul 30, 2024
@LeonarddeR LeonarddeR marked this pull request as ready for review August 21, 2024 09:47
@LeonarddeR LeonarddeR requested a review from a team as a code owner August 21, 2024 09:47
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Aug 21, 2024

Walkthrough

The recent updates streamline the poedit.py module by consolidating control ID management into a single class, _WindowControlId. This change simplifies method signatures and enhances code clarity by replacing outdated naming conventions. Additionally, minor adjustments in formatting were made to the CancellableSpeech class in commands.py, improving string representation without affecting functionality.

Changes

Files Change Summary
source/appModules/poedit.py Restructured control ID management by renaming _WindowControlIdOffsetFromDataView to _WindowControlId, removing _WindowControlIdOffsetFromSidebar, and updating related method signatures for clarity and maintainability.
source/speech/commands.py Modified string formatting in the __repr__ method of the CancellableSpeech class to remove unnecessary space before the closing brace, enhancing output appearance.

Tip

Early access features: enabled

We are currently testing the following features in early access:

  • Anthropic claude-3-5-sonnet for code reviews: Anthropic claims that the new Claude model has stronger code understanding and code generation capabilities than their previous models. We're excited to hear your feedback as we evaluate its performance over the next few days.

Note:

  • You can enable or disable early access features from the CodeRabbit UI or by updating the CodeRabbit configuration file.
  • Please join our Discord Community to provide feedback and report issues on the discussion post.

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?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@LeonarddeR
Copy link
Copy Markdown
Collaborator Author

vslavik/poedit#850 was just merged.

@CyrilleB79
Copy link
Copy Markdown
Contributor

If the first compatible poedit version changes with this PR, it should be mentioned in the change log.

@LeonarddeR LeonarddeR added this to the 2024.4 milestone Aug 21, 2024
@LeonarddeR
Copy link
Copy Markdown
Collaborator Author

The first compatible version is not yet released. @vslavik is not sure about its release date.
That said, the milestone for 2024.4 is due october 28, I guess it is safe to assume that version 3.5 will be release before then.

@CyrilleB79
Copy link
Copy Markdown
Contributor

This PR can be reviewed but it should not be merged until poedit 3.5 is available.

@LeonarddeR LeonarddeR changed the base branch from master to beta August 29, 2024 16:06
@LeonarddeR
Copy link
Copy Markdown
Collaborator Author

@seanbudd This pr needs to go in the earliest possible release after the release of Poedit 3.5, which release date is unfortunately not yet known.

@vslavik
Copy link
Copy Markdown

vslavik commented Aug 29, 2024

Poedit 3.5, which release date is unfortunately not yet known.

August 30.

@SaschaCowley
Copy link
Copy Markdown
Member

@LeonarddeR will Poedit 3.5 support be broken without this PR?

Copy link
Copy Markdown
Member

@seanbudd seanbudd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally looks good to me

Comment thread source/appModules/poedit.py Outdated
Comment thread source/appModules/poedit.py
@LeonarddeR
Copy link
Copy Markdown
Collaborator Author

@LeonarddeR will Poedit 3.5 support be broken without this PR?

Yes.

Co-authored-by: Sean Budd <seanbudd123@gmail.com>
Comment thread user_docs/en/changes.md
Comment thread user_docs/en/changes.md Outdated
Copy link
Copy Markdown
Member

@seanbudd seanbudd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note changes to liblouis have been pushed

@LeonarddeR
Copy link
Copy Markdown
Collaborator Author

@seanbudd wrote:

note changes to liblouis have been pushed

How are those changes related to this pr?

@seanbudd
Copy link
Copy Markdown
Member

@LeonarddeR - you may have committed something by mistake it was pushed in e91216d

@LeonarddeR
Copy link
Copy Markdown
Collaborator Author

I'm sorry. Should've been fixed now.

@LeonarddeR
Copy link
Copy Markdown
Collaborator Author

Poedit 3.5 is there!

Copy link
Copy Markdown
Member

@SaschaCowley SaschaCowley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please edit the Poedit section of the User Guide to state version 3.5 is the minimum supported version.

@SaschaCowley SaschaCowley requested a review from a team as a code owner September 2, 2024 00:42
@seanbudd seanbudd merged commit 4015f1c into nvaccess:beta Sep 2, 2024
@LeonarddeR LeonarddeR deleted the poeditStaticIds branch August 23, 2025 06:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app-specific conceptApproved Similar 'triaged' for issues, PR accepted in theory, implementation needs review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants