• Forum
  • Lounge
  • Translating from English to German and S

 
Translating from English to German and Spanish for console program.

Pages: 12
I know this may sound like asking for a lot but I really do appreciate any one that can help. Since I know many of you are from various parts of the world, I thought this would be a good place to start.
Sorry if this seems out of place, and sorry again for seeming to for help when I could probably do it on my own. Its just that when using dictionaries or online translators, you can never be sure if you've choosen the right word, (especially while still learning a language like I am. )

I have this language class that lets the user type something like
1
2
3
english << "Hello World!\n";
german << "Hallo Weld!\n";
spanish << "Hola Mundo!\n; 


and it outputs just one line, the line that the language object is set to. I'll be gladly willing to share my language class with anyone who helps me with the following:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
cout << "Please enter your key.\n";
cout << "encrypting or decrypting a message?\n";
cout << "0 for encryption 1 for decryption \n";
cout << "enter a plaintext message to (en/de)crypt.\n;"

cout << "Please enter installation password to continue\n";

cout << "plaintext = " << plain << endl;
cout << "\nciphertext = " << CIPHER << endl;
cout << "\nAgain?\n1 To continue. or 2. to exit.\n>";
cout<< "\nKeep your current key?\n1 To keep, or 2 to change.\n>";

cout << "Sorry the installer for this program has expired.  Please obtain a replacement from your vendor.  You will have 7 days to activate your product. " << endl;
cout << "Sorry incorrect password. " << endl;
cout << "Sorry you must have administration rights to install this program. " << endl;
cout << "Sorry the evaluation period for this software has expired. " << endl << "Please purchase to unlock. " << endl;


Here 'Main numbers' refer to like the white balls in the Powerball and MegaMillions lottery games available in the USA, and Power Ball refers to like the red balls in those 2 games.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
cout << "Your Main Numbers in the order in which they were drawn are " << endl;
cout << endl << "your Power Numbers are " << endl;;
 cout << "Your main numbers in ascending order are \n " << endl;;
 cout << "Your power numbers in ascending order are \n " << endl;;

cout << "How many sets of numbers would you like to generate for this game?\n";
cout << "Go back to main menu? Y / N " << endl;

 cout << "Welcome to beta trial of my new Random Lottery Number Generator Software Package. " << endl;
    _1:
    cout << "At any time Press 'Ctrl - C' to exit. " << endl << endl;;
    cout << "If you would like to have your Lottery Numbers displayed in Ascending Order please press 1.  (Return) " << endl;
    cout << "If you would like to have your Lottery Numbers displayed in the order in which they were generated please press 2.  (Return) " << endl;
    cout << "To have your numbers displayed in both ascending order and in the order generated, press 3. (Return) " << endl;


Here 'Lotto Machine' means, like a " 'Ping Pong Ball Machine' Simulator " or a "Whaddyacallit". I appreciate suggestions on what to call it in English too.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

cout << "Press 1 if you would like to use the Lotto Machine. " << endl;
    cout << "Press 2 if you would like to generate from pseudo random number generator. " << endl;
    cout << "Method 2 involves the least user interaction. " << endl;
cout << "However method 1 provides the most random results. \n"; 

 cout << endl << "Press 1 if you would like to display to the screen only.  " << endl;
    cout << "Press 2 if you would like to save to file also.  " << endl;

 cout << "enter name of file " << endl;

