Ticket #7150: notification_server-localization.patch
File notification_server-localization.patch, 6.5 KB (added by , 13 years ago) |
---|
-
src/servers/notification/NotificationWindow.cpp
18 18 19 19 #include <Alert.h> 20 20 #include <Application.h> 21 #include <Catalog.h> 21 22 #include <Debug.h> 22 23 #include <File.h> 23 24 #include <NodeMonitor.h> … … 27 28 #include "AppUsage.h" 28 29 #include "BorderView.h" 29 30 31 #undef B_TRANSLATE_CONTEXT 32 #define B_TRANSLATE_CONTEXT "NotificationWindow" 30 33 34 31 35 property_info main_prop_list[] = { 32 {"message", {B_GET_PROPERTY, 0}, {B_INDEX_SPECIFIER, 0}, "get a message"}, 36 {"message", {B_GET_PROPERTY, 0}, {B_INDEX_SPECIFIER, 0}, 37 B_TRANSLATE_MARK("get a message")}, 33 38 {"message", {B_COUNT_PROPERTIES, 0}, {B_DIRECT_SPECIFIER, 0}, 34 "count messages"},39 B_TRANSLATE_MARK("count messages")}, 35 40 {"message", {B_CREATE_PROPERTY, 0}, {B_DIRECT_SPECIFIER, 0}, 36 "create a message"},41 B_TRANSLATE_MARK("create a message")}, 37 42 {"message", {B_SET_PROPERTY, 0}, {B_INDEX_SPECIFIER, 0}, 38 "modify a message"},43 B_TRANSLATE_MARK("modify a message")}, 39 44 {0} 40 45 }; 41 46 … … 45 50 const float kPenSize = 1; 46 51 const float kEdgePadding = 5; 47 52 const float kSmallPadding = 2; 53 static const BString kFilterMonitorStr(B_TRANSLATE_MARK("Couldn't start " 54 "filter monitor. Live filter changes disabled.")); 55 static const BString kDisplaySettingsStr(B_TRANSLATE_MARK("Couldn't start " 56 "display settings monitor.\nLive filter changes disabled.")); 57 static const BString kGeneralSettingsStr(B_TRANSLATE_MARK("Couldn't start " 58 "general settings monitor.\nLive filter changes disabled.")); 59 static const BString kOKStr(B_TRANSLATE_MARK("OK")); 60 static const BString kDarnStr(B_TRANSLATE_MARK("Darn.")); 48 61 49 62 50 63 NotificationWindow::NotificationWindow() 51 64 : 52 BWindow(BRect(10, 10, 30, 30), "Notification", B_BORDERED_WINDOW, 53 B_AVOID_FRONT | B_AVOID_FOCUS | B_NOT_CLOSABLE | B_NOT_ZOOMABLE 54 | B_NOT_MINIMIZABLE | B_NOT_RESIZABLE, B_ALL_WORKSPACES) 65 BWindow(BRect(10, 10, 30, 30), B_TRANSLATE_MARK("Notification"), 66 B_BORDERED_WINDOW, B_AVOID_FRONT | B_AVOID_FOCUS | B_NOT_CLOSABLE 67 | B_NOT_ZOOMABLE | B_NOT_MINIMIZABLE | B_NOT_RESIZABLE, 68 B_ALL_WORKSPACES) 55 69 { 56 70 fBorder = new BorderView(Bounds(), "Notification"); 57 71 … … 470 484 entry.GetNodeRef(&nref); 471 485 472 486 if (watch_node(&nref, B_WATCH_ALL, BMessenger(this)) != B_OK) { 473 BAlert* alert = new BAlert("", "Couldn't start filter "474 " monitor. Live filter changes disabled.", "Darn.");487 BAlert* alert = new BAlert("", kFilterMonitorStr.String(), 488 kDarnStr.String()); 475 489 alert->Go(); 476 490 } 477 491 } … … 534 548 entry.GetNodeRef(&nref); 535 549 536 550 if (watch_node(&nref, B_WATCH_ALL, BMessenger(this)) != B_OK) { 537 BAlert* alert = new BAlert("", "Couldn't start general settings "538 " monitor.\nLive filter changes disabled.", "OK");551 BAlert* alert = new BAlert("", kGeneralSettingsStr.String(), 552 kOKStr.String()); 539 553 alert->Go(); 540 554 } 541 555 } … … 598 612 entry.GetNodeRef(&nref); 599 613 600 614 if (watch_node(&nref, B_WATCH_ALL, BMessenger(this)) != B_OK) { 601 BAlert* alert = new BAlert("", "Couldn't start display settings "602 " monitor.\nLive filter changes disabled.", "OK");615 BAlert* alert = new BAlert("", kDisplaySettingsStr.String(), 616 kOKStr.String()); 603 617 alert->Go(); 604 618 } 605 619 } -
src/servers/notification/NotificationView.cpp
14 14 15 15 #include <stdlib.h> 16 16 17 #include <Catalog.h> 17 18 #include <Font.h> 18 19 #include <IconUtils.h> 19 20 #include <Messenger.h> … … 28 29 #include "NotificationView.h" 29 30 #include "NotificationWindow.h" 30 31 32 #undef B_TRANSLATE_CONTEXT 33 #define B_TRANSLATE_CONTEXT "NotificationView" 34 31 35 const char* kSmallIconAttribute = "BEOS:M:STD_ICON"; 32 36 const char* kLargeIconAttribute = "BEOS:L:STD_ICON"; 33 37 const char* kIconAttribute = "BEOS:ICON"; 34 38 35 39 property_info message_prop_list[] = { 36 40 { "type", {B_GET_PROPERTY, B_SET_PROPERTY, 0}, 37 {B_DIRECT_SPECIFIER, 0}, "get the notification type"},41 {B_DIRECT_SPECIFIER, 0}, B_TRANSLATE_MARK("get the notification type")}, 38 42 { "app", {B_GET_PROPERTY, B_SET_PROPERTY, 0}, 39 {B_DIRECT_SPECIFIER, 0}, "get notification's app"},43 {B_DIRECT_SPECIFIER, 0}, B_TRANSLATE_MARK("get notification's app")}, 40 44 { "title", {B_GET_PROPERTY, B_SET_PROPERTY, 0}, 41 {B_DIRECT_SPECIFIER, 0}, "get notification's title"},45 {B_DIRECT_SPECIFIER, 0}, B_TRANSLATE_MARK("get notification's title")}, 42 46 { "content", {B_GET_PROPERTY, B_SET_PROPERTY, 0}, 43 {B_DIRECT_SPECIFIER, 0}, "get notification's contents"},47 {B_DIRECT_SPECIFIER, 0}, B_TRANSLATE_MARK("get notification's contents")}, 44 48 { "icon", {B_GET_PROPERTY, 0}, 45 {B_DIRECT_SPECIFIER, 0}, "get icon as an archived bitmap"},49 {B_DIRECT_SPECIFIER, 0}, B_TRANSLATE_MARK("get icon as an archived bitmap")}, 46 50 { "progress", {B_GET_PROPERTY, B_SET_PROPERTY, 0}, 47 {B_DIRECT_SPECIFIER, 0}, "get the progress (between 0.0 and 1.0)"},51 {B_DIRECT_SPECIFIER, 0}, B_TRANSLATE_MARK("get the progress (between 0.0 and 1.0)")}, 48 52 { NULL } 49 53 }; 50 54 -
src/servers/notification/Jamfile
13 13 : notification_server.rdef 14 14 ; 15 15 16 DoCatalogs notification_server : 17 x-vnd.Haiku-notification_server 18 : 19 NotificationServer.cpp 20 NotificationView.cpp 21 NotificationWindow.cpp 22 ; 23 16 24 Depends notification_server : libicon.a ; 17 25 Depends notification_server : libnotification.a ; -
src/servers/notification/NotificationServer.cpp
6 6 * Pier Luigi Fiorini, pierluigi.fiorini@gmail.com 7 7 */ 8 8 9 #include <Catalog.h> 9 10 #include <Beep.h> 10 11 #include <Notifications.h> 11 12 12 13 #include "NotificationWindow.h" 13 14 #include "NotificationServer.h" 14 15 16 #undef B_TRANSLATE_CONTEXT 17 #define B_TRANSLATE_CONTEXT "NotificationServer" 18 15 19 const char* kSoundNames[] = { 16 "Information notification",17 "Important notification",18 "Error notification",19 "Progress notification",20 B_TRANSLATE_MARK("Information notification"), 21 B_TRANSLATE_MARK("Important notification"), 22 B_TRANSLATE_MARK("Error notification"), 23 B_TRANSLATE_MARK("Progress notification"), 20 24 NULL 21 25 }; 22 26