Ticket #7150: notification_server-localization.patch

File notification_server-localization.patch, 6.5 KB (added by Karvjorm, 13 years ago)

A notification_server localization patch.

  • src/servers/notification/NotificationWindow.cpp

     
    1818
    1919#include <Alert.h>
    2020#include <Application.h>
     21#include <Catalog.h>
    2122#include <Debug.h>
    2223#include <File.h>
    2324#include <NodeMonitor.h>
     
    2728#include "AppUsage.h"
    2829#include "BorderView.h"
    2930
     31#undef B_TRANSLATE_CONTEXT
     32#define B_TRANSLATE_CONTEXT "NotificationWindow"
    3033
     34
    3135property_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")},
    3338    {"message", {B_COUNT_PROPERTIES, 0}, {B_DIRECT_SPECIFIER, 0},
    34         "count messages"},
     39        B_TRANSLATE_MARK("count messages")},
    3540    {"message", {B_CREATE_PROPERTY, 0}, {B_DIRECT_SPECIFIER, 0},
    36         "create a message"},
     41        B_TRANSLATE_MARK("create a message")},
    3742    {"message", {B_SET_PROPERTY, 0}, {B_INDEX_SPECIFIER, 0},
    38         "modify a message"},
     43        B_TRANSLATE_MARK("modify a message")},
    3944    {0}
    4045};
    4146
     
    4550const float kPenSize                = 1;
    4651const float kEdgePadding            = 5;
    4752const float kSmallPadding           = 2;
     53static const BString kFilterMonitorStr(B_TRANSLATE_MARK("Couldn't start "
     54    "filter monitor. Live filter changes disabled."));
     55static const BString kDisplaySettingsStr(B_TRANSLATE_MARK("Couldn't start "
     56    "display settings monitor.\nLive filter changes disabled."));
     57static const BString kGeneralSettingsStr(B_TRANSLATE_MARK("Couldn't start "
     58    "general settings monitor.\nLive filter changes disabled."));
     59static const BString kOKStr(B_TRANSLATE_MARK("OK"));
     60static const BString kDarnStr(B_TRANSLATE_MARK("Darn."));
    4861
    4962
    5063NotificationWindow::NotificationWindow()
    5164    :
    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)
    5569{
    5670    fBorder = new BorderView(Bounds(), "Notification");
    5771
     
    470484        entry.GetNodeRef(&nref);
    471485
    472486        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());
    475489            alert->Go();
    476490        }
    477491    }
     
    534548        entry.GetNodeRef(&nref);
    535549
    536550        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());
    539553            alert->Go();
    540554        }
    541555    }
     
    598612        entry.GetNodeRef(&nref);
    599613
    600614        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());
    603617            alert->Go();
    604618        }
    605619    }
  • src/servers/notification/NotificationView.cpp

     
    1414
    1515#include <stdlib.h>
    1616
     17#include <Catalog.h>
    1718#include <Font.h>
    1819#include <IconUtils.h>
    1920#include <Messenger.h>
     
    2829#include "NotificationView.h"
    2930#include "NotificationWindow.h"
    3031
     32#undef B_TRANSLATE_CONTEXT
     33#define B_TRANSLATE_CONTEXT "NotificationView"
     34
    3135const char* kSmallIconAttribute = "BEOS:M:STD_ICON";
    3236const char* kLargeIconAttribute = "BEOS:L:STD_ICON";
    3337const char* kIconAttribute      = "BEOS:ICON";
    3438
    3539property_info message_prop_list[] = {
    3640    { "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")},
    3842    { "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")},
    4044    { "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")},
    4246    { "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")},
    4448    { "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")},
    4650    { "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)")},
    4852    { NULL }
    4953};
    5054
  • src/servers/notification/Jamfile

     
    1313    : notification_server.rdef
    1414;
    1515
     16DoCatalogs notification_server :
     17    x-vnd.Haiku-notification_server
     18    :
     19    NotificationServer.cpp
     20    NotificationView.cpp
     21    NotificationWindow.cpp
     22;
     23
    1624Depends notification_server : libicon.a ;
    1725Depends notification_server : libnotification.a ;
  • src/servers/notification/NotificationServer.cpp

     
    66 *      Pier Luigi Fiorini, pierluigi.fiorini@gmail.com
    77 */
    88
     9#include <Catalog.h>
    910#include <Beep.h>
    1011#include <Notifications.h>
    1112
    1213#include "NotificationWindow.h"
    1314#include "NotificationServer.h"
    1415
     16#undef B_TRANSLATE_CONTEXT
     17#define B_TRANSLATE_CONTEXT "NotificationServer"
     18
    1519const 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"),
    2024    NULL
    2125};
    2226