Giter VIP home page Giter VIP logo

trans's Introduction

trans

a small and fast translator living in macOS menu bar

前几天在macOS的App Store上看到一个叫「小翻译」的应用:

觉得挺简单的,监控剪贴板再随便调用一个在线翻译的API就行了。但是蓝色的图标放菜单太违和了。就想着自己能不能也做一个,于是「trans」就出来了。

和小翻译一样,trans也是一个菜单栏应用,目前支持输入搜索和复制搜索,搜索调用的接口是百度翻译的API。

点击菜单栏的图标可「输入搜索」:

保持后台开启,剪贴板变动的时候触发「复制搜索」,鼠标移到通知可复制翻译结果:

设想的应用场景和优势:

  1. 浏览网页、文档时。由于是Application作为载体,所以相比于浏览器的划词翻译有更宽泛的使用场景。
  2. 不需要精准翻译和单词管理时。相比欧路词典、有道词典更加轻量化,仅500KB,无论是磁盘还是内存占用都可忽略不计。
  3. 希望获得更原生更自然的体验时。使用Swift语言开发的native应用,macOS原生控件。不需要的时候分分钟泯然众应用中。
  4. 更安全,更隐私。由于能力不足没有历史记录等记录数据的功能,唯一的网络请求是GET百度翻译的API。
  5. 调用百度翻译,相比内置词典有更全和更不准确的词库。

第一次接触macOS开发,由于是兴趣开发所以之后更不更新就随缘了,可能和稻米鼠停更他的公众号一样就再也不更新了。

梦想中的TO DO:

  • 复制翻译
  • 输入搜索翻译
  • 设置-开机自启
  • 设置-原文语言和目标语言
  • 设置-API选择和Token设置
  • 第一次开启应用时不弹Popover
  • 输入翻译时的TextFiled显示优化
  • 快捷键翻译

图标是在阿里爸爸的iconfont上找的,用Sketch做了个白色描边以适应暗黑模式。

源码放在Github上,感兴趣的朋友可以自取,完全没有macOS基础开发的应用完全不遵守MVC也请多担待了。

想基于trans开发的小白朋友们可以参考:

trans's People

Contributors

rhinoc avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.