/*
* CINELERRA
* Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
- *
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
+ *
*/
#include "timeentry.h"
+#include "language.h"
#include <string.h>
-TimeEntry::TimeEntry(BC_WindowBase *gui, int x, int y,
+TimeEntry::TimeEntry(BC_WindowBase *gui, int x, int y,
int *output_day, double *output_time,
int time_format, int time_w)
{
delete day_tumbler;
delete time_text;
}
-const char* TimeEntry::day_table[] =
+const char* TimeEntry::day_table[] =
{
- "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "*"
+ N_("Sun"), N_("Mon"), N_("Tue"), N_("Wed"), N_("Thu"), N_("Fri"), N_("Sat"), "*"
};
int TimeEntry::day_to_int(const char *day)
{
for(int i = 0; i < TOTAL_DAYS; i++)
- if(!strcasecmp(day, day_table[i])) return i;
+ if(!strcasecmp(day, _(day_table[i]))) return i;
return 0;
}
char string[BCTEXTLEN];
if(output_day) {
- day_text = new DayText(this, x, y, 50,
+ day_text = new DayText(this, x, y, 50,
day_table, TOTAL_DAYS, day_table[*output_day]);
gui->add_subwindow(day_text);
x += day_text->get_w();
time_w -= day_tumbler->get_w();
}
- time_text = new TimeTextBox(this, x, y, time_w,
+ time_text = new TimeTextBox(this, x, y, time_w,
Units::totext(string, *output_time, time_format));
gui->add_subwindow(time_text);
int time_w = this->time_w;
this->x = x;
this->y = y;
-
+
if(day_text) {
day_text->reposition_window(x, y);
x += day_text->get_w();
x += day_tumbler->get_w();
time_w -= day_tumbler->get_w();
}
-
+
time_text->reposition_window(x, y, time_w);
}
-DayText::DayText(TimeEntry *timeentry,
- int x, int y, int w,
+DayText::DayText(TimeEntry *timeentry,
+ int x, int y, int w,
const char **table, int table_items,
const char *text)
- : BC_TextBox(x, y, w, 1, text)
+ : BC_TextBox(x, y, w, 1, _(text))
{
this->timeentry = timeentry;
this->table = table;
*timeentry->output_day += 1;
if(*timeentry->output_day >= text->table_items)
*timeentry->output_day = 0;
- text->update(text->table[*timeentry->output_day]);
+ text->update(_(text->table[*timeentry->output_day]));
return timeentry->handle_event();
}
*timeentry->output_day -= 1;
if(*timeentry->output_day < 0)
*timeentry->output_day = text->table_items - 1;
- text->update(text->table[*timeentry->output_day]);
+ text->update(_(text->table[*timeentry->output_day]));
return timeentry->handle_event();
}
-TimeTextBox::TimeTextBox(TimeEntry *timeentry,
+TimeTextBox::TimeTextBox(TimeEntry *timeentry,
int x, int y, int w, char *default_text)
: BC_TextBox(x, y, w, 1, default_text)
{