cout << "What is the Range of your main numbers?  " << endl;
cout << "Are these main numbers allowed to duplicate? 1 for yes 2 for no. " << endl; 
If the main numbers start with & include '0', enter 0.  Other wise enter the interval above 0 at which the main numbers start.  (So for PowerBall or Mega Millions type games you would enter 1. " << endl;
cout << "Invalid Selection.  " << endl;

    cout << "Press 1 to toggle 'Ascending Order' option.  " << endl;
    cout << "Press 2 to toggle Method option.  " << endl;
    cout << "Press 3 to toggle file output option.  " << endl;
    cout << "Press 10 to go back.  " << endl;

cout << "ordinal_choice = " << ordinal_choice << " " << endl;
cout << "method_choice = " << method_choice << " " << endl;
cout << "file_choice = " << file_choice << " " << endl;

 


Thanks again and sorry if it seems like I'm being lazy. I just don't want the end users to suffer any akward moments trying to understand my very bad spanish or german.

Thanks!
Last edited on
I apologize, but I don't see a question. Are you asking for translators?
"World" in German is "welt".
Hey whadyaknow. I just freetranslation.com'ed it and your right. World is 'welt' in German. Just goes to show how much I am in need of a translator.
knock knock knock
well, german:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
cout << "Bitte Schlüssel eingeben.\n";
cout << "Verschlüsseln oder Entschlüsseln einer Nachricht?\n";
cout << "0 für Verschlüsseln 1 für Entschlüsseln \n";
cout << "Reinen Text eingeben zum Ver-/Entschlüsseln.\n;"

cout << "Bitte Installationpasswort eingeben um fortzusetzen\n";

cout << "Reiner Text = " << plain << endl;
cout << "\nVerschlüsselter Text = " << CIPHER << endl;
cout << "\nNochmal?\n1 weiter. oder 2. beenden.\n>";
cout<< "\nDerzeitigen Schlüssel beibehalten?\n1 beibehalten, oder 2 ändern.\n>";

cout << "Entschuldigung der Installer für dieses Programm ist veraltet.  Bitte fragen Sie nach einem Ersatz beim Händler.  Sie haben 7 Tage Zeit zum Aktivieren Ihres Produkts. " << endl;
cout << "Entschuldigung falsches Passwort. " << endl;
cout << "Entschuldigung Sie müssen Administratiorrechte besitzen, um das Program zu installieren. " << endl;
cout << "Entschuldigung die Probezeit für die Software ist abgelaufen. " << endl << "Bitte erwerben Sie die Freischaltung. " << endl;
Translation is not trivial
Last edited on
Translation is not trivial


Yeah. Go look at google translate or something similar.
firedraco wrote:
Yeah. Go look at google translate or something similar.
That might help a little bit but the output is usually unreadable.
It´s like the english MSDN KB´s translated into german using some microsoft translator... it hurts while reading it (another point is that some more complex sentences turn 180° in meaning - strange)
closed account (z05DSL3A)
I recently saw a program (Qi it think) and one of the guests talked about the Address To a Haggis at a Burns supper in Germany. The address was translated in to German and sent to the venue and they translated it back to English to read on the night.
Apparently "Great chieftain o' the puddin-race" came off as "King of the sausage people".
Last edited on
Thanks coder777. I appreciate your help?
you don't accept private messages so how can I send you my language.h file?
Thanks to all who replied.

Well I know its not much but here it is to those that helped.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#ifndef LANGUAGE_H
#define LANGUAGE_H
#include <iostream>
#include <cstdio>
#include <string>
using namespace std;

class language
{
    private: bool on; public: bool notice();

    language & operator<<(const char * s)
    {if (on) cout<<s; return *this;}

    language & operator<<(string s)
    {if (on) cout<<s; return *this;}

    language & operator<<(char c)
    {if (on) cout<<c; return *this;}

    language & operator<<(int n)
    {if (on) cout<<n; return *this;}

    language & operator<<(long n)
    {if (on) cout<<n; return *this;}

    language & operator<<(double d)
    {if (on) cout<<d; return *this;}

    bool set(const bool & b)
    {
        if ( (b != 0) && (b != 1) )
            {
                cerr << "bool range error " << endl; return 0;
            }
        else if (b == 1) on = true;
        else on = false;
    }
    language()
    {
        on = false;
    }
    ~language(){}

} german, spanish, english;

bool language::notice(){if (on) return true; else return false;}
#endif

#ifndef SPRACHE_H
#define SPRACHE_H

class sprache
{
    public:
    bool on;
    sprache()
    {
        on = true;
        english.set(1);
    }
    ~sprache(){}

    bool apagar(bool ch)
    {
        string e,g,s, g1, g2, g3, g4, g5, s1, s2;
        int choice; char amlaut = 132, umlaut = 129, nyay = 164, omlaut = 148;
        g5 = " Bitte w"; g5 += amlaut; g5 += "hlen Sie eine Sprache.  1 f"; g5 += umlaut;
        //g = " Bitte wählen Sie eine Sprache.  1 f" << umlaut << "r Englisch, 2 f" << umlaut << "r Spanisch, 3 f" << umlaut << "r Deutsch.";
        g1 = " Bitte wählen Sie eine Sprache.  1 f";
        g1 += umlaut;
        g2 = "r Englisch, 2 f";
        g2 +=umlaut;
        g3 = "r Spanisch, 3 f";
        g3 += umlaut;
        g4 = "r Deutsch.";
        g = g5 + g2 + g3 +g4;

        e = " Please choose a language.  1 for english, 2 for spanish, 3 for german. ";
        s = " Por favor selecione un idioma. 1 para ingleis, 2 para espa"; s += nyay; s += "ol, 3 para aleman. ";

        if (german.notice() ) {german << "\n" << g << "\n" << e << "\n" << s; }
            else if (spanish.notice() ) {spanish << "\n" << s << "\n" << e << "\n" << g;}
                else if (english.notice() ) {english << "\n" << e << "\n" << s << "\n" << g;}
        char c[1000]; c[1] = 0;
        cout << '\n' << flush;
        enter:printf("%s","  >");
        cin.getline(c, 1000);
        if (0 == c[1])
            {choice = c[0] - 48; }
        if ((choice < 1) || (choice > 3))
            { goto enter; }
        if (cin.fail()) {cin.clear(); clearcin(cin); goto enter; }

        switch (choice)
            {

                case 1: english.set(1); spanish.set(0); german.set(0);
                                            break;
                case 2: english.set(0); spanish.set(1); german.set(0);
                    break;
                case 3: english.set(0); spanish.set(0); german.set(1);
                    break;
            }
        return true;
    }
    sprache & operator<<(const char * s)
    {if (on) cout<<s; return *this;}

    sprache & operator<<(string s)
    {if (on) cout<<s; return *this;}

    sprache & operator<<(char c)
    {if (on) cout<<c; return *this;}

    sprache & operator<<(int n)
    {if (on) cout<<n; return *this;}

    sprache & operator<<(long n)
    {if (on) cout<<n; return *this;}

    sprache & operator<<(double d)
    {if (on) cout<<d; return *this;}
}linguistics; 

#endif


I had hoped to someday expand upon its capabilities so as to allow for something like:
 
german << "Hello, World!\n";


to output:

Hallo, Weld!

wtf wrote:
you don't accept private messages so how can I send you my language.h file?
ok, sorry didn't know that a feature like that private messages exists. I switched it on right now, but I see that you posted it already.
german << "Hello, world!\n";
Uh... I guess you could somehow connect to an online translator and feed it through there... Computer translation is a super hard problem.
Uh... I guess you could somehow connect to an online translator and feed it through there... Computer translation is a super hard problem.


Above is one of the hot topic of research among computer scientists around the world. Let them do the research first and then later they publish their findings we see how good it is :P

The other area would be computer artificial intelligence which is another vast topic also.

I've only had a few moments this morning. I'll give more when I get more time. First box:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
cout << "Favor de dar su llave.\n";  // 'Please give your (encryption) key'
cout << "¿o cifrando o descifrando a una mensaje?\n"; (responses will be 'c' or 'd')
cout << "0 para cifrar 1 para descifrar \n";
cout << "dar un mensaje original para (des)cifrar.\n"; // BTW, you do know that plaintext only gets encrypted, right?

cout << "Favor de dar la contraseña de instalación para seguir\n";

cout << "mensaje original = " << plain << endl;
cout << "\nmensaje cifrado = " << CIPHER << endl;
cout << "¿Otra vez?\n1 para 'si', 2 para terminar.\n>"; // BTW, I cleaned up your punctuation somewhat...
cout << "\n¿Guardar su llave corriente?\n1 para guardarla, 2 para cambiarla.\n>";

cout << "El instalador para este programa expiró.  Por favor obtenga otro de su ventador.  Tendra 7 dias activar su producto. " << endl;
cout << "Contraseña incorrecta. " << endl;
cout << "Se require derechos administravos instalar a éste programa. " << endl;
cout << "Ya terminó el periodo evaluación para éste software. " << endl << "Favor de comprarlo para usarlo. " << endl;

BTW, you really need to clean-up the messages in English a bit...
Last edited on
I have an idea for a simplistic translator. Basically you would store "conversion files" which would just be text files with a source and destination language (e.g. "English2German.txt"). Each line in the file would consist of a word or phrase in the source language, a colon delimiter, and the translation in the destination language (e.g. "Hello:Hallo"). Obviously there's a problem with translating word-by-word, so you could have a "Add a better translation" button like Google's translator. All you would do is add the new translation to the top of the file. To do the reverse translation, you would just translate backwards.

BTW I think what most programs do when they want the ability to use different languages is to translate every message the program uses, store each one in a separate language file, and then parse the file. I guess you could store the file something like
myprogram_ES.lang
1
2
ENCRYPTIONKEY_MESSAGE:Favor dar su llave\n
RESPONSES_MESSAGE:¿o cifrando o descifrando a una mensaje?\n

Then all you do is read every line of the file, given the language, and then store each one in an std::vector or std::list:
1
2
3
parse_languagefile("ES"); // Read strings from myprogram_ES.lang and stores in a vector
std::cout << languagefile_string("ENCRYPTIONKEY_MESSAGE"); // Returns the string "Favor dar su llave\n"
std::cout << languagefile_string("RESPONSES_MESSAGE"); // Returns the string "¿o cifrando o descifrando a una mensaje?\n" 
Last edited on
For basic translator stuff, see http://wiki.tcl.tk/10262

What you have there is pretty much how language translation is done in programs, where 'languagefile_string()' is a function that returns the proper string for a given message. Quite often, the key string is the original string.

Additional care must be taken when formatting strings that take embedded values, because they will not necessarily go in all the same places in the final message. printf-style formatting is common with the function. (It can be done easily enough using C++ methodologies also.)

:-)
So that is how they do it? I just made that up. It was based on a program that I remember which stored language files, and when I accidentally deleted them, every character was replaced with "?".
Hey, wtf, you really need to clean-up your program's interface. It is inconsistent, and asks things in funny ways.

