ProductPromotion
Logo

Ruby

made by https://0x3d.site

GitHub - pawurb/termit: Translations with speech synthesis in your terminal as a ruby gem
Translations with speech synthesis in your terminal as a ruby gem - pawurb/termit
Visit Site

GitHub - pawurb/termit: Translations with speech synthesis in your terminal as a ruby gem

GitHub - pawurb/termit: Translations with speech synthesis in your terminal as a ruby gem

Termit Build Status Gem Version Coverage Status

Termit is an easy way to translate stuff in your terminal. You can check out its node.js npm version normit.

Installation

gem install termit

Usage

termit 'source_language' 'target_language' 'text'

Example:

termit en es "hey cowboy where is your horse?"
=> "Hey vaquero dónde está tu caballo?"

termit fr en "qui est votre papa?"
=> "Who's Your Daddy?"

Quotation marks are not necessary for text data input:

termit fr ru qui est votre papa
=> "Кто твой папочка?"

Speech synthesis

Specify a -t (talk) flag to use speech synthesis (requires mpg123):

termit en fr "hey cowboy where is your horse?" -t
=> "Hey cowboy où est votre cheval ?" # and a french voice says something about a horse

You can use termit as a speech synthesizer of any supported language without having to translate anything:

termit en en "hold your horses cowboy !" -t
=> "hold your horses cowboy !" # and an english voice asks you to hold on

Learning language when committing to git

Idea by Nedomas. See and hear your messages translated to target lang every time you commit. You can do this two ways: overriding the git command, and using a post-commit hook in git.

Override the git command (zsh only)

In ~/.zshrc

export LANG=es
git(){[[ "$@" = commit\ -m* ]]&&termit en $LANG ${${@:$#}//./} -t;command git $@}

I am no shell ninja so if you know how to make it work in bash then please submit a PR.

Using a post-commit hook

Add a file named post-commit to your project's .git/hooks directory, with this in it:

termit en es "`git log -1 --pretty=format:'%s'`" -t

Remember to switch the languages according to your preference.

If you want this to be in every one of your git repositories, see this Stack Overflow answer.

Language codes:

To find all available language codes visit https://msdn.microsoft.com/en-us/library/hh456380.aspx

Requirements

Works with Ruby 1.9.2 and higher.

To use speech synthesis you need to have mpg123 installed.

For Ubuntu:

sudo apt-get install mpg123

For MacOSX:

brew install mpg123

Status

It was rewritten to work with Bing Translator . Thanks to Ragnarson for supporting it !

Disclaimer

Termit works by scraping the private APIs and is therefore not recommended for use in production or on a large scale.

More Resources
to explore the angular.

mail [email protected] to add your project or resources here 🔥.

Related Articles
to learn about angular.

FAQ's
to learn more about Angular JS.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory