Initial commit.
[amiga/xmodule.git] / Locale.c
1 /*
2 **      Locale.c
3 **
4 **      Copyright (C) 1994,95,96,97 Bernardo Innocenti
5 **
6 **      Routines to handle localization.
7 **
8 **      NOTE: The Locale.c file is generated automatically by `FlexCat 2.1'
9 **            using "Catalogs/XModule.cd". Do NOT edit by hand!
10 */
11
12 #include <libraries/locale.h>
13
14 #include <proto/exec.h>
15 #include <proto/locale.h>
16
17 #include "XModulePriv.h"
18
19
20 #define CATALOGVERSION  1
21 #define CATALOGNAME             "XModule.catalog"
22 #define MSG_COUNT               311
23
24
25 STRPTR AppStrings[] =
26 {
27         "",
28         "Ok",
29         "_Use",
30         "_Ok",
31         "_Cancel",
32         "Yes|No",
33         "Retry|Cancel",
34         "Proceed|Cancel",
35         "Continue",
36         "Insufficient memory.",
37         "Aborted.",
38         "Unable to load \"%s\"",
39         "Cannot open file \"%s\"",
40         "Error reading \"%s\"",
41         "Error writing \"%s\"",
42         "Decrunching...",
43         "Nothing found in archive \"%s\".",
44         "Unable to load compressed file.",
45         "Error decompressing file \"%s\": %s.",
46         "Bad Commodity HotKey description.",
47         "Reading Patterns...",
48         "Reading Instruments Info...",
49         "Reading Instruments...",
50         "ERROR: Couldn't load pattern %ld.",
51         "ERROR: Couldn't load instrument %lx.",
52         "ERROR: Not enough memory for instrument %lx.",
53         "ERROR: Instrument %lx is not a sample.",
54         "WARNING: Song length exceeds maximum. Will be truncated.",
55         "WARNING: Song exceeds maximum number of patterns.",
56         "WARNING: Pattern %ld has too many tracks. Cropping to %ld tracks.",
57         "WARNING: Pattern %ld has too many lines. Cropping to %ld lines.",
58         "WARNING: Invalid note %ld (Patt %ld Track %ld Line %ld).",
59         "Unknown effect: $%lx (Patt %ld Track %ld Line %ld).",
60         "WARNING: Extra data found after valid module: Will be ignored.",
61         "Writing Header...",
62         "Writing Patterns...",
63         "Writing Instruments...",
64         "Writing Instruments Info...",
65         "Writing Instruments Data...",
66         "WARNING: Note at Patt %ld Track %ld Line %ld is too low.",
67         "WARNING: Note at Patt %ld Track %ld Line %ld is too high.",
68         "WARNING: Not enough memory to halve volume of instrument %lx.",
69         "Loading MMD%lc module...",
70         "ERROR: Unsupported OctaMED format.",
71         "WARNING: Effect %lx is not supported in MMD0 format. Use MMD1 or better.",
72         "ERROR: Instrument %lx is an ADLib %s.",
73         "WARNING: Track %lx is out of range.",
74         "WARNING: Unknown sample compression for instrument %lx.",
75         "WARNING: Instrument %lx is a stereo sample.",
76         "WARNING: Instrument %lx is 16bit: unable to load it.",
77         "Reading %s module...",
78         "NOTE: Module exceeds 64 patterns. You need ProTracker 2.3 to play it.",
79         "Tracker ID: \"%s\"",
80         "Module has %lu tracks...",
81         "This file is a song and doesn't contain instruments.",
82         "WARNING: Module execeeds %ld patterns.",
83         "Pattern %ld will grow to 64 lines (was %ld lines long).",
84         "Splitting pattern %ld (was %ld lines long).",
85         "Choosing Channels...",
86         "Writing MIDI Tracks...",
87         "ERROR: Song requires too many MIDI channels.",
88         "Really Quit XModule?",
89         "Please close all visitor windows\n"\
90         "and then select `Continue'.",
91         "Unknown IFF format %s.",
92         "Illegal IFF structure.",
93         "Unrecognized instrument format.\n"\
94         "Please select RAW mode.",
95         "Signed 8bit|Unsigned 8bit|Cancel",
96         "DataTypes error: %s.",
97         "Unknown compression type.",
98         "%lu bit samples are not supported.",
99         "Samples other than MONO are not supported.",
100         "Samples with %ld channels are not supported.",
101         "WARNING: insufficient memory to optimize instrument %lx.",
102         "Instrument %lx will shrink from %ld to %ld.",
103         "Duplicate instruments found and removed: %lx == %lx.",
104         "Instrument %lx was never used and it's being removed.",
105         "Couldn't open \"%s\" version %ld or greater.",
106         "Couldn't open \"%s\".",
107         "Unable to insert pattern: Maximum number of patterns reached.",
108         "Pattern %ld is not used and is beeing deleted.",
109         "Pattern %ld will be cut at line %ld.",
110         "Duplicate patterns found and removed: %ld == %ld.",
111         "WARNING: Song lengths are different. Using shorter one.",
112         "WARNING: Different pattern lengths at position %ld. Using shorter one.",
113         "ERROR: Instruments overflow. Try remapping the instruments.",
114         "Incorrect version of preferences file",
115         "XModule Request",
116         "Clone Workbench Screen",
117         "Please close FileRequester\n and then select `Continue'.",
118         "Select Module(s)...",
119         "Select Instrument(s)...",
120         "Select Pattern...",
121         "Save Module...",
122         "Save Instrument...",
123         "Save Pattern...",
124         "File \"%s\"\nalready exists.",
125         "Overwrite|Choose Another|Abort",
126         "Please close all open songs\n"\
127         "and then select `Continue'.",
128         "Unespected end of file.",
129         "Module loaded OK.",
130         "Module saved OK.",
131         "ERROR: Unrecognized save format.",
132         "Removed invalid loop for instrument %lx.",
133         "Fixed invalid loop for instrument %lx.",
134         "WARNING: Song has no patterns.",
135         "WARNING: Song has no sequence.",
136         "WARNING: Song position %ld references pattern %ld, which doesn't exist.",
137         "Unable to identify module format.\n"\
138         "(Loading a data file as a module is unwise)",
139         "SoundTracker 15|ProTracker|Cancel",
140         "Unknown",
141         "Untitled",
142         "AmigaGuide error:",
143         "Pattern Editor Settings",
144         "Advance _Tracks",
145         "Advance _Lines",
146         "Max _Undo Levels",
147         "Max Undo _Memory",
148         "Cli_pboard Unit",
149         "_Scroller Position",
150         "_Vertical Wrap",
151         "_Horizontal Wrap",
152         "He_x Line Numbers",
153         "Blank _Zero Digits",
154         "Backdrop _Window",
155         "Ho_rizontal Scroller",
156         "Display Cursor Ruler",
157         "Display Tiny Lines",
158         "_Editor Font",
159         "Background",
160         "T_ext",
161         "Li_nes",
162         "Tin_y Lines",
163         "Right",
164         "Left",
165         "Off",
166         "ERROR: Pattern would exceed the maximum number of lines.",
167         "Sequence Editor",
168         "Sequence",
169         "_Add",
170         "Up",
171         "Down",
172         "_Name",
173         "Patterns",
174         "_Up",
175         "_Down",
176         "_Ins",
177         "-- unnamed --",
178         "Instruments",
179         "_Volume",
180         "_FineTune",
181         "Length",
182         "_Kind",
183         "_Edit...",
184         "Sample",
185         "Synth",
186         "Hybrid",
187         "Instruments",
188         "Load...",
189         "Remap",
190         "Save Compressed",
191         "Save Raw",
192         "-- empty --",
193         "Play",
194         "_Vol",
195         "Pos",
196         "Time",
197         "_Rst",
198         "Player initialization error: %ld.",
199         "XModule is working...",
200         "XModule Log",
201         "_Abort",
202         "%ld of %ld (%ld%% done)",
203         "Song Information",
204         "Ne_w",
205         "_Open...",
206         "_Save",
207         "Del",
208         "Song _Name",
209         "_Author",
210         "_Tempo",
211         "S_peed",
212         "_Restart",
213         "Length",
214         "Num Patterns",
215         "Tracks",
216         "Total Module Size",
217         "Total Instruments Size",
218         "Song",
219         "Merge Songs",
220         "Join Songs",
221         "ERROR: Join requires two songs.",
222         "ERROR: Merge requires two songs.",
223         "Discard current song?",
224         "ToolBox",
225         "Play...",
226         "_Songs...",
227         "_Patterns...",
228         "_Instruments...",
229         "Se_quence...",
230         "_Optimization...",
231         "Project",
232         "New",
233         "Open...",
234         "Open New...",
235         "Save",
236         "Save As...",
237         "Clear...",
238         "About...",
239         "Help...",
240         "Iconify...",
241         "Quit",
242         "Settings",
243         "Save Format...",
244         "User Interface...",
245         "Save Icons",
246         "Confirm Overwrite",
247         "Confirm Exit",
248         "Verbose Log",
249         "Open Settings...",
250         "Save Settings",
251         "Save Settings As...",
252         "%s\n"\
253         "A Music Module Processing Utility\n\n"\
254         "%s\n"\
255         "All rights reserved.\n\n"\
256         "Internet: bernie@shock.cosmos.it\n\n"\
257         "FidoNet:  2:332/118.4\n"\
258         "Free CHIP Memory: %ldKB\n"\
259         "Free FAST Memory: %ldKB\n\n"\
260         "Public Screen: %s\n"\
261         "ARexx Port: %s\n"\
262         "Cx HotKey: %s\n"\
263         "Language: %s",
264         "-- Default --",
265         "-- Disabled --",
266         "Module Optimization",
267         "_Optimize",
268         "Remove Unused _Patterns",
269         "Remove _Duplicate Patterns",
270         "Remove Unused _Instruments",
271         "Remove Duplicate I_nstruments",
272         "Cut Instruments After _Loop",
273         "Cut Instrument _Zero Tails",
274         "Cut _Breaked Patterns",
275         "_Remap Instruments",
276         "Saved %ld bytes (%ld%%)",
277         "User Interface Settings",
278         "_Public Screen",
279         "Display _Mode",
280         "_Window Font",
281         "_ListView Font",
282         "_Requesters",
283         "Use _DataTypes",
284         "Put App_Icon",
285         "Refres_h",
286         "Log To File",
287         "_Log Level",
288         "Confirm _Autosave",
289         "Autosave Mi_nutes",
290         "Create _Backups",
291         "Bac_kup Template",
292         "Backup _Versions",
293         "Asl",
294         "ReqTools",
295         "Smart",
296         "Simple",
297         "--Clone Default Screen--",
298         "Pattern Editor",
299         "Patterns",
300         "Size...",
301         "Edit",
302         "Mark",
303         "Cut",
304         "Copy",
305         "Paste",
306         "Erase",
307         "Undo",
308         "Redo",
309         "Editor Settings...",
310         "Savers",
311         "Se_quence",
312         "_Instruments",
313         "_Patterns",
314         "Names",
315         "Add I_con",
316         "_Mode",
317         "Options...",
318         "None",
319         "XPK",
320         "LhA",
321         "Description",
322         "Author",
323         "Max Length",
324         "Max Tracks",
325         "Max Instruments",
326         "Max Patterns",
327         "Max Pattern Length",
328         "Max Sample Length",
329         "Clear Module",
330         "_Sequence",
331         "_Instruments",
332         "_Patterns",
333         "_Clear",
334         "Sample Editor",
335         "Render",
336         "Points",
337         "Lines",
338         "Filled",
339         "Pattern Attributes",
340         "_Lines",
341         "_Tracks",
342         "_Double",
343         "_Halve",
344         "WARNING: The selected saver supports max %lu tracks, but the song has %lu tracks.",
345         "WARNING: The selected saver supports max %lu patterns; the song has %lu patterns.",
346         "WARNING: The selected saver supports max %lu instruments, last instrument is %lu.",
347         "WARNING: The selected saver supports max %lu positions, but the song has %lu positions.",
348         "WARNING: The length of pattern %ld ($%lx lines) isn't allowed with the selected saver.",
349         "WARNING: Instrument %lx is too long and will be cropped to %lu bytes.",
350         "Some modifications need to be performed on this song\n"\
351         "in order to adapt it to the limitations of the\n"\
352         "destination format.",
353         "Some instruments are placed beyond the limit for\n"\
354         "the selected format.\n"\
355         "Remapping the instruments now could help saving\n"\
356         "all them along with the selected format.",
357         "Saving %s module \"%s\"..."
358 };
359
360 static struct Library           *LocaleBase = NULL;
361 XDEF struct Catalog                     *Catalog = NULL;
362
363
364
365 GLOBALCALL void SetupLocale (void)
366 {
367         /* Try to open locale.library */
368         if (LocaleBase = OpenLibrary ("locale.library", 38L))
369         {
370                 /* Try to get catalog for current language */
371                 if (Catalog = OpenCatalog (NULL, CATALOGNAME,
372                         OC_BuiltInLanguage,     "english",
373                         OC_Version,                     CATALOGVERSION,
374                         TAG_DONE))
375                 {
376                         /* Read in locale language strings */
377                         UBYTE **as = AppStrings;
378                         ULONG i;
379
380                         /* Get translation strings */
381                         for (i = 1; i < MSG_COUNT; i++, as++)
382                                 *as = GetCatalogStr (Catalog, i, *as);
383                 }
384         }
385
386         /* Fix for a limitation of FlexCat: MSG_NULL should translate
387          * to a NULL pointer, not a pointer to an empty string :)
388          */
389         AppStrings[0] = NULL;
390 }
391
392
393
394 GLOBALCALL void CleanupLocale (void)
395 {
396         if (LocaleBase)
397         {
398                 /* No need to check for NULL */
399                 CloseCatalog (Catalog);         Catalog = NULL;
400                 CloseLibrary (LocaleBase);      LocaleBase = NULL;
401         }
402 }