For example, you have messages asking to continue with or without display in ascending order, but you also have a spot
asking whether you want to toggle display with or without ascending order. If you've got an option for it, why do you
need to ask the user how to display?

Also, you ask for inconsistent responses. For example, asking to "press 1 (Return)" is confusing.
If the user must press ENTER after every input, ask him to "enter 1".
If the user need not press ENTER after an input, ask him to "press 1".
That is specific language that the user will understand, based upon industry use.

Likewise, you will accept 'Y' or 'N' ('S' or 'N') in some places but only '1' or '2' in others to get the same response.
Chose one or the other. This is easy enough to do if you get your responses using specific routines.

PowerBall is a well known name even in Latino countries, but I don't think Mega Ball is.

My Spanish isn't that great when it comes to computer terms. I used the verb "entrar" for 'entering <some sequence of keys>'.
Another verb that might have been used is "introducir", as in "introduzca 2".
The Spanish teclado will not usually have a word printed on the ENTER key, but if it does it will often be 'Entrar' or 'Entran'.

Here are your second and third listings:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
cout << "Los Números Principales, en ordén de sacar, son " << endl;
cout << endl << "los Números Poderosos son " << endl;
 cout << "Los Números Principales, en orden creciente, son \n" << endl;;
 cout << "Los Números Poderosos, en orden creciente, son \n" << endl;;

