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
  
128
  
129
  
130
  
131
  
132
  
133
  
134
  
135
  
136
  
137
  
138
  
139
  
140
  
141
  
142
  
143
  
144
  
145
  
146
  
147
  
148
  
149
  
150
  
151
  
152
  
/* 
 
string cvs_version = "$Id: french.pike,v 1.6 1998/07/11 18:54:04 grubba Exp $"; 
Created by: 
 
---------------------+-------------------------------------------------- 
Patrick KREMER       | U.c. de Louvain (Belgium)  Institute of Geography 
kremer@geog.ucl.ac.be| Xin1-Lu3wen4 Da4xue2 (Bi3li4shi2)  Di4li3xue2 Xi4 
fax:++32-10/472877   | Pl. Pasteur,3   B-1348 Louvain-la-Neuve   Belgium 
---------------------+-------------------------------------------------- 
http://ftp.geog.ucl.ac.be/~patrick/ 
 
 
*/ 
 
/* 
 * name = "French language plugin "; 
 * doc = "Handles the conversion of numbers and dates to French. You have to restart the server for updates to take effect. Translation by Patrick Kremer."; 
 */ 
 
 
string month(int num) 
{ 
  return ({ "janvier", "février", "mars", "avril", "mai", 
            "juin", "juillet", "août", "septembre", "octobre", 
            "novembre", "décembre" })[ num - 1 ]; 
} 
 
string ordered(int i) 
{ 
  switch(i) 
  { 
   case 1: 
    return "1:ier";  
   default: 
    return (string)i; 
  } 
} 
 
string date(int timestamp, mapping|void m) 
{ 
  mapping t1=localtime(timestamp); 
  mapping t2=localtime(time(0)); 
 
  if(!m) m=([]); 
 
  if(!(m["full"] || m["date"] || m["time"])) 
  { 
    if(t1["yday"] == t2["yday"] && t1["year"] == t2["year"]) 
      return "aujourd'hui, "+ ctime(timestamp)[11..15]; 
   
    if(t1["yday"]+1 == t2["yday"] && t1["year"] == t2["year"]) 
      return "hier, "+ ctime(timestamp)[11..15]; 
   
    if(t1["yday"]-1 == t2["yday"] && t1["year"] == t2["year"]) 
      return "demain, "+ ctime(timestamp)[11..15]; 
   
    if(t1["year"] != t2["year"]) 
      return (month(t1["mon"]+1) + " " + (t1["year"]+1900)); 
    return (ordered(t1["mday"]) + " " + month(t1["mon"]+1)); 
  } 
  if(m["full"]) 
    return ctime(timestamp)[11..15]+", le "+ 
      ordered(t1["mday"]) + " "  + month(t1["mon"]+1)  
      + " de l'année " +(t1["year"]+1900); 
  if(m["date"]) 
    return ordered(t1["mday"]) + " "  + month(t1["mon"]+1)  
      + " " +(t1["year"]+1900); 
  if(m["time"]) 
    return ctime(timestamp)[11..15]; 
} 
 
 
string number(int num) 
{ 
  if(num<0) 
    return "moins "+number(-num); 
  switch(num) 
  { 
   case 0:  return "zéro"; 
   case 1:  return "une"; 
   case 2:  return "deux"; 
   case 3:  return "trois"; 
   case 4:  return "quatre"; 
   case 5:  return "cinq"; 
   case 6:  return "six"; 
   case 7:  return "sept"; 
   case 8:  return "huit"; 
   case 9:  return "neuf"; 
   case 10: return "dix"; 
   case 11: return "onze"; 
   case 12: return "douze"; 
   case 13: return "treize"; 
   case 14: return "quatorze"; 
   case 15: return "quinze"; 
   case 16: return "seize"; 
   case 17: return "dix-sept"; 
   case 18: return "dix-huit"; 
   case 19: return "dix-neuf"; 
   case 20: return "vingt"; 
   case 30: return "trente"; 
   case 40: return "quarante"; 
   case 50: return "cinquante"; 
   case 60: return "soixante"; 
   case 80: return "quatre-vingt"; 
   case 21: case 31: case 41: 
   case 51: case 61: 
     return number((num/10)*10)+"-et-un"; 
   case 71: case 91: 
     return number((num/10)*10-10)+"-et-onze"; 
   case 22..29: case 32..39: case 42..49: 
   case 52..59: case 62..69: case 81..89:  
     return number((num/10)*10)+"-"+number(num%10); 
   case 72..79: case 92..99: 
      return number((num/10)*10-10)+"-"+number((num%10)+10); 
   case 200: case 300: case 400: case 500: 
   case 600: case 700: case 800: case 900: 
     return number(num/100)+" cents"; 
   case 100..199: 
    return "cent "+number(num%100); 
   case 201..299: case 301..399: 
   case 401..499: case 501..599: case 601..699: 
   case 701..799: case 801..899: case 901..999:  
     return number(num/100)+" cent "+number(num%100); 
   case 1000..1999: return "mille "+number(num%1000); 
   case 2000..999999: return number(num/1000)+" mille "+number(num%1000); 
   case 1000000: 
     return "un million"; 
   case 1000001..1999999: 
     return number(num/1000000)+" million "+number(num%1000000); 
   case 2000000..999999999: 
     if(num%1000000 == 0) 
       return number(num/1000000)+" millions de "; 
     return number(num/1000000)+" millions "+number(num%1000000); 
   default: 
    return "beaucoup"; 
  } 
} 
 
string day(int num) 
{ 
  return ({ "dimanche", "lundi", "mardi", "mercredi", 
            "jeudi", "vendredi", "samedi" })[ num - 1 ]; 
} 
 
array aliases() 
{ 
  return ({ "fr", "fra", "français", "french" }); 
}