pacmax beta

Alfred Pac by dennis-tra on GitHub

dict.cc

🌍 Alfred 4/5 workflow to get translations from dict.cc

From their README

Alfred dict.cc workflow

Github All Releases Maintainability

Alfred workflow to get bidirectional translations from dict.cc.

If you like the workflow give this repo a star ⭐

Example animation

And if it saves you time you may consider to

Buy Me A Coffee

Table of Contents

Download

Click here and download Dict.cc.alfredworkflow.

Installation

Just double click the Dict.cc.alfredworkflow file and Alfred should pick it up automatically.

Permissions

Since Catalina, you need to tell MacOS that it's okay to run the included binaries. For that, you have the following two options:

Give execute permissions to the included binaries

Open the workflow directory

Open workflow directory

Right click on the dictcc_* binary for your platform (Intel Macs dictcc_amd64, M1 Macs dictcc_arm64) and select Open in the pop up.

Open dictcc binary

This will open a Terminal window and you should see an error message. However, you have now indicated to MacOS that it's okay to run the binary.

Close all windows and you're good to go.

Give execute permissions to Alfred in general

Beware that the following configuration applies to all workflows you have currently installed and all future ones.

Security & Privacy Setup

Why do I need to do that?

Since MacOS Catalina Apple does not allow running arbitrary binaries unless they are notarized. Developers can notarize their binaries if they enroll for the Apple Developer Program which is around $100 per year. Since I am not enrolled, I can't notarize the binaries, and we need to live with the above inconvenience :/

Supported Languages

English, German, French, Swedish, Spanish, Bulgarian, Romanian, Italian, Portuguese, Russian

Command

dict lang1 lang2 word_to_translate

You can omit lang1 and lang2 to just translate between german and english (both directions!). See below to customise the default language pair.

Possible values for lang1 and lang2:

Abbreviation Language
en, eng english
de, ger german
fr, fra french
sv, swe swedish
es, esp spanish
bg, bul bulgarian
ro, rom romanian
it, ita italian
pt, por portuguese
ru, rus russian

Default Language Pair

You may not want the translations to be between english and german by default. To change this behaviour open the Alfred preferences, go to Workflows, select Dict.cc and click on the Configure workflow and variables button in the top right corner.

Default language setup step 1

You should find the following two workflow environment variables:

  1. from_language
  2. to_language

Default language setup step 2

Assign both variables one of the above abbreviations (either the two letter or three letter form). In the screenshot above the configuration says

  • from_language - fra
  • to_language - en

to translate between french and english by default.

Note: Although the variables are named from_ and to_ the translations will be bidirectional, so the order shouldn't really matter.

Development

Build the workflow:

GOOS=darwin GOARCH=arm64 go build -o dictcc_arm64 main.go
GOOS=darwin GOARCH=amd64 go build -o dictcc_amd64 main.go

Move both binaries to the workflow folder. For development I'd recommend symlinking them.

Maintainers

@dennis-tra.

Contributing

Feel free to dive in! Open an issue or submit PRs.

Support

It would really make my day if you supported this project through Buy Me A Coffee.

Other Projects

You may be interested in one of my other projects:

  • nebula - A libp2p DHT crawler that also monitors the liveness and availability of peers. 🏆 Winner of the DI2F Workshop Hackathon 🏆
  • pcp - Command line peer-to-peer data transfer tool based on libp2p.
  • image-stego - A novel way to image manipulation detection. Steganography-based image integrity - Merkle tree nodes embedded into image chunks so that each chunk's integrity can be verified on its own.

License

Apache License Version 2.0 © Dennis Trautwein

Latest release

  • 2.1.12 years ago, 8.6 MBDownload

    [!IMPORTANT]
    This release bundles unnotarized binaries. You need to follow these steps.

    Release 2.1.1

    This release addresses #19. Dict.cc started to return:

    Please don't run crawlers against dict.cc and don't try to make the dictionary available offline.
    

    which resulted in all queries returning "word" not found. This isn't returned if a user agent on the HTTP request is set. Since this workflow is not crawling dict.cc nor is making it available offline, this release sets the user agent to alfred-dict.cc-workflow. The rational is, I don't want to upset the operators of dict.cc, so if it's really this workflow that poses a problem it's easy for them to block this user-agent again. In this case, I'll try to reach out to them and try to find a solution.

    Support

    And finally, if this workflow saves you time, it would really make my day and gives you Karma points if you considered to

    <a href="https://www.buymeacoffee.com/dennistra" target="__blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: 41px !important;width: 174px !important;box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;" ></a>