cout << "¿Cuántos juegos de números le gustería producir para éste juego?\n";
cout << "¿Regresar al menú principal? S / N " << endl;

cout << "Bienvenida al ensayo beta de mi nueva Software Productor de Números Lotería al Azar. " << endl;
    _1:
    cout << "A cualquier tiempo Apreta 'Ctrl - C' para terminar. " << endl << endl;;
    cout << "Si le gustaría ver los Números Lotería en orden creciente apreta 1.  (Entrar) " << endl;
    cout << "Si le gustaría ver los Números Lotería en orden de produccíon apreta 2.  (Entrar) " << endl;
    cout << "A ver los números in orden creciente y en orden de produccíon apreta 3. (Entrar) " << endl;

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

cout << "Apreta 1 si le gustaría usar el Lotto Machine. " << endl;
    cout << "Apreta 2 si le gustaría producir del generador del número pseudaleatorio. " << endl;
    cout << "El método 2 requiere la menos interacción del usuario. " << endl;
cout << "De otro modo, el método 1 produce los resultados más al azar. \n";

 cout << endl << "Apreta 1 si le gustaría mostrar sólo a la pantalla.  " << endl;
    cout << "Apreta 2 si le gustaría guardar a archivo también.  " << endl;

 cout << "entra nombre de archivo " << endl;

cout << "¿Cuál es la Gama de sus números principales?  " << endl;
cout << "¿Se permite que se duplicar? 1 para sí 2 para no. " << endl;
Si los números principales empiezan con & incluye '0', entra 0.  En otro caso entra el intervalo sobre 0 al cual comienzan los números principales.  (Entonces para tipos de jugetes como o PowerBall o Mega Millions entraría el 1. " << endl;
cout << "Selección Inválido.  " << endl;

    cout << "Entra 1 para accionar la palanca de la opción 'Orden Creciente'.  " << endl;
    cout << "Entra 2 para accionar la palanca de la opción Método.  " << endl;
    cout << "Entra 3 para accionar la palanca de la opción usar un archivo.  " << endl;
    cout << "Entra 10 para regresar.  " << endl;

cout << "ordinal_choice = " << ordinal_choice << " " << endl;
cout << "method_choice = " << method_choice << " " << endl;
cout << "file_choice = " << file_choice << " " << endl;

 

I've also noted that label on line 10 of your second listing. Please, please, please get rid of your gotos. You don't need them, and they will make your UI almost impossible to improve and maintain.

You may have noticed that I have a lot to say about user interface issues. Most programmers have the idea that they are some sort of esoteric, impossible to understand thing. The real trick comes from two directions:

    1. (Most important) Your program should behave the way the user thinks it should.
    2. Modular interface routines. Make sure everything has a procedural base (using routines).

For example, if you must ask a yes or no question, have a routine that does it, and returns a proper response. That way all the code that actually does it is in just one spot, and throughout the rest of your program you only need to call that one routine. If a specific piece of code changes (say, you must ask for three responses), then you can change that one piece of code to call a different routine.

Now when Yeseña Hernandez, who knows how to use Facebook and Solitaire, wants to use your program, she can expect to be asked a couple of questions and have most everything else done for her. Likewise for Franz Gröber, an IT expert, uses your program, he can expect the same simple questions but also know how to follow incidental dialogues and/or documentation on switches to do something oddball if he wants.

Oh, also, keep in mind that I haven't had but a few moments to do the translations -- punctuated by periods of feeding chickens, going to Christmas parties, etc.

Hope this helps.
Pages: 12