summaryrefslogtreecommitdiff
path: root/npc/functions/asklanguage.txt
blob: 32e0f7bc3c6c1b2e9ef245fcf372228da14ee9b6 (plain) (blame)
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
// TMW2 script
// Evol functions.
// Author:
//    Reid, Jesusalva
// Description:
//    Function setting the player language

function	script	languagecode	{
    switch (Lang) {
	case LANG_PTBR:
        return "pt_BR";
	case LANG_FR:
        return "fr";
	case LANG_DE:
        return "de";
	case LANG_ES:
        return "es";
    default:
        return "en";
    }
}

function	script	asklanguage	{

    dispbottom col("We need help with translations. [@@help://translate|Learn more@@]", 1);
    switch (getarg(0, LANG_IN_SHIP))
    {
        case LANG_ON_SEA:
            setarray .@messages$[0], "I hear you... (English)", // English
                                     "Eu te ouço... (Português)", // Portuguese
                                     "Je vous entends... (Français)", // French
                                     "Ich höre euch... (Deutsch)", // German
                                     "Te oigo... (Español)"; // Spanish
            break;
        case LANG_IN_SHIP:
            setarray .@messages$[0], "I speak English.", // English
                                     "Eu falo Português.", // Portuguese
                                     "Je parle français.", // French
                                     "Ich spreche Deutsch.", // German
                                     "Hablo Español."; // Spanish
            break;
        default:
            return;
    }

    setarray .@flags$[0],    "flags/en",
                             "flags/pt_BR",
                             "flags/fr",
                             "flags/de",
                             "flags/es";

    .@menustr$ = "";
    .@separator$ = ":";

    for (.@i = 0; .@i <= MAX_LANG; .@i++)
    {
        if (.@i == MAX_LANG) {
            .@separator$ = "";
        }
        .@menustr$ = .@menustr$ + .@flags$[.@i] + "|" + .@messages$[.@i] + .@separator$;
    }

    select(.@menustr$);

    .@lang = @menu - 1;

    if (.@lang >= 0 || .@lang <= MAX_LANG) {
        Lang = .@lang;
    }

    return;
}