You are not logged in.

#1 2019-09-22 13:33:00

clusterF
Member
Registered: 2019-05-07
Posts: 260

Translate

Im trying to use grmls .zshrc and use the translate function, im a bit lost on the en-de dictionary side of things, de-en works ok.

# Translate DE<=>EN
# 'translate' looks up a word in a file with language-to-language
# translations (field separator should be " : "). A typical wordlist looks
# like the following:
#  | english-word : german-translation
# It's also only possible to translate english to german but not reciprocal.
# Use the following oneliner to reverse the sort order:
#  $ awk -F ':' '{ print $2" : "$1" "$3 }' \
#    /usr/local/lib/words/en-de.ISO-8859-1.vok > ~/.translate/de-en.ISO-8859-1.vok
#f5# Translates a word
function trans () {
    emulate -L zsh
    case "$1" in
        -[dD]*)
            translate -l de-en $2
            ;;
        -[eE]*)
            translate -l en-de $2
            ;;
        *)
            echo "Usage: $0 { -D | -E }"
            echo "         -D == German to English"
            echo "         -E == English to German"
    esac
}

When i try trans -E hello i get...

~ % trans -E hello
translate: Global dictionary /usr/share/trans/en-de does not exist or is not readable!
translate: Fallback to $HOME/.translate/en-de is not posible.
No dictionaries exist!

I have translate which pulls in the de-en dictionary but not the en-de?

Not sure what im missing here or how to enable en-de ??


"Thou Wanderer, Father of all! Thou Wanderer, Spirit of all!"

Offline

#2 2019-09-22 15:42:41

ohnonot
...again
Registered: 2015-09-29
Posts: 4,135
Website

Re: Translate

who or what provides the translate program? Is it a zsh builtin? Otherwise this isn't really zsh-specific, no?

Offline

#3 2019-09-23 09:42:29

clusterF
Member
Registered: 2019-05-07
Posts: 260

Re: Translate

^ Not a zsh builtin and not zsh specific i dont believe, that is just a wrapper function in .zshrc. There is the German-English dictionary package trans-de-en but no trans-en-de that i can find. Saying that though the translate package should translate either way i think but get that error message when i use the function and the command

translate -l en-de hello

translate = https://packages.debian.org/buster/translate
trans-de-en = https://packages.debian.org/buster/trans-de-en

Just thought someone may be able to help point me in the right direction.

Last edited by clusterF (2019-09-23 10:15:30)


"Thou Wanderer, Father of all! Thou Wanderer, Spirit of all!"

Offline

#4 2019-09-23 10:10:10

clusterF
Member
Registered: 2019-05-07
Posts: 260

Re: Translate

Figured it out maybe. In /etc/translate.conf

LANGUAGE=de-en
GLOBDIR=/usr/share/trans
DONT_ASK=false
INVERS=false

changing INVERS=true spits out the required albeit long translation...

translate -l de-en hello     
jdn. grüßen; jdn. begrüßen {vt} [soc.] | grüßend; begrüßend | gegrüßt; begrüßt | er/sie grüßt | ich/er/sie grüßte | er/sie hat/hatte gegrüßt | jdn. höflich grüßen | jdn. mit einem Lächeln begrüßen | Grüß deine Tante von mir. :: to greet sb.; to say hello to sb.; to salute sb. (old-fashioned) | greeting; saying hello; saluting | greeted; said hello; saluted | he/she greets | I/he/she greeted | he/she has/had greeted | to greet sb. in a polite way. | to salute sb. with a smile | Say hello to your aunt for me.
etw. sagen; etw. äußern {vt} [ling.] | sagend; äußernd | gesagt; geäußert | er/sie sagt | ich/er/sie sagte | er/sie hat/hatte gesagt | ich/er/sie sagte | (jdm.) guten Tag sagen | man sagt | etw. laut sagen | wie man zu sagen pflegt | wie er zu sagen pflegte | wie man so sagt; wie es so schön heißt | ganz im Vertrauen gesagt; jetzt einmal ganz unter uns | Der Vorschlag besagt, dass ... | jdm. etw. durch die Blume sagen [übtr.] | jdm. etw. durch die Blume zu verstehen geben [übtr.] | Nun, was soll ich dazu sagen? | Das kann ich dir sagen! | Das kannst du laut sagen.; Das kann man wohl sagen. | Das ist leichter gesagt als getan. | Entschuldigung, können Sie bitte Ihren Namen noch einmal sagen? | Ich kann nur Gutes über sie sagen/berichten. | Was Sie nicht sagen!; Was du nicht sagst! | Sie wechselten keine Worte. | Sag Halt! (beim Einschenken) | Hab ich (denn) etwas anderes gesagt?; Hab ich etwas anderes behauptet? :: to say sth. {said; said} | saying | said | he/she says (saith [obs.]) | I/he/she said | he/she has/had said | I/he/she would say | to say hello (to sb.) | people say | to say sth. out loud | as they say | as he was wont to say | as the saying goes | between you and me and the bedpost/gatepost/wall [Br.] | The proposal says/states that ... | to say sth. in a roundabout way to sb. | to drop a veiled hint to sb. about sth. | Well, what shall I say to this? | You can be sure of that! | You can say that again. | That's easier said than done. | Excuse me, can you please say your name again? | I only have good things to say about her. | You don't say (so)! | Nothing was said between them. | Say when!; Say when stop! (when pouring) | Did I say anything different?
über {prp; wo? +Dat.; wohin? +Akk.} | über den / übern [ugs.] Wolken sein | über die Straße gehen | quer über das Feld | Ich ging hinüber, um ihn zu begrüßen. | Mein Cousin kommt nächste Woche aus Spanien herüber. | Es gibt nur fünf Boote, einige werden also hinüberschwimmen müssen. :: above (where?); over (where or where to?); across (where to?) | to be above the clouds | to go across the road | right across the field | I went over to say hello to him. | My cousin is coming over from Spain next week. | There are only five boats, so some people will have to swim over.
wohl aber; sehr wohl aber (Relativierung einer vorangegangenen Negation) | Ich habe ihn nie als Hamlet gesehen, wohl aber als Othello. | Bei uns gibt es so etwas nicht, sehr wohl aber in Amerika. :: however/but ... do + verb | I never saw his Hamlet. However, I did see his Othello. | We don't have anything like that here, but they do in America.
Hallo allerseits! :: Hello everybody!
Hallo! :: Hi!; Hello!
Hallo!; Guten Tag!; Moin! [Norddt.] :: Hello!
'Othello' (von Shakespeare / Werktitel) [lit.] :: 'Othello, the Moor of Venice' (by Shakespeare / work title)


"Thou Wanderer, Father of all! Thou Wanderer, Spirit of all!"

Offline

Board footer

Powered by FluxBB