10 earlier releases
  • 2.1.03 years ago, 8.1 MBDownload

    Release 2.1.0

    This release makes the workflow compatible with macOS Sonoma, hooks it up with Universal Actions, allows the configuration of hotkeys, and bundles notarized binaries.

    Changelog

    • MacOS Sonoma compatibility: Sonoma bundles a new version of the iconv tool, breaking the current workflow because it uses different constants for character set conversions. The fix is to use the new constants and fall back to the old ones if that fails to preserve backward compatibility. Thanks to @mario-hab for reporting and @muffix for fixing (#16/#13).
    • Universal Actions/Hotkeys: You can use Alfred's Universal Actions feature to translate selected text from anywhere. Get started in Preferences > Features > Universal Actions. Thanks to @muffix for adding this feature.
    • Hotkeys: You can configure keyboard hotkeys to trigger the workflow directly for the current selection or clipboard contents. Navigate to the workflow configuration and double-click any of the two Hotkey triggers to configure the hotkey combination you want to use: Screenshot 2023-10-03 at 10 40 54 Thanks to @muffix for adding this feature.
    • Notarized Binaries: I signed the included binaries, which means that the steps in README.md#Permissions should become obsolete. My developer account expires in less than 30d and I don't plan to renew it, though. I'm not sure if it means that the notarization also expires. Therefore, I'm keeping the README.md#Permissions description for now.

    Support

    And finally, if this workflow saves you time, it would really make my day and gives you Karma points if you considered to

    <a href="https://www.buymeacoffee.com/dennistra" target="__blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: 41px !important;width: 174px !important;box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;" ></a>

  • 2.0.04 years ago, 7.2 MBDownload

    Release 2.0.0

    This release makes the workflow compatible with macOS Monterey.

    Formerly, the workflow depended on Python 2, which is not distributed anymore with MacOS Monterey. Version 2.0.0 is a complete rewrite that ported the Workflow from Python 2 to Go. You can find more information in this issue.

    Changelog

    • Workflow is rewritten in Go. This has the implication that you need to give execute permissions to the included Go-binaries. You can find the instructions and further information in the README.
    • Alfred 4 only. However, the workflow should also work on Alfred 3. I'm just not able to generate a compatible export as I'm already on Alfred 4. If you need Alfred 3 support feel free to file an issue, and maybe someone can jump in and help out.
    • Added alternative actions (press ⌘ or ⌥) to open dict.cc in the browser for the given query

    Support

    And finally, if this workflow saves you time, it would really make my day and gives you Karma points if you considered to

    <a href="https://www.buymeacoffee.com/dennistra" target="__blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: 41px !important;width: 174px !important;box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;" ></a>

  • 2.0.0-rc44 years ago, 7.2 MBDownload

    This is a pre-release to see how things fly.

    I've rewritten the Workflow in Go to eliminate the Python 2 dependency. More information can be found in this issue.

    If you have any feedback, feel free to comment in issue https://github.com/dennis-tra/alfred-dict.cc-workflow/issues/8

    Things that have changed:

    • In this pre-release the workflow is only compatible with Alfred 4. However, the workflow should also work on Alfred 3. I'm just not able to generate a compatible export as I'm already on Alfred 4. If you need Alfred 3 support feel free to file an issue and maybe someone can jump in and help out. I'm happy to explain the necessary steps.
    • Because the workflow contains a binary from an arbitrary developer (me) MacOS won't let you run it unless you explicitly allow it. The instructions can be found in the README.

    And finally, if this workflow saves you time you may consider to sponsor me or

    <a href="https://www.buymeacoffee.com/dennistra" target="__blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: 41px !important;width: 174px !important;box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;" ></a>


    Changes to 2.0.0-rc3:

    • Fix: Parse escaped single quotes
    • Added alternative actions (press ⌘ or ⌥) to open dict.cc in the browser for the given query

    Changes to 2.0.0-rc2:

    • Fix "out of range exception" for words like foo or foot

    Changes to 2.0.0-rc1:

    • Detect platform in Alfred's script filter
  • 2.0.0-rc34 years ago, 7.2 MBDownload

    This is a pre-release to see how things fly.

    I've rewritten the Workflow in Go to eliminate the Python 2 dependency. More information can be found in this issue.

    If you have any feedback, feel free to comment in issue https://github.com/dennis-tra/alfred-dict.cc-workflow/issues/8

    Things that have changed:

    • In this pre-release the workflow is only compatible with Alfred 4. However, the workflow should also work on Alfred 3. I'm just not able to generate a compatible export as I'm already on Alfred 4. If you need Alfred 3 support feel free to file an issue and maybe someone can jump in and help out. I'm happy to explain the necessary steps.
    • Because the workflow contains a binary from an arbitrary developer (me) MacOS won't let you run it unless you explicitly allow it. The instructions can be found in the README.

    And finally, if this workflow saves you time you may consider to sponsor me or

    <a href="https://www.buymeacoffee.com/dennistra" target="__blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: 41px !important;width: 174px !important;box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;" ></a>


    Changes to 2.0.0-rc2:

    • Fix "out of range exception" for words like foo or foot

    Changes to 2.0.0-rc1:

    • Detect platform in Alfred's script filter
  • 2.0.0-rc24 years ago, 7.2 MBDownload

    This is a pre-release to see how things fly.

    I've rewritten the Workflow in Go to eliminate the Python 2 dependency. More information can be found in this issue.

    If you have any feedback, feel free to comment in issue https://github.com/dennis-tra/alfred-dict.cc-workflow/issues/8

    Things that have changed:

    • In this pre-release the workflows are only compatible with Alfred 4. However, the workflow should also work on Alfred 3. I'm just not able to generate a compatible export as I'm already on Alfred 4. If you need Alfred 3 support feel free to file an issue and maybe someone can jump in and help out. I'm happy to explain the necessary steps.
    • Because the workflow contains a binary from an arbitrary developer (me) MacOS won't let you run it unless you explicitly allow it. The instructions can be found in the README.

    And finally, if this workflow saves you time you may consider to sponsor me or

    <a href="https://www.buymeacoffee.com/dennistra" target="__blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: 41px !important;width: 174px !important;box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;" ></a>


    Changes to 2.0.0-rc1:

    • Detect platform in Alfred's script filter
  • 2.0.0-rc14 years ago, 3.5 MBDownload

    This is a pre-release to see how things fly.

    I've rewritten the Workflow in Go to eliminate the Python 2 dependency. More information can be found in this issue.

    If you have any feedback, feel free to comment in issue https://github.com/dennis-tra/alfred-dict.cc-workflow/issues/8

    Things that have changed:

    • In this pre-release the workflows are only compatible with Alfred 4. However, the workflow should also work on Alfred 3. I'm just not able to generate a compatible export as I'm already on Alfred 4. If you need Alfred 3 support feel free to file an issue and maybe someone can jump in and help out. I'm happy to explain the necessary steps.
    • There are now two workflow files. Dict.cc.x86_64.alfredworkflow contains the binary for Apples Intel chips and Dict.cc.arm64.alfredworkflow contains the binary for Apples M1 chips. Choose the workflow for your platform. The final release could contain a step that checks the platform and then chooses the right binary automatically.
    • Because the workflow contains a binary from an arbitrary developer (me) MacOS won't let you run it unless you explicitly allow it. The instructions can be found in the README.

    And finally, if this workflow saves you time you may consider to sponsor me or

    <a href="https://www.buymeacoffee.com/dennistra" target="__blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: 41px !important;width: 174px !important;box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;" ></a>

  • 1.1.06 years ago, 906 KBDownload

    In this release a feature is added that lets you configure the default language pair.

    Consult the README.md for the configuration instructions.

  • 1.0.27 years ago, 907 KBDownload
  • 1.0.19 years ago, 905 KBDownload

    This is a bugfix release of the full functional Dict.cc translation workflow for Alfred 3.4.1.

  • 1.0.010 years ago, 1.1 MBDownload

    This is the first release of the full functional Dict.cc translation workflow for Alfred.