Skip to content

feat: desktop get locale/dialect from Tauri#3509

Merged
elijah-potter merged 4 commits into
Automattic:masterfrom
hippietrail:desktop-dialect-detect
May 28, 2026
Merged

feat: desktop get locale/dialect from Tauri#3509
elijah-potter merged 4 commits into
Automattic:masterfrom
hippietrail:desktop-dialect-detect

Conversation

@hippietrail
Copy link
Copy Markdown
Collaborator

@hippietrail hippietrail commented May 26, 2026

Issues

Closes #3501

Description

Sets the Dialect for Harper Desktop from the system using the official Tauri method.

How Has This Been Tested?

  • Manually - let me know if you can think of a way to make any unit test(s) or integration test(s)
  • cargo test
  • just build-desktop-macos then installing the newly build app, running it, going into prefs, and seeing this: Screenshot 2026-05-26 at 1 33 57 pm

AI Disclosure

  • I am a human and didn't use any AI.
  • I used LLM features of my editor, but not an agent.
  • I used an AI agent interactively.
  • I am an agent or I got an agent to do the work autonomously.

Actually I used Google AI to help choose which method to use and to finesse the code to something tiny and Rusty.

Checklist

  • I have performed a self-review of my own code
  • I have added tests to cover my changes
  • I have considered splitting this into smaller pull requests.

@hippietrail hippietrail added enhancement New feature or request rust Pull requests that update Rust code desktop labels May 26, 2026
@hippietrail
Copy link
Copy Markdown
Collaborator Author

hippietrail commented May 26, 2026

Building the unsigned one locally via just I got this error:

   Compiling harper-dictionary-wordlist v2.2.1 (/Users/hippietrail/harper-the-third/harper/harper-dictionary-wordlist)
    Finished `release` profile [optimized] target(s) in 7m 00s
       Built application at: /Users/hippietrail/.hippietrail/cargo-harper-consumers/universal-apple-darwin/release/harper-desktop
    Bundling harper-desktop.app (/Users/hippietrail/.hippietrail/cargo-harper-consumers/universal-apple-darwin/release/bundle/macos/harper-desktop.app)
    Bundling harper-desktop_2.2.1_universal.dmg (/Users/hippietrail/.hippietrail/cargo-harper-consumers/universal-apple-darwin/release/bundle/dmg/harper-desktop_2.2.1_universal.dmg)
     Running bundle_dmg.sh
       Error failed to bundle project error running bundle_dmg.sh: `failed to run /Users/hippietrail/.hippietrail/cargo-harper-consumers/universal-apple-darwin/release/bundle/dmg/bundle_dmg.sh`
error: Recipe `build-desktop-macos-unsigned` failed with exit code 1

Still waiting for the signed build to complete, but in the meantime the macOS CI build has succeeded so marking this as ready for review:
image

@hippietrail hippietrail marked this pull request as ready for review May 26, 2026 05:25
Copy link
Copy Markdown
Collaborator

@elijah-potter elijah-potter left a comment

Choose a reason for hiding this comment

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

This is exactly how I would have gone about this. Thank you! I just have one nit.

Comment thread harper-core/src/dict_word_metadata.rs Outdated
}
}
// BCP-47 https://www.rfc-editor.org/rfc/rfc5646
#[must_use]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This annotation is not necessary.

Copy link
Copy Markdown
Collaborator Author

@hippietrail hippietrail May 27, 2026

Choose a reason for hiding this comment

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

At first I thought you meant the comment. I didn't really get what #[must_use] does and asked an AI if this function need one too. So much for that d-:

}
}

pub fn detect_system_dialect() -> Dialect {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Great!

Copy link
Copy Markdown
Collaborator

@elijah-potter elijah-potter left a comment

Choose a reason for hiding this comment

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

Looks great! Thank you!

@elijah-potter elijah-potter added this pull request to the merge queue May 27, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks May 27, 2026
@elijah-potter elijah-potter enabled auto-merge May 28, 2026 19:27
@elijah-potter elijah-potter added this pull request to the merge queue May 28, 2026
Merged via the queue into Automattic:master with commit d05fdec May 28, 2026
13 checks passed
@hippietrail hippietrail deleted the desktop-dialect-detect branch May 29, 2026 02:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

desktop enhancement New feature or request rust Pull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Harper Desktop for Mac defaults to American English rather than getting the default dialect from the OS

2 participants