Localization of some UI parts:
- context menu of the replicant dragger. Fixes #7363; - default <empty> menu placeholder. Fixes #7072; - other messages used in PrintJob, Dragger and ZombieReplicantView classes. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40991 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -89,6 +89,7 @@ private:
|
|||||||
|
|
||||||
BDragger& operator=(const BDragger& other);
|
BDragger& operator=(const BDragger& other);
|
||||||
|
|
||||||
|
void _InitData();
|
||||||
void _AddToList();
|
void _AddToList();
|
||||||
void _RemoveFromList();
|
void _RemoveFromList();
|
||||||
status_t _DetermineRelationship();
|
status_t _DetermineRelationship();
|
||||||
|
|||||||
@@ -18,7 +18,9 @@
|
|||||||
#include <Alert.h>
|
#include <Alert.h>
|
||||||
#include <Beep.h>
|
#include <Beep.h>
|
||||||
#include <Bitmap.h>
|
#include <Bitmap.h>
|
||||||
|
#include <Catalog.h>
|
||||||
#include <Dragger.h>
|
#include <Dragger.h>
|
||||||
|
#include <LocaleBackend.h>
|
||||||
#include <MenuItem.h>
|
#include <MenuItem.h>
|
||||||
#include <Message.h>
|
#include <Message.h>
|
||||||
#include <PopUpMenu.h>
|
#include <PopUpMenu.h>
|
||||||
@@ -35,6 +37,15 @@
|
|||||||
|
|
||||||
#include "ZombieReplicantView.h"
|
#include "ZombieReplicantView.h"
|
||||||
|
|
||||||
|
using BPrivate::gLocaleBackend;
|
||||||
|
using BPrivate::LocaleBackend;
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "Dragger"
|
||||||
|
|
||||||
|
#undef B_TRANSLATE
|
||||||
|
#define B_TRANSLATE(str) \
|
||||||
|
gLocaleBackend->GetString(B_TRANSLATE_MARK(str), "Dragger")
|
||||||
|
|
||||||
const uint32 kMsgDragStarted = 'Drgs';
|
const uint32 kMsgDragStarted = 'Drgs';
|
||||||
|
|
||||||
@@ -114,8 +125,7 @@ BDragger::BDragger(BRect bounds, BView *target, uint32 rmask, uint32 flags)
|
|||||||
fPopUpIsCustom(false),
|
fPopUpIsCustom(false),
|
||||||
fPopUp(NULL)
|
fPopUp(NULL)
|
||||||
{
|
{
|
||||||
fBitmap = new BBitmap(BRect(0.0f, 0.0f, 7.0f, 7.0f), B_CMAP8, false, false);
|
_InitData();
|
||||||
fBitmap->SetBits(kHandBitmap, fBitmap->BitsLength(), 0, B_CMAP8);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -132,8 +142,7 @@ BDragger::BDragger(BMessage *data)
|
|||||||
{
|
{
|
||||||
data->FindInt32("_rel", (int32 *)&fRelation);
|
data->FindInt32("_rel", (int32 *)&fRelation);
|
||||||
|
|
||||||
fBitmap = new BBitmap(BRect(0.0f, 0.0f, 7.0f, 7.0f), B_CMAP8, false, false);
|
_InitData();
|
||||||
fBitmap->SetBits(kHandBitmap, fBitmap->BitsLength(), 0, B_CMAP8);
|
|
||||||
|
|
||||||
BMessage popupMsg;
|
BMessage popupMsg;
|
||||||
if (data->FindMessage("_popup", &popupMsg) == B_OK) {
|
if (data->FindMessage("_popup", &popupMsg) == B_OK) {
|
||||||
@@ -292,10 +301,10 @@ BDragger::MessageReceived(BMessage *msg)
|
|||||||
if (fShelf != NULL)
|
if (fShelf != NULL)
|
||||||
Window()->PostMessage(kDeleteReplicant, fTarget, NULL);
|
Window()->PostMessage(kDeleteReplicant, fTarget, NULL);
|
||||||
else {
|
else {
|
||||||
(new BAlert("??",
|
(new BAlert(B_TRANSLATE("Warning"),
|
||||||
"Can't delete this replicant from its original "
|
B_TRANSLATE("Can't delete this replicant from its original "
|
||||||
"application. Life goes on.",
|
"application. Life goes on."),
|
||||||
"OK", NULL, NULL, B_WIDTH_FROM_WIDEST,
|
B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_FROM_WIDEST,
|
||||||
B_WARNING_ALERT))->Go(NULL);
|
B_WARNING_ALERT))->Go(NULL);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -615,6 +624,19 @@ BDragger::_UpdateShowAllDraggers(bool visible)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
BDragger::_InitData()
|
||||||
|
{
|
||||||
|
fBitmap = new BBitmap(BRect(0.0f, 0.0f, 7.0f, 7.0f), B_CMAP8, false, false);
|
||||||
|
fBitmap->SetBits(kHandBitmap, fBitmap->BitsLength(), 0, B_CMAP8);
|
||||||
|
|
||||||
|
// we need to translate some strings, and in order to do so, we need
|
||||||
|
// to use the LocaleBackend to reach liblocale.so
|
||||||
|
if (gLocaleBackend == NULL)
|
||||||
|
LocaleBackend::LoadBackend();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
BDragger::_AddToList()
|
BDragger::_AddToList()
|
||||||
{
|
{
|
||||||
@@ -722,12 +744,12 @@ BDragger::_BuildDefaultPopUp()
|
|||||||
if (name)
|
if (name)
|
||||||
msg->AddString("target", name);
|
msg->AddString("target", name);
|
||||||
|
|
||||||
char about[B_OS_NAME_LENGTH];
|
BString about(B_TRANSLATE("About %app"B_UTF8_ELLIPSIS));
|
||||||
snprintf(about, B_OS_NAME_LENGTH, "About %s" B_UTF8_ELLIPSIS, name);
|
about.ReplaceFirst("%app", name);
|
||||||
|
|
||||||
fPopUp->AddItem(new BMenuItem(about, msg));
|
fPopUp->AddItem(new BMenuItem(about.String(), msg));
|
||||||
fPopUp->AddSeparatorItem();
|
fPopUp->AddSeparatorItem();
|
||||||
fPopUp->AddItem(new BMenuItem("Remove replicant",
|
fPopUp->AddItem(new BMenuItem(B_TRANSLATE("Remove replicant"),
|
||||||
new BMessage(kDeleteReplicant)));
|
new BMessage(kDeleteReplicant)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,12 +17,14 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include <Bitmap.h>
|
#include <Bitmap.h>
|
||||||
|
#include <Catalog.h>
|
||||||
#include <ControlLook.h>
|
#include <ControlLook.h>
|
||||||
#include <Debug.h>
|
#include <Debug.h>
|
||||||
#include <File.h>
|
#include <File.h>
|
||||||
#include <FindDirectory.h>
|
#include <FindDirectory.h>
|
||||||
#include <Layout.h>
|
#include <Layout.h>
|
||||||
#include <LayoutUtils.h>
|
#include <LayoutUtils.h>
|
||||||
|
#include <LocaleBackend.h>
|
||||||
#include <MenuBar.h>
|
#include <MenuBar.h>
|
||||||
#include <MenuItem.h>
|
#include <MenuItem.h>
|
||||||
#include <Messenger.h>
|
#include <Messenger.h>
|
||||||
@@ -44,6 +46,17 @@
|
|||||||
|
|
||||||
#define USE_CACHED_MENUWINDOW 1
|
#define USE_CACHED_MENUWINDOW 1
|
||||||
|
|
||||||
|
using BPrivate::gLocaleBackend;
|
||||||
|
using BPrivate::LocaleBackend;
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "Menu"
|
||||||
|
|
||||||
|
#undef B_TRANSLATE
|
||||||
|
#define B_TRANSLATE(str) \
|
||||||
|
gLocaleBackend->GetString(B_TRANSLATE_MARK(str), "Menu")
|
||||||
|
|
||||||
|
|
||||||
using std::nothrow;
|
using std::nothrow;
|
||||||
using BPrivate::BMenuWindow;
|
using BPrivate::BMenuWindow;
|
||||||
|
|
||||||
@@ -180,6 +193,7 @@ static property_info sPropList[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// note: this is redefined to localized one in BMenu::_InitData
|
||||||
const char* BPrivate::kEmptyMenuLabel = "<empty>";
|
const char* BPrivate::kEmptyMenuLabel = "<empty>";
|
||||||
|
|
||||||
|
|
||||||
@@ -1396,6 +1410,13 @@ void BMenu::_ReservedMenu6() {}
|
|||||||
void
|
void
|
||||||
BMenu::_InitData(BMessage* archive)
|
BMenu::_InitData(BMessage* archive)
|
||||||
{
|
{
|
||||||
|
// we need to translate some strings, and in order to do so, we need
|
||||||
|
// to use the LocaleBackend to reach liblocale.so
|
||||||
|
if (gLocaleBackend == NULL)
|
||||||
|
LocaleBackend::LoadBackend();
|
||||||
|
|
||||||
|
BPrivate::kEmptyMenuLabel = B_TRANSLATE("<empty>");
|
||||||
|
|
||||||
// TODO: Get _color, _fname, _fflt from the message, if present
|
// TODO: Get _color, _fname, _fflt from the message, if present
|
||||||
BFont font;
|
BFont font;
|
||||||
font.SetFamilyAndStyle(sMenuInfo.f_family, sMenuInfo.f_style);
|
font.SetFamilyAndStyle(sMenuInfo.f_family, sMenuInfo.f_style);
|
||||||
|
|||||||
@@ -19,10 +19,12 @@
|
|||||||
#include <Alert.h>
|
#include <Alert.h>
|
||||||
#include <Application.h>
|
#include <Application.h>
|
||||||
#include <Button.h>
|
#include <Button.h>
|
||||||
|
#include <Catalog.h>
|
||||||
#include <Debug.h>
|
#include <Debug.h>
|
||||||
#include <Entry.h>
|
#include <Entry.h>
|
||||||
#include <File.h>
|
#include <File.h>
|
||||||
#include <FindDirectory.h>
|
#include <FindDirectory.h>
|
||||||
|
#include <LocaleBackend.h>
|
||||||
#include <Messenger.h>
|
#include <Messenger.h>
|
||||||
#include <NodeInfo.h>
|
#include <NodeInfo.h>
|
||||||
#include <OS.h>
|
#include <OS.h>
|
||||||
@@ -34,6 +36,16 @@
|
|||||||
#include <pr_server.h>
|
#include <pr_server.h>
|
||||||
#include <ViewPrivate.h>
|
#include <ViewPrivate.h>
|
||||||
|
|
||||||
|
using BPrivate::gLocaleBackend;
|
||||||
|
using BPrivate::LocaleBackend;
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "PrintJob"
|
||||||
|
|
||||||
|
#undef B_TRANSLATE
|
||||||
|
#define B_TRANSLATE(str) \
|
||||||
|
gLocaleBackend->GetString(B_TRANSLATE_MARK(str), "PrintJob")
|
||||||
|
|
||||||
|
|
||||||
/*! Summary of spool file:
|
/*! Summary of spool file:
|
||||||
|
|
||||||
@@ -92,7 +104,7 @@ struct _page_header_ {
|
|||||||
static void
|
static void
|
||||||
ShowError(const char* message)
|
ShowError(const char* message)
|
||||||
{
|
{
|
||||||
BAlert* alert = new BAlert("Error", message, "OK");
|
BAlert* alert = new BAlert(B_TRANSLATE("Error"), message, B_TRANSLATE("OK"));
|
||||||
alert->Go();
|
alert->Go();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -158,6 +170,11 @@ BPrintJob::BPrintJob(const char* jobName)
|
|||||||
fCurrentPageHeader = new _page_header_;
|
fCurrentPageHeader = new _page_header_;
|
||||||
if (fCurrentPageHeader != NULL)
|
if (fCurrentPageHeader != NULL)
|
||||||
memset(fCurrentPageHeader, 0, sizeof(_page_header_));
|
memset(fCurrentPageHeader, 0, sizeof(_page_header_));
|
||||||
|
|
||||||
|
// we need to translate some strings, and in order to do so, we need
|
||||||
|
// to use the LocaleBackend to reach liblocale.so
|
||||||
|
if (gLocaleBackend == NULL)
|
||||||
|
LocaleBackend::LoadBackend();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -282,7 +299,7 @@ BPrintJob::CommitJob()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (fSpoolFileHeader.page_count == 0) {
|
if (fSpoolFileHeader.page_count == 0) {
|
||||||
ShowError("No Pages to print!");
|
ShowError(B_TRANSLATE("No Pages to print!"));
|
||||||
CancelJob();
|
CancelJob();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -843,7 +860,7 @@ PrintServerMessenger::MessengerThread(void* data)
|
|||||||
|
|
||||||
BMessenger printServer;
|
BMessenger printServer;
|
||||||
if (messenger->GetPrintServerMessenger(printServer) != B_OK) {
|
if (messenger->GetPrintServerMessenger(printServer) != B_OK) {
|
||||||
ShowError("Print Server is not responding.");
|
ShowError(B_TRANSLATE("Print Server is not responding."));
|
||||||
messenger->SetResult(NULL);
|
messenger->SetResult(NULL);
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,8 +7,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <Alert.h>
|
#include <Alert.h>
|
||||||
|
#include <Catalog.h>
|
||||||
|
#include <LocaleBackend.h>
|
||||||
#include <Message.h>
|
#include <Message.h>
|
||||||
#include <MimeType.h>
|
#include <MimeType.h>
|
||||||
|
#include <String.h>
|
||||||
|
|
||||||
#include "ZombieReplicantView.h"
|
#include "ZombieReplicantView.h"
|
||||||
|
|
||||||
@@ -17,6 +20,15 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <new>
|
#include <new>
|
||||||
|
|
||||||
|
using BPrivate::gLocaleBackend;
|
||||||
|
using BPrivate::LocaleBackend;
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "ZombieReplicantView"
|
||||||
|
|
||||||
|
#undef B_TRANSLATE
|
||||||
|
#define B_TRANSLATE(str) \
|
||||||
|
gLocaleBackend->GetString(B_TRANSLATE_MARK(str), "ZombieReplicantView")
|
||||||
|
|
||||||
|
|
||||||
_BZombieReplicantView_::_BZombieReplicantView_(BRect frame, status_t error)
|
_BZombieReplicantView_::_BZombieReplicantView_(BRect frame, status_t error)
|
||||||
@@ -28,6 +40,11 @@ _BZombieReplicantView_::_BZombieReplicantView_(BRect frame, status_t error)
|
|||||||
font.SetSize(9.0f); // TODO
|
font.SetSize(9.0f); // TODO
|
||||||
SetFont(&font);
|
SetFont(&font);
|
||||||
SetViewColor(kZombieColor);
|
SetViewColor(kZombieColor);
|
||||||
|
|
||||||
|
// we need to translate some strings, and in order to do so, we need
|
||||||
|
// to use the LocaleBackend to reach liblocale.so
|
||||||
|
if (gLocaleBackend == NULL)
|
||||||
|
LocaleBackend::LoadBackend();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -43,22 +60,22 @@ _BZombieReplicantView_::MessageReceived(BMessage* msg)
|
|||||||
case B_ABOUT_REQUESTED:
|
case B_ABOUT_REQUESTED:
|
||||||
{
|
{
|
||||||
const char* addOn = NULL;
|
const char* addOn = NULL;
|
||||||
char error[1024];
|
BString error;
|
||||||
if (fArchive->FindString("add_on", &addOn) == B_OK) {
|
if (fArchive->FindString("add_on", &addOn) == B_OK) {
|
||||||
char description[B_MIME_TYPE_LENGTH] = "";
|
char description[B_MIME_TYPE_LENGTH] = "";
|
||||||
BMimeType type(addOn);
|
BMimeType type(addOn);
|
||||||
type.GetShortDescription(description);
|
type.GetShortDescription(description);
|
||||||
snprintf(error, sizeof(error),
|
error = B_TRANSLATE("Cannot create the replicant for "
|
||||||
"Cannot create the replicant for \"%s\". (%s)",
|
"\"%description\".\n%error");
|
||||||
description, strerror(fError));
|
error.ReplaceFirst("%description", description);
|
||||||
} else {
|
} else
|
||||||
snprintf(error, sizeof(error),
|
error = B_TRANSLATE("Cannot locate the application for the "
|
||||||
"Cannot locate the application for the replicant. "
|
"replicant. No application signature supplied.\n%error)");
|
||||||
"No application signature supplied. (%s)", strerror(fError));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
error.ReplaceFirst("%error", strerror(fError));
|
||||||
|
|
||||||
BAlert* alert = new (std::nothrow) BAlert("Error", error, "OK", NULL, NULL,
|
BAlert* alert = new (std::nothrow) BAlert(B_TRANSLATE("Error"),
|
||||||
|
error.String(), B_TRANSLATE("OK"), NULL, NULL,
|
||||||
B_WIDTH_AS_USUAL, B_STOP_ALERT);
|
B_WIDTH_AS_USUAL, B_STOP_ALERT);
|
||||||
if (alert != NULL)
|
if (alert != NULL)
|
||||||
alert->Go();
|
alert->Go();
|
||||||
|
|||||||
@@ -68,6 +68,10 @@ SEARCH on [ FGristFiles AboutWindow.cpp ] += [ FDirName $(HAIKU_TOP) src kits sh
|
|||||||
SEARCH on [ FGristFiles ColorControl.cpp ] += [ FDirName $(HAIKU_TOP) src kits interface ] ;
|
SEARCH on [ FGristFiles ColorControl.cpp ] += [ FDirName $(HAIKU_TOP) src kits interface ] ;
|
||||||
SEARCH on [ FGristFiles StringForSize.cpp ] += [ FDirName $(HAIKU_TOP) src kits shared ] ;
|
SEARCH on [ FGristFiles StringForSize.cpp ] += [ FDirName $(HAIKU_TOP) src kits shared ] ;
|
||||||
SEARCH on [ FGristFiles TextView.cpp ] += [ FDirName $(HAIKU_TOP) src kits interface ] ;
|
SEARCH on [ FGristFiles TextView.cpp ] += [ FDirName $(HAIKU_TOP) src kits interface ] ;
|
||||||
|
SEARCH on [ FGristFiles Dragger.cpp ] += [ FDirName $(HAIKU_TOP) src kits interface ] ;
|
||||||
|
SEARCH on [ FGristFiles Menu.cpp ] += [ FDirName $(HAIKU_TOP) src kits interface ] ;
|
||||||
|
SEARCH on [ FGristFiles PrintJob.cpp ] += [ FDirName $(HAIKU_TOP) src kits interface ] ;
|
||||||
|
SEARCH on [ FGristFiles ZombieReplicantView.cpp ] += [ FDirName $(HAIKU_TOP) src kits interface ] ;
|
||||||
|
|
||||||
DoCatalogs liblocale.so
|
DoCatalogs liblocale.so
|
||||||
: system
|
: system
|
||||||
@@ -75,6 +79,10 @@ DoCatalogs liblocale.so
|
|||||||
AboutMenuItem.cpp
|
AboutMenuItem.cpp
|
||||||
AboutWindow.cpp
|
AboutWindow.cpp
|
||||||
ColorControl.cpp
|
ColorControl.cpp
|
||||||
|
Dragger.cpp
|
||||||
|
Menu.cpp
|
||||||
|
PrintJob.cpp
|
||||||
StringForSize.cpp
|
StringForSize.cpp
|
||||||
TextView.cpp
|
TextView.cpp
|
||||||
|
ZombieReplicantView.cpp
|
||||||
;
|
;
|
||||||
|
|||||||
Reference in New Issue
Block a user