Repository navigation
Expand file tree
/
Copy pathdefault_translations.py
More file actions
373 lines (361 loc) · 12.6 KB
/
Copy pathdefault_translations.py
File metadata and controls
373 lines (361 loc) · 12.6 KB
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
import json
from collections.abc import Iterable
DEFAULT_PARAM_TRANSLATIONS = {
"en": {
"abf_hausnr": "House Number",
"abf_strasse": "Street",
"abf_suche": "Search",
"address_name_number": "Address Name or Number",
"bezirk": "District",
"gemeinde": "Municipality",
"hausnr": "House Number",
"hausnummer": "House Number",
"hnr": "House Number",
"houseNo": "House Number",
"housenameornumber": "House Name or Number",
"housenumber": "House Number",
"housenumberorname": "House Number or Name",
"hpid": "HPID",
"kommune": "Municipality",
"ladeort": "Loading Location",
"lat": "Latitude",
"lon": "Longitude",
"ort": "City",
"ortsgemeinde": "Local Community",
"ortsteil": "District",
"params": "Parameters",
"postCode": "Postcode",
"post_code": "Postcode",
"postcode": "Postcode",
"stadt": "City",
"stadtteil": "District",
"strasse": "Street",
"teilgebiet": "Subarea",
"turnus": "Cycle",
"uprn": "UPRN",
"zipCode": "ZIP Code",
"zip_code": "ZIP Code",
"zipcode": "ZIP Code",
"zusatz": "Addition",
},
"de": {
"Calendar": "Kalender",
"addition": "Zusatz",
"address_postcode": "Postleitzahl",
"address_street": "Straße",
"address": "Adresse",
"adress": "Adresse",
"area": "Gebiet",
"bill_number": "Rechnungsnummer",
"city": "Stadt",
"city_id": "Stadt ID",
"client": "Kunde",
"community": "Gemeinde",
"company": "Unternehmen",
"customer": "Kunde",
"district": "Bezirk",
"email": "E-Mail",
"hausnr": "Hausnummer",
"house": "Haus",
"houseNo": "Hausnummer",
"house_name": "Hausname",
"house_number": "Hausnummer",
"house_number_or_name": "Hausnummer oder Name",
"housenumber": "Hausnummer",
"housenumberorname": "Hausnummer oder Name",
"lat": "Breitengrad",
"location": "Position",
"lon": "Längengrad",
"method": "Methode",
"municipal": "Gemeinde",
"municipality": "Gemeinde",
"number": "Nummer",
"password": "Passwort",
"phone": "Telefon",
"plz": "PLZ",
"postCode": "PLZ",
"post_code": "PLZ",
"postcode": "PLZ",
"property_no": "Grundstück Nr.",
"strasse": "Straße",
"street": "Straße",
"streetId": "Straßen ID",
"street_id": "Straßen ID",
"street_name": "Straßenname",
"subdomain": "Subdomain",
"terretory": "Gebiet",
"town": "Stadt",
"types": "Typen",
"uprn": "UPRN",
"url": "URL",
"username": "Benutzername",
"values": "Werte",
"version": "Version",
"village": "Ort",
"voivodship": "Woiwodschaft",
"zipCode": "PLZ",
"zip_code": "PLZ",
"zipcode": "PLZ",
"zone": "Zone",
},
"it": {
"address": "Indirizzo",
"addressNo": "Indirizzo Numero",
"api_key": "Chiave API",
"bill_number": "Numero della bolletta",
"building_number": "Numero Edificio",
"calendar": "Calendario",
"calendar_splitter": "Calendar Splitter",
"calendar_title": "Nome Calendario",
"city": "Città",
"city_id": "ID Città",
"city_part": "Parte della Città",
"client": "Cliente",
"community": "Comunità",
"company": "Compagnia",
"council": "Consiglio",
"count": "Conteggio",
"county_id": "ID Paese",
"customer": "Cliente",
"dates": "Date",
"district": "Distretto",
"district_id": "ID Distretto",
"door_num": "Numero Interno",
"email": "Email",
"excludes": "Escludi",
"file": "Nome File",
"frequency": "Frequenza",
"house": "Casa",
"houseID": "ID Casa",
"houseNo": "Civico",
"house_letter": "Lettera Casa",
"house_name": "Nome Casa",
"house_number": "Civico",
"housenameornumber": "Numero o Nome Casa",
"housenumber": "Civico",
"housenumberorname": "Numero o Nome Casa",
"ignored_containers": "Ignored Containers",
"interval": "Intervallo",
"ladeort": "Ladeort",
"location": "Posizione",
"location_id": "ID Posizione",
"method": "Metodo",
"municipality": "Municipality",
"municipality_id": "Municipality ID",
"name": "Nome",
"number": "Numero",
"operator": "Operatore",
"p_collect_cycle": "P Collect Cycle",
"params": "Parametri",
"phone": "Telefono",
"pid": "PID",
"postCode": "Codice Postale CAP",
"post_code": "Codice Postale CAP",
"postal_code": "Codice Postale CAP",
"postcode": "Codice Postale CAP",
"predict": "Predict",
"prem_code": "Premises Code",
"premises_id": "Premises ID",
"project_id": "Project ID",
"property": "Proprietà",
"propertyID": "ID Proprietà",
"property_id": "ID Proprietà",
"property_location": "Posizione Proprietà",
"property_no": "Proprietà Numero",
"r_collect_cycle": "R Collect Cycle",
"radius": "Raggio",
"region": "Regione",
"road": "Strada",
"road_name": "Nome Strada",
"sector": "Settore",
"service": "Servizio",
"service_id": "ID Servizio",
"service_provider": "Fornitore di Servizi",
"show_nights": "Mostra Notti",
"start": "Inizio",
"state": "Stato",
"street": "Strada",
"streetId": "ID Strada",
"streetIndex": "Indice Strada",
"streetName": "Nome della Strada",
"street_address": "Indirizzo Strada",
"street_code": "Codice Strada",
"street_id": "ID Strada",
"street_name": "Nome Strada",
"street_number": "Numero Strada",
"street_town": "Città Strada",
"suffix": "Suffisso",
"territory": "Territorio",
"town": "Città",
"unit_number": "Numero Interno",
"until": "Fino",
"uprn": "UPRN",
"values": "Valori",
"verify_ssl": "Verifica SSL",
"version": "Versione",
"village": "Villaggio",
"weekdays": "Giorni feriali",
"zipCode": "Codice Postale CAP",
"zip_code": "Codice Postale CAP",
"zipcode": "Codice Postale CAP",
"zone": "Zona",
"zoneID": "ID Zona",
"zone_id": "ID Zona",
},
"fr": {
"Calendar": "Calendrier",
"abf_hausnr": "Numéro civique",
"abf_strasse": "Rue",
"abf_suche": "Recherche",
"addition": "Ajout",
"address": "Adresse",
"address_name_number": "Numéro et nom de rue",
"address_postcode": "Code postal",
"address_street": "Rue",
"addressNo": "Numéro d'adresse",
"adress": "Adresse",
"api_key": "Clé API",
"area": "Zone",
"bezirk": "District",
"bill_number": "Numéro de facture",
"building_number": "Numéro de bâtiment",
"calendar": "Calendrier",
"calendar_title": "Titre du calendrier",
"city": "Ville",
"city_id": "ID de ville",
"city_part": "Quartier de ville",
"client": "Client",
"community": "Communauté",
"company": "Entreprise",
"council": "Conseil",
"county_id": "ID de comté",
"customer": "Client",
"district": "District",
"district_id": "ID de district",
"door_num": "Numéro de porte",
"email": "E-mail",
"gemeinde": "Municipalité",
"hausnr": "Numéro civique",
"hausnummer": "Numéro civique",
"hnr": "Numéro civique",
"house": "Maison",
"houseID": "ID de maison",
"houseNo": "Numéro civique",
"house_letter": "Lettre de maison",
"house_name": "Nom de maison",
"house_number": "Numéro civique",
"house_number_or_name": "Numéro civique",
"housenameornumber": "Numéro civique",
"housenumber": "Numéro civique",
"housenumberorname": "Numéro civique",
"hpid": "HPID",
"kommune": "Municipalité",
"ladeort": "Chargement de la localisation",
"lat": "Latitude",
"location": "Emplacement",
"location_id": "ID d'emplacement",
"lon": "Longitude",
"method": "Méthode",
"municipal": "Municipalité",
"municipality": "Municipalité",
"municipality_id": "ID de municipalité",
"number": "Numéro",
"operator": "Opérateur",
"ort": "Ville",
"ortsgemeinde": "Communauté",
"ortsteil": "District",
"params": "Paramètres",
"password": "Mot de passe",
"phone": "Téléphone",
"plz": "Code postal",
"postCode": "Code postal",
"post_code": "Code postal",
"postal_code": "Code postal",
"postcode": "Code postal",
"property": "Propriété",
"propertyID": "ID de propriété",
"property_id": "ID de propriété",
"property_location": "Emplacement de la propriété",
"property_no": "Numéro de propriété",
"radius": "Rayon",
"region": "Région",
"road": "Route",
"road_name": "Nom de route",
"sector": "Secteur",
"service": "Service",
"service_id": "ID de service",
"service_provider": "Fournisseur de services",
"stadt": "Ville",
"stadtteil": "District",
"state": "État",
"strasse": "Rue",
"street": "Rue",
"streetId": "ID de rue",
"streetIndex": "Index de rue",
"streetName": "Nom de rue",
"street_address": "Adresse de rue",
"street_code": "Code de rue",
"street_id": "ID de rue",
"street_name": "Nom de rue",
"street_number": "Numéro de rue",
"subdomain": "Sous-domaine",
"teilgebiet": "Sous-zone",
"town": "Ville",
"turnus": "Cycle",
"uprn": "UPRN",
"url": "URL",
"username": "Nom d'utilisateur",
"values": "Valeurs",
"version": "Version",
"village": "Village",
"zipCode": "Code postal",
"zip_code": "Code postal",
"zipcode": "Code postal",
"zone": "Zone",
"zoneID": "ID de zone",
"zone_id": "ID de zone",
"zusatz": "Ajout",
},
}
DEFAULT_PARAM_DESCRIPTIONS = {
"en": {
"uprn": "An easy way to discover your Unique Property Reference Number (UPRN) is by going to https://www.findmyaddress.co.uk/ and entering in your address details.",
},
"de": {
"uprn": "Eine einfache Möglichkeit, Ihre Unique Property Reference Number (UPRN) zu finden, besteht darin, auf https://www.findmyaddress.co.uk/ zu gehen und Ihre Adressdaten einzugeben.",
},
"it": {
"uprn": "Un modo facile per scoprire il tuo Numero di Riferimento Proprietà Unica (UPRN) è andare su https://www.findmyaddress.co.uk/ e inserire i dettagli del tuo indirizzo.",
},
"fr": {
"uprn": "Une manière simple de retrouver votre numéro unique de propriété (UPRN) est de vous rendre sur https://www.findmyaddress.co.uk/ et de saisir les détails de votre adresse."
},
}
DEFAULT_PARAM_TRANSLATIONS["nl"] = dict(DEFAULT_PARAM_TRANSLATIONS["en"])
DEFAULT_PARAM_DESCRIPTIONS["nl"] = dict(DEFAULT_PARAM_DESCRIPTIONS["en"])
def default_translations(args: Iterable[str]) -> dict[str, dict[str, str]]:
translation: dict[str, dict[str, str]] = {}
for arg in args:
for lang, translations in DEFAULT_PARAM_TRANSLATIONS.items():
if lang not in translation:
translation[lang] = {}
if arg in translations:
translation[lang][arg] = translations[arg]
return translation
def default_descriptions(args: Iterable[str]) -> dict[str, dict[str, str]]:
translation: dict[str, dict[str, str]] = {}
for arg in args:
for lang, translations in DEFAULT_PARAM_DESCRIPTIONS.items():
if lang not in translation:
translation[lang] = {}
if arg in translations:
translation[lang][arg] = translations[arg]
return translation
def sort_translations():
for lang in DEFAULT_PARAM_TRANSLATIONS:
DEFAULT_PARAM_TRANSLATIONS[lang] = dict(
sorted(DEFAULT_PARAM_TRANSLATIONS[lang].items())
)
print(json.dumps(DEFAULT_PARAM_TRANSLATIONS, indent=4, ensure_ascii=False))
if __name__ == "__main__":
sort_translations()