Patch by Mike Roll as part of GCI: Localize Time preflet.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39935 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -32,3 +32,10 @@ Preference Time
|
|||||||
: Time.rdef
|
: Time.rdef
|
||||||
;
|
;
|
||||||
|
|
||||||
|
DoCatalogs Time :
|
||||||
|
x-vnd.Haiku-Time
|
||||||
|
:
|
||||||
|
Time.cpp
|
||||||
|
TimeWindow.cpp
|
||||||
|
ZoneView.cpp
|
||||||
|
;
|
||||||
|
|||||||
@@ -13,10 +13,12 @@
|
|||||||
|
|
||||||
|
|
||||||
#include <Alert.h>
|
#include <Alert.h>
|
||||||
|
#include <Catalog.h>
|
||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "Time"
|
||||||
|
|
||||||
const char* kAppSignature = "application/x-vnd.Haiku-Time";
|
const char* kAppSignature = "application/x-vnd.Haiku-Time";
|
||||||
|
|
||||||
@@ -44,9 +46,10 @@ TimeApplication::ReadyToRun()
|
|||||||
void
|
void
|
||||||
TimeApplication::AboutRequested()
|
TimeApplication::AboutRequested()
|
||||||
{
|
{
|
||||||
BAlert* alert = new BAlert("about",
|
BAlert* alert = new BAlert(B_TRANSLATE("about"),
|
||||||
"Time & Date, writen by:\n\n\tAndrew Edward McCall\n\tMike Berg\n\t"
|
B_TRANSLATE("Time & Date, writen by:\n\n\tAndrew Edward McCall\n\tMike Berg\n\t"
|
||||||
"Julun\n\tPhilippe Saint-Pierre\n\nCopyright 2004-2008, Haiku.", "OK");
|
"Julun\n\tPhilippe Saint-Pierre\n\nCopyright 2004-2008, Haiku."),
|
||||||
|
B_TRANSLATE("OK"));
|
||||||
alert->Go();
|
alert->Go();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,14 +17,17 @@
|
|||||||
|
|
||||||
|
|
||||||
#include <Application.h>
|
#include <Application.h>
|
||||||
|
#include <Catalog.h>
|
||||||
#include <Message.h>
|
#include <Message.h>
|
||||||
#include <Screen.h>
|
#include <Screen.h>
|
||||||
#include <TabView.h>
|
#include <TabView.h>
|
||||||
#include <Button.h>
|
#include <Button.h>
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "Time"
|
||||||
|
|
||||||
TTimeWindow::TTimeWindow(BRect rect)
|
TTimeWindow::TTimeWindow(BRect rect)
|
||||||
: BWindow(rect, "Time", B_TITLED_WINDOW, B_NOT_RESIZABLE | B_NOT_ZOOMABLE)
|
: BWindow(rect, B_TRANSLATE("Time"), B_TITLED_WINDOW, B_NOT_RESIZABLE | B_NOT_ZOOMABLE)
|
||||||
{
|
{
|
||||||
_InitWindow();
|
_InitWindow();
|
||||||
_AlignWindow();
|
_AlignWindow();
|
||||||
@@ -116,11 +119,11 @@ TTimeWindow::_InitWindow()
|
|||||||
|
|
||||||
BTab* tab = new BTab();
|
BTab* tab = new BTab();
|
||||||
tabView->AddTab(fDateTimeView, tab);
|
tabView->AddTab(fDateTimeView, tab);
|
||||||
tab->SetLabel("Date & Time");
|
tab->SetLabel(B_TRANSLATE("Date & Time"));
|
||||||
|
|
||||||
tab = new BTab();
|
tab = new BTab();
|
||||||
tabView->AddTab(fTimeZoneView, tab);
|
tabView->AddTab(fTimeZoneView, tab);
|
||||||
tab->SetLabel("Time zone");
|
tab->SetLabel(B_TRANSLATE("Time zone"));
|
||||||
|
|
||||||
fBaseView->AddChild(tabView);
|
fBaseView->AddChild(tabView);
|
||||||
tabView->ResizeBy(0.0, tabView->TabHeight());
|
tabView->ResizeBy(0.0, tabView->TabHeight());
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
#include <AutoDeleter.h>
|
#include <AutoDeleter.h>
|
||||||
#include <Button.h>
|
#include <Button.h>
|
||||||
|
#include <Catalog.h>
|
||||||
#include <Collator.h>
|
#include <Collator.h>
|
||||||
#include <Country.h>
|
#include <Country.h>
|
||||||
#include <Directory.h>
|
#include <Directory.h>
|
||||||
@@ -51,6 +52,10 @@
|
|||||||
#include "TimeWindow.h"
|
#include "TimeWindow.h"
|
||||||
|
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "Time"
|
||||||
|
|
||||||
|
|
||||||
using BPrivate::MutableLocaleRoster;
|
using BPrivate::MutableLocaleRoster;
|
||||||
using BPrivate::ObjectDeleter;
|
using BPrivate::ObjectDeleter;
|
||||||
|
|
||||||
@@ -194,7 +199,8 @@ TimeZoneView::GetToolTipAt(BPoint point, BToolTip** _tip)
|
|||||||
BString toolTip = item->Text();
|
BString toolTip = item->Text();
|
||||||
toolTip << '\n' << item->TimeZone().ShortName() << " / "
|
toolTip << '\n' << item->TimeZone().ShortName() << " / "
|
||||||
<< item->TimeZone().ShortDaylightSavingName()
|
<< item->TimeZone().ShortDaylightSavingName()
|
||||||
<< "\nNow: " << nowInTimeZone << " (" << dateInTimeZone << ')';
|
<< B_TRANSLATE("\nNow: ") << nowInTimeZone
|
||||||
|
<< " (" << dateInTimeZone << ')';
|
||||||
|
|
||||||
if (fToolTip != NULL)
|
if (fToolTip != NULL)
|
||||||
fToolTip->ReleaseReference();
|
fToolTip->ReleaseReference();
|
||||||
@@ -251,17 +257,20 @@ TimeZoneView::_InitView()
|
|||||||
frameRight.top = frameLeft.top;
|
frameRight.top = frameLeft.top;
|
||||||
|
|
||||||
// Time Displays
|
// Time Displays
|
||||||
fCurrent = new TTZDisplay(frameRight, "currentTime", "Current time:");
|
fCurrent = new TTZDisplay(frameRight, "currentTime",
|
||||||
|
B_TRANSLATE("Current time:"));
|
||||||
AddChild(fCurrent);
|
AddChild(fCurrent);
|
||||||
fCurrent->ResizeToPreferred();
|
fCurrent->ResizeToPreferred();
|
||||||
|
|
||||||
frameRight.top = fCurrent->Frame().bottom + 10.0;
|
frameRight.top = fCurrent->Frame().bottom + 10.0;
|
||||||
fPreview = new TTZDisplay(frameRight, "previewTime", "Preview time:");
|
fPreview = new TTZDisplay(frameRight, "previewTime",
|
||||||
|
B_TRANSLATE("Preview time:"));
|
||||||
AddChild(fPreview);
|
AddChild(fPreview);
|
||||||
fPreview->ResizeToPreferred();
|
fPreview->ResizeToPreferred();
|
||||||
|
|
||||||
// set button
|
// set button
|
||||||
fSetZone = new BButton(frameRight, "setTimeZone", "Set time zone",
|
fSetZone = new BButton(frameRight, "setTimeZone",
|
||||||
|
B_TRANSLATE("Set time zone"),
|
||||||
new BMessage(H_SET_TIME_ZONE));
|
new BMessage(H_SET_TIME_ZONE));
|
||||||
AddChild(fSetZone);
|
AddChild(fSetZone);
|
||||||
fSetZone->SetEnabled(false);
|
fSetZone->SetEnabled(false);
|
||||||
@@ -291,7 +300,7 @@ TimeZoneView::_BuildZoneMenu()
|
|||||||
*/
|
*/
|
||||||
typedef std::map<BString, TimeZoneListItem*, TimeZoneItemLess> ZoneItemMap;
|
typedef std::map<BString, TimeZoneListItem*, TimeZoneItemLess> ZoneItemMap;
|
||||||
ZoneItemMap zoneMap;
|
ZoneItemMap zoneMap;
|
||||||
const char* kOtherRegion = "<Other>";
|
const char* kOtherRegion = B_TRANSLATE("<Other>");
|
||||||
const char* kSupportedRegions[] = {
|
const char* kSupportedRegions[] = {
|
||||||
"Africa", "America", "Antarctica", "Arctic", "Asia", "Atlantic",
|
"Africa", "America", "Antarctica", "Arctic", "Asia", "Atlantic",
|
||||||
"Australia", "Europe", "Indian", "Pacific", kOtherRegion, NULL
|
"Australia", "Europe", "Indian", "Pacific", kOtherRegion, NULL
|
||||||
@@ -327,7 +336,7 @@ TimeZoneView::_BuildZoneMenu()
|
|||||||
|
|
||||||
BString region(zoneID, slashPos);
|
BString region(zoneID, slashPos);
|
||||||
|
|
||||||
if (region == "Etc")
|
if (region == B_TRANSLATE("Etc"))
|
||||||
region = kOtherRegion;
|
region = kOtherRegion;
|
||||||
else if (countryName.Length() == 0) {
|
else if (countryName.Length() == 0) {
|
||||||
// skip global timezones from other regions, we are just
|
// skip global timezones from other regions, we are just
|
||||||
|
|||||||
Reference in New Issue
Block a user