Ticket #6110: pulseLocalization.patch

File pulseLocalization.patch, 25.9 KB (added by Karvjorm, 14 years ago)

A localization patch for Pulse

  • src/apps/pulse/ConfigView.cpp

     
    1414#include "PulseApp.h"
    1515#include "PrefsWindow.h"
    1616
     17#include <Catalog.h>
    1718#include <CheckBox.h>
     19#include <Locale.h>
    1820#include <RadioButton.h>
    1921#include <TextControl.h>
    2022
     
    2325#include <stdio.h>
    2426#include <string.h>
    2527
     28#undef B_TRANSLATE_CONTEXT
     29#define B_TRANSLATE_CONTEXT "ConfigView"
    2630
     31
    2732RTColorControl::RTColorControl(BPoint point, BMessage *message)
    2833    : BColorControl(point, B_CELLS_32x8, 6, "ColorControl", message, false)
    2934{
     
    6166    fActiveButton = fIdleButton = fFrameButton = NULL;
    6267    fIconWidthControl = NULL;
    6368
    64     SetLabel("Bar colors");
     69    SetLabel(B_TRANSLATE("Bar colors"));
    6570
    6671    font_height fontHeight;
    6772    be_bold_font->GetHeight(&fontHeight);
     
    7883    if (mode == PRV_NORMAL_CHANGE_COLOR) {
    7984        // normal mode
    8085
    81         fFadeCheckBox = new BCheckBox(rect, "FadeColors", "Fade colors",
    82             new BMessage(PRV_NORMAL_FADE_COLORS));
     86        fFadeCheckBox = new BCheckBox(rect, "FadeColors",
     87            B_TRANSLATE("Fade colors"), new BMessage(PRV_NORMAL_FADE_COLORS));
    8388        fFadeCheckBox->ResizeToPreferred();
    8489        AddChild(fFadeCheckBox);
    8590
     
    8893    } else if (mode == PRV_MINI_CHANGE_COLOR) {
    8994        // mini mode
    9095
    91         fActiveButton = new BRadioButton(rect, "ActiveColor", "Active color",
    92             new BMessage(PRV_MINI_ACTIVE));
     96        fActiveButton = new BRadioButton(rect, "ActiveColor",
     97            B_TRANSLATE("Active color"), new BMessage(PRV_MINI_ACTIVE));
    9398        fActiveButton->ResizeToPreferred();
    9499        fActiveButton->SetValue(B_CONTROL_ON);
    95100        AddChild(fActiveButton);
    96101
    97102        rect.left = fActiveButton->Frame().right + 5.0f;
    98         fIdleButton = new BRadioButton(rect, "IdleColor", "Idle color",
    99             new BMessage(PRV_MINI_IDLE));
     103        fIdleButton = new BRadioButton(rect, "IdleColor",
     104            B_TRANSLATE("Idle color"), new BMessage(PRV_MINI_IDLE));
    100105        fIdleButton->ResizeToPreferred();
    101106        AddChild(fIdleButton);
    102107
    103108        rect.left = fIdleButton->Frame().right + 5.0f;
    104         fFrameButton = new BRadioButton(rect, "FrameColor", "Frame color",
    105             new BMessage(PRV_MINI_FRAME));
     109        fFrameButton = new BRadioButton(rect, "FrameColor",
     110            B_TRANSLATE("Frame color"), new BMessage(PRV_MINI_FRAME));
    106111        fFrameButton->ResizeToPreferred();
    107112        AddChild(fFrameButton);
    108113
    109114        fColorControl->SetValue(fPrefs->mini_active_color);
    110115    } else {
    111116        // deskbar mode
    112         fActiveButton = new BRadioButton(rect, "ActiveColor", "Active color",
    113             new BMessage(PRV_DESKBAR_ACTIVE));
     117        fActiveButton = new BRadioButton(rect, "ActiveColor",
     118            B_TRANSLATE("Active color"), new BMessage(PRV_DESKBAR_ACTIVE));
    114119        fActiveButton->ResizeToPreferred();
    115120        fActiveButton->SetValue(B_CONTROL_ON);
    116121        AddChild(fActiveButton);
    117122
    118123        rect.left = fActiveButton->Frame().right + 5.0f;
    119         fIdleButton = new BRadioButton(rect, "IdleColor", "Idle color",
    120             new BMessage(PRV_DESKBAR_IDLE));
     124        fIdleButton = new BRadioButton(rect, "IdleColor",
     125            B_TRANSLATE("Idle color"), new BMessage(PRV_DESKBAR_IDLE));
    121126        fIdleButton->ResizeToPreferred();
    122127        AddChild(fIdleButton);
    123128
    124129        rect.left = fIdleButton->Frame().right + 5.0f;
    125         fFrameButton = new BRadioButton(rect, "FrameColor", "Frame color",
    126             new BMessage(PRV_DESKBAR_FRAME));
     130        fFrameButton = new BRadioButton(rect, "FrameColor",
     131            B_TRANSLATE("Frame color"), new BMessage(PRV_DESKBAR_FRAME));
    127132        fFrameButton->ResizeToPreferred();
    128133        AddChild(fFrameButton);
    129134
     
    132137
    133138        char temp[10];
    134139        snprintf(temp, sizeof(temp), "%d", fPrefs->deskbar_icon_width);
    135         fIconWidthControl = new BTextControl(rect, "Width", "Width of icon:", temp,
     140        fIconWidthControl = new BTextControl(rect, "Width",
     141            B_TRANSLATE("Width of icon:"), temp,
    136142            new BMessage(PRV_DESKBAR_ICON_WIDTH));
    137143        AddChild(fIconWidthControl);
    138144        fIconWidthControl->SetDivider(be_plain_font->StringWidth(
  • src/apps/pulse/MiniPulseView.cpp

     
    1 //****************************************************************************************
     1//*****************************************************************************
    22//
    33//  File:       MiniPulseView.cpp
    44//
     
    66//
    77//  Copyright 1999, Be Incorporated
    88//
    9 //****************************************************************************************
     9//*****************************************************************************
    1010
    1111#include "MiniPulseView.h"
    1212#include "Common.h"
     13#include <Catalog.h>
     14#include <Locale.h>
    1315#include <interface/Window.h>
    1416
     17#undef B_TRANSLATE_CONTEXT
     18#define B_TRANSLATE_CONTEXT "MiniPulseView"
     19
     20
    1521MiniPulseView::MiniPulseView(BRect rect, const char *name, Prefs *prefs) :
    1622    PulseView(rect, name) {
    1723
    18     mode1->SetLabel("Normal mode");
     24    mode1->SetLabel(B_TRANSLATE("Normal mode"));
    1925    mode1->SetMessage(new BMessage(PV_NORMAL_MODE));
    20     mode2->SetLabel("Deskbar mode");
     26    mode2->SetLabel(B_TRANSLATE("Deskbar mode"));
    2127    mode2->SetMessage(new BMessage(PV_DESKBAR_MODE));
    22     quit = new BMenuItem("Quit", new BMessage(PV_QUIT), 0, 0);
     28    quit = new BMenuItem(B_TRANSLATE("Quit"), new BMessage(PV_QUIT), 0, 0);
    2329    popupmenu->AddSeparatorItem();
    2430    popupmenu->AddItem(quit);
    2531   
     
    4147}
    4248
    4349// These two are only used by DeskbarPulseView, and so do nothing
    44 MiniPulseView::MiniPulseView(BRect rect, const char *name) : PulseView(rect, name) {
     50MiniPulseView::MiniPulseView(BRect rect, const char *name)
     51 :
     52 PulseView(rect, name)
     53{
    4554
    4655}
    4756
    48 MiniPulseView::MiniPulseView(BMessage *message) : PulseView(message) {
     57MiniPulseView::MiniPulseView(BMessage *message)
     58 :
     59 PulseView(message)
     60{
    4961
    5062}
    5163
     
    5365void MiniPulseView::Draw(BRect rect) {
    5466    system_info sys_info;
    5567    get_system_info(&sys_info);
    56     if (sys_info.cpu_count > B_MAX_CPU_COUNT || sys_info.cpu_count <= 0) return;
     68    if (sys_info.cpu_count > B_MAX_CPU_COUNT || sys_info.cpu_count <= 0)
     69        return;
    5770   
    5871    BRect bounds(Bounds());
    5972    SetDrawingMode(B_OP_COPY);
     
    7083        double rem = cpu_times[x] * (h + 1) - bar_height;
    7184
    7285        rgb_color fraction_color;
    73         fraction_color.red = (uint8)(idle_color.red + rem * (active_color.red - idle_color.red));
    74         fraction_color.green = (uint8)(idle_color.green + rem * (active_color.green - idle_color.green));
    75         fraction_color.blue = (uint8)(idle_color.blue + rem * (active_color.blue - idle_color.blue));
     86        fraction_color.red = (uint8)(idle_color.red + rem
     87            * (active_color.red - idle_color.red));
     88        fraction_color.green = (uint8)(idle_color.green + rem
     89            * (active_color.green - idle_color.green));
     90        fraction_color.blue = (uint8)(idle_color.blue + rem
     91            * (active_color.blue - idle_color.blue));
    7692        fraction_color.alpha = 0xff;
    7793
    7894        int idle_height = h - bar_height;
  • src/apps/pulse/PrefsWindow.cpp

     
    1414#include "PulseApp.h"
    1515#include "ConfigView.h"
    1616
     17#include <Catalog.h>
    1718#include <Button.h>
     19#include <Locale.h>
    1820#include <TabView.h>
    1921#include <TextControl.h>
    2022
    2123#include <stdlib.h>
    2224#include <stdio.h>
    2325
     26#undef B_TRANSLATE_CONTEXT
     27#define B_TRANSLATE_CONTEXT "PrefsWindow"
    2428
    25 PrefsWindow::PrefsWindow(BRect frame, const char *name, BMessenger *messenger, Prefs *prefs)
     29
     30PrefsWindow::PrefsWindow(BRect frame, const char *name,
     31    BMessenger *messenger, Prefs *prefs)
    2632    : BWindow(frame, name, B_TITLED_WINDOW, B_NOT_RESIZABLE | B_NOT_ZOOMABLE
    2733        | B_NOT_MINIMIZABLE | B_ASYNCHRONOUS_CONTROLS),
    2834    fTarget(*messenger),
     
    4349    BRect rect = fTabView->ContainerView()->Bounds();
    4450    rect.InsetBy(5, 5);
    4551
    46     ConfigView *normalView = new ConfigView(rect, "Normal mode",
     52    ConfigView *normalView = new ConfigView(rect, B_TRANSLATE("Normal mode"),
    4753        PRV_NORMAL_CHANGE_COLOR, fTarget, prefs);
    4854    fTabView->AddTab(normalView);
    4955
    50     ConfigView *miniView = new ConfigView(rect, "Mini mode", PRV_MINI_CHANGE_COLOR,
    51         fTarget, prefs);
     56    ConfigView *miniView = new ConfigView(rect, B_TRANSLATE("Mini mode"),
     57        PRV_MINI_CHANGE_COLOR, fTarget, prefs);
    5258    fTabView->AddTab(miniView);
    5359
    54     ConfigView *deskbarView = new ConfigView(rect, "Deskbar mode", PRV_DESKBAR_CHANGE_COLOR,
    55         fTarget, prefs);
     60    ConfigView *deskbarView = new ConfigView(rect, B_TRANSLATE("Deskbar mode"),
     61        PRV_DESKBAR_CHANGE_COLOR, fTarget, prefs);
    5662    fTabView->AddTab(deskbarView);
    5763
    5864    float width, height;
     
    6268    deskbarView->ResizeTo(width, height);
    6369
    6470    fTabView->Select(0L);
    65     fTabView->ResizeTo(deskbarView->Bounds().Width() + 16.0f, deskbarView->Bounds().Height()
    66         + fTabView->ContainerView()->Frame().top + 16.0f);
     71    fTabView->ResizeTo(deskbarView->Bounds().Width() + 16.0f,
     72        deskbarView->Bounds().Height() +
     73        fTabView->ContainerView()->Frame().top + 16.0f);
    6774
    68     BButton *okButton = new BButton(rect, "ok", "OK", new BMessage(PRV_BOTTOM_OK),
    69         B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM);
     75    BButton *okButton = new BButton(rect, "ok", B_TRANSLATE("OK"),
     76        new BMessage(PRV_BOTTOM_OK), B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM);
    7077    okButton->ResizeToPreferred();
    7178    okButton->MoveTo(Bounds().Width() - 8.0f - okButton->Bounds().Width(),
    7279        Bounds().Height() - 8.0f - okButton->Bounds().Height());
    7380    topView->AddChild(okButton);
    7481
    75     BButton *defaultsButton = new BButton(okButton->Frame(), "defaults", "Defaults",
    76         new BMessage(PRV_BOTTOM_DEFAULTS), B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM);
     82    BButton *defaultsButton = new BButton(okButton->Frame(), "defaults",
     83        B_TRANSLATE("Defaults"), new BMessage(PRV_BOTTOM_DEFAULTS),
     84        B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM);
    7785    defaultsButton->ResizeToPreferred();
    7886    defaultsButton->MoveBy(-defaultsButton->Bounds().Width() - 10.0f, 0.0f);
    7987    topView->AddChild(defaultsButton);
     
    102110            Hide();
    103111
    104112            fTabView->Select(2);
    105             ConfigView *deskbar = (ConfigView *)FindView("Deskbar mode");
     113            ConfigView *deskbar = (ConfigView *)FindView(
     114                B_TRANSLATE("Deskbar mode"));
    106115            deskbar->UpdateDeskbarIconWidth();
    107116
    108117            PostMessage(B_QUIT_REQUESTED);
  • src/apps/pulse/DeskbarPulseView.cpp

     
    1212#include "Common.h"
    1313#include "Prefs.h"
    1414#include <app/Application.h>
     15#include <Catalog.h>
    1516#include <interface/Deskbar.h>
    1617#include <interface/Alert.h>
     18#include <Locale.h>
    1719#include <Roster.h>
    1820#include <stdlib.h>
    1921#include <string.h>
    2022#include <stdio.h>
    2123
     24#undef B_TRANSLATE_CONTEXT
     25#define B_TRANSLATE_CONTEXT "DeskbarPulseView"
     26
     27
    2228DeskbarPulseView::DeskbarPulseView(BRect rect) : MiniPulseView(rect, "DeskbarPulseView") {
    2329    messagerunner = NULL;
    2430    prefs = NULL;
     
    2632}
    2733
    2834DeskbarPulseView::DeskbarPulseView(BMessage *message) : MiniPulseView(message) {
    29     mode1->SetLabel("Normal mode");
     35    mode1->SetLabel(B_TRANSLATE("Normal mode"));
    3036    mode1->SetMessage(new BMessage(PV_NORMAL_MODE));
    31     mode2->SetLabel("Mini mode");
     37    mode2->SetLabel(B_TRANSLATE("Mini mode"));
    3238    mode2->SetMessage(new BMessage(PV_MINI_MODE));
    33     quit = new BMenuItem("Quit", new BMessage(PV_QUIT), 0, 0);
     39    quit = new BMenuItem(B_TRANSLATE("Quit"), new BMessage(PV_QUIT), 0, 0);
    3440    popupmenu->AddSeparatorItem();
    3541    popupmenu->AddItem(quit);
    3642
     
    118124            prefswindow->Show();
    119125            break;
    120126        case PV_ABOUT: {
    121             BAlert *alert = new BAlert("Info", "Pulse\n\nBy David Ramsey and "
    122                 "Arve Hjønnevåg\nRevised by Daniel Switkin", "OK");
     127            BAlert *alert = new BAlert(B_TRANSLATE("Info"),
     128                B_TRANSLATE("Pulse\n\nBy David Ramsey and Arve Hjønnevåg\n"
     129                "Revised by Daniel Switkin"), B_TRANSLATE("OK"));
    123130            alert->Go(NULL);
    124131            break;
    125132        }
     
    169176    status_t err = deskbar->RemoveItem("DeskbarPulseView");
    170177    if (err != B_OK) {
    171178        char temp[255];
    172         sprintf(temp, "Remove(): %s", strerror(err));
    173         BAlert *alert = new BAlert("Info", temp, "OK");
     179        sprintf(temp, B_TRANSLATE("Remove(): %s"), strerror(err));
     180        BAlert *alert = new BAlert(B_TRANSLATE("Info"), temp,
     181            B_TRANSLATE("OK"));
    174182        alert->Go(NULL);
    175183    }
    176184    delete deskbar;
  • src/apps/pulse/PulseWindow.cpp

     
    1 //****************************************************************************************
     1//*****************************************************************************
    22//
    33//  File:       PulseWindow.cpp
    44//
     
    66//
    77//  Copyright 1999, Be Incorporated
    88//
    9 //****************************************************************************************
     9//*****************************************************************************
    1010
    1111
    1212#include "PulseWindow.h"
     
    1515#include "DeskbarPulseView.h"
    1616
    1717#include <Alert.h>
     18#include <Catalog.h>
    1819#include <Deskbar.h>
     20#include <Locale.h>
    1921#include <Screen.h>
    2022
    2123#include <stdlib.h>
    2224#include <string.h>
    2325
     26#undef B_TRANSLATE_CONTEXT
     27#define B_TRANSLATE_CONTEXT "PulseWindow"
    2428
     29
    2530PulseWindow::PulseWindow(BRect rect) :
    2631    BWindow(rect, "Pulse", B_TITLED_WINDOW, B_NOT_RESIZABLE | B_NOT_ZOOMABLE)
    2732{
    2833    SetPulseRate(200000);
    2934
     35    SetTitle(B_TRANSLATE("Pulse"));
     36   
    3037    PulseApp *pulseapp = (PulseApp *)be_app;
    3138    BRect bounds = Bounds();
    3239    fNormalPulseView = new NormalPulseView(bounds);
    3340    AddChild(fNormalPulseView);
    3441
    35     fMiniPulseView = new MiniPulseView(bounds, "MiniPulseView", pulseapp->prefs);
     42    fMiniPulseView = new MiniPulseView(bounds, "MiniPulseView",
     43        pulseapp->prefs);
    3644    AddChild(fMiniPulseView);
    3745
    3846    fMode = pulseapp->prefs->window_mode;
     
    8997            // Otherwise launch a new preferences window
    9098            PulseApp *pulseapp = (PulseApp *)be_app;
    9199            fPrefsWindow = new PrefsWindow(pulseapp->prefs->prefs_window_rect,
    92                 "Pulse settings", new BMessenger(this), pulseapp->prefs);
     100                B_TRANSLATE("Pulse settings"), new BMessenger(this),
     101                pulseapp->prefs);
    93102            fPrefsWindow->Show();
    94103            break;
    95104        }
    96105        case PV_ABOUT: {
    97             BAlert *alert = new BAlert("Info", "Pulse\n\nBy David Ramsey and Arve Hjønnevåg\nRevised by Daniel Switkin", "OK");
     106            BAlert *alert = new BAlert(B_TRANSLATE("Info"),
     107                B_TRANSLATE("Pulse\n\nBy David Ramsey and Arve Hjønnevåg\n"
     108                "Revised by Daniel Switkin"), B_TRANSLATE("OK"));
    98109            // Use the asynchronous version so we don't block the window's thread
    99110            alert->Go(NULL);
    100111            break;
  • src/apps/pulse/CPUButton.cpp

     
    1 //****************************************************************************************
     1//*****************************************************************************
    22//
    33//  File:       CPUButton.cpp
    44//
     
    66//
    77//  Copyright 1999, Be Incorporated
    88//
    9 //****************************************************************************************
     9//*****************************************************************************
    1010
    11 
    1211#include "CPUButton.h"
    1312
    1413#include <stdlib.h>
    1514#include <string.h>
    1615
    1716#include <Alert.h>
     17#include <Catalog.h>
    1818#include <Dragger.h>
     19#include <Locale.h>
    1920#include <PopUpMenu.h>
    2021
    2122#include <ViewPrivate.h>
     
    2627#include "PulseView.h"
    2728#include "Common.h"
    2829
     30#undef B_TRANSLATE_CONTEXT
     31#define B_TRANSLATE_CONTEXT "CPUButton"
    2932
     33
    3034CPUButton::CPUButton(BRect rect, const char *name, const char *label, BMessage *message)
    3135    : BControl(rect, name, label, message, B_FOLLOW_NONE, B_WILL_DRAW)
    3236{
     
    195199        SetMouseEventMask(B_POINTER_EVENTS, B_LOCK_WINDOW_FOCUS);
    196200    } else if ((B_SECONDARY_MOUSE_BUTTON & mouseButtons) != 0
    197201        && fReplicantInDeskbar) {
    198         BPopUpMenu *menu = new BPopUpMenu("Deskbar menu");
    199         menu->AddItem(new BMenuItem("About Pulse" B_UTF8_ELLIPSIS,
     202        BPopUpMenu *menu = new BPopUpMenu(B_TRANSLATE("Deskbar menu"));
     203        menu->AddItem(new BMenuItem(B_TRANSLATE("About Pulse" B_UTF8_ELLIPSIS),
    200204            new BMessage(B_ABOUT_REQUESTED)));
    201205        menu->AddSeparatorItem();
    202         menu->AddItem(new BMenuItem("Remove replicant",
     206        menu->AddItem(new BMenuItem(B_TRANSLATE("Remove replicant"),
    203207            new BMessage(kDeleteReplicant)));
    204208        menu->SetTargetForItems(this);
    205209
     
    237241    if (!LastEnabledCPU(fCPU)) {
    238242        _kern_set_cpu_enabled(fCPU, Value());
    239243    } else {
    240         BAlert *alert = new BAlert(NULL, "You can't disable the last active CPU.", "OK");
     244        BAlert *alert = new BAlert(NULL, B_TRANSLATE("You can't disable the "
     245            "last active CPU."), B_TRANSLATE("OK"));
    241246        alert->Go(NULL);
    242247        SetValue(!Value());
    243248    }
     
    271276{
    272277    switch (message->what) {
    273278        case B_ABOUT_REQUESTED: {
    274             BAlert *alert = new BAlert("Info", "Pulse\n\nBy David Ramsey and Arve Hjønnevåg\nRevised by Daniel Switkin", "OK");
     279            BAlert *alert = new BAlert(B_TRANSLATE("Info"),
     280                B_TRANSLATE("Pulse\n\nBy David Ramsey and Arve Hjønnevåg\n"
     281                "Revised by Daniel Switkin"), B_TRANSLATE("OK"));
    275282            // Use the asynchronous version so we don't block the window's thread
    276283            alert->Go(NULL);
    277284            break;
     
    313320    fReplicantInDeskbar = false;
    314321
    315322    if (fReplicant) {
    316         if (strcmp(Window()->Title(), "Deskbar")) {
     323        if (strcmp(Window()->Title(), B_TRANSLATE("Deskbar")) == 0) {
    317324            // Make room for dragger
    318325            ResizeBy(4, 4);
    319326
  • src/apps/pulse/PulseView.cpp

     
    1515#include <string.h>
    1616
    1717#include <Alert.h>
     18#include <Catalog.h>
     19#include <Locale.h>
    1820
    1921#include <syscalls.h>
    2022
    2123#include "Common.h"
    2224#include "PulseApp.h"
    2325
     26#undef B_TRANSLATE_CONTEXT
     27#define B_TRANSLATE_CONTEXT "PulseView"
    2428
     29
    2530PulseView::PulseView(BRect rect, const char *name) :
    2631    BView(rect, name, B_FOLLOW_ALL_SIDES, B_WILL_DRAW | B_PULSE_NEEDED | B_FRAME_EVENTS) {
    2732
     
    5055    popupmenu->SetFont(be_plain_font);
    5156    mode1 = new BMenuItem("", NULL, 0, 0);
    5257    mode2 = new BMenuItem("", NULL, 0, 0);
    53     preferences = new BMenuItem("Settings" B_UTF8_ELLIPSIS, new BMessage(PV_PREFERENCES), 0, 0);
    54     about = new BMenuItem("About Pulse" B_UTF8_ELLIPSIS, new BMessage(PV_ABOUT), 0, 0);
     58    preferences = new BMenuItem(B_TRANSLATE("Settings" B_UTF8_ELLIPSIS),
     59        new BMessage(PV_PREFERENCES), 0, 0);
     60    about = new BMenuItem(B_TRANSLATE("About Pulse" B_UTF8_ELLIPSIS),
     61        new BMessage(PV_ABOUT), 0, 0);
    5562
    5663    popupmenu->AddItem(mode1);
    5764    popupmenu->AddItem(mode2);
     
    121128    if (!LastEnabledCPU(which)) {
    122129        _kern_set_cpu_enabled(which, (int)!cpu_menu_items[which]->IsMarked());
    123130    } else {
    124         BAlert *alert = new BAlert(NULL, "You can't disable the last active CPU.", "OK");
     131        BAlert *alert = new BAlert(NULL, B_TRANSLATE("You can't disable the "
     132            "last active CPU."), B_TRANSLATE("OK"));
    125133        alert->Go(NULL);
    126134    }
    127135}
  • src/apps/pulse/Jamfile

     
    2323    PulseView.cpp
    2424    PulseWindow.cpp
    2525
    26     : be $(TARGET_LIBSUPC++)
     26    : be locale $(TARGET_LIBSUPC++)
    2727    : Pulse.rdef
    2828;
     29
     30DoCatalogs Pulse :
     31    x-vnd.Haiku-Pulse
     32    :
     33    PulseApp.cpp
     34    PulseView.cpp
     35    ConfigView.cpp
     36    CPUButton.cpp
     37    DeskbarPulseView.cpp
     38    MiniPulseView.cpp
     39    NormalPulseView.cpp
     40    PrefsWindow.cpp
     41    PulseWindow.cpp
     42;
  • src/apps/pulse/ProgressBar.cpp

     
    1 //****************************************************************************************
     1//*****************************************************************************
    22//
    33//  File:       ProgressBar.cpp
    44//
     
    66//
    77//  Copyright 1999, Be Incorporated
    88//
    9 //****************************************************************************************
     9//*****************************************************************************
    1010
    1111
    1212#include "ProgressBar.h"
    1313#include "PulseApp.h"
    1414
    1515
    16 ProgressBar::ProgressBar(BRect r, char *name) : BView(r, name, B_FOLLOW_NONE, B_WILL_DRAW)
     16ProgressBar::ProgressBar(BRect r, char *name) : BView(r, name, B_FOLLOW_NONE,
     17    B_WILL_DRAW)
    1718{   
    1819    previous_value = current_value = 0;
    1920
     
    4344        unsigned char blue_base = blue / 3;
    4445
    4546        for (int x = 0; x < 20; x++) {
    46             segments[x].color.red = (uint8)(red_base + ((red - red_base) * ((float)x / 19.0)));
    47             segments[x].color.green = (uint8)(green_base + ((green - green_base) * ((float)x / 19.0)));
    48             segments[x].color.blue = (uint8)(blue_base + ((blue - blue_base) * ((float)x / 19.0)));
     47            segments[x].color.red = (uint8)(red_base + ((red - red_base)
     48                * ((float)x / 19.0)));
     49            segments[x].color.green = (uint8)(green_base
     50                + ((green - green_base) * ((float)x / 19.0)));
     51            segments[x].color.blue = (uint8)(blue_base + ((blue - blue_base)
     52                * ((float)x / 19.0)));
    4953            segments[x].color.alpha = 0xff;
    5054        }
    5155    } else {
     
    151155    SetHighColor(dkgray, dkgray, dkgray);
    152156    BRect frame = Bounds();
    153157    StrokeLine(BPoint(frame.left, frame.top), BPoint(frame.right, frame.top));
    154     StrokeLine(BPoint(frame.left, frame.top + 1), BPoint(frame.right, frame.top + 1));
    155     StrokeLine(BPoint(frame.left, frame.top), BPoint(frame.left, frame.bottom));
    156     StrokeLine(BPoint(frame.left + 1, frame.top), BPoint(frame.left + 1, frame.bottom));
     158    StrokeLine(BPoint(frame.left, frame.top + 1), BPoint(frame.right,
     159        frame.top + 1));
     160    StrokeLine(BPoint(frame.left, frame.top), BPoint(frame.left,
     161        frame.bottom));
     162    StrokeLine(BPoint(frame.left + 1, frame.top),
     163        BPoint(frame.left + 1, frame.bottom));
    157164
    158165    SetHighColor(ltgray, ltgray, ltgray);
    159     StrokeLine(BPoint(frame.right-1, frame.top + 2), BPoint(frame.right - 1, frame.bottom));
    160     StrokeLine(BPoint(frame.right, frame.top + 1), BPoint(frame.right, frame.bottom));
    161     StrokeLine(BPoint(frame.left+1, frame.bottom - 1), BPoint(frame.right - 1, frame.bottom - 1));
    162     StrokeLine(BPoint(frame.left, frame.bottom), BPoint(frame.right, frame.bottom));
     166    StrokeLine(BPoint(frame.right-1, frame.top + 2),
     167        BPoint(frame.right - 1, frame.bottom));
     168    StrokeLine(BPoint(frame.right, frame.top + 1),
     169        BPoint(frame.right, frame.bottom));
     170    StrokeLine(BPoint(frame.left+1, frame.bottom - 1),
     171        BPoint(frame.right - 1, frame.bottom - 1));
     172    StrokeLine(BPoint(frame.left, frame.bottom),
     173        BPoint(frame.right, frame.bottom));
    163174
    164175    Render(true);
    165176}
  • src/apps/pulse/PulseApp.cpp

     
    1919#include <getopt.h>
    2020
    2121#include <Alert.h>
     22#include <Catalog.h>
     23#include <Deskbar.h>
     24#include <Locale.h>
    2225#include <Rect.h>
    23 #include <Deskbar.h>
    2426
    2527#include <syscalls.h>
    2628
     
    2830#include "PulseWindow.h"
    2931#include "DeskbarPulseView.h"
    3032
     33#undef B_TRANSLATE_CONTEXT
     34#define B_TRANSLATE_CONTEXT "PulseApp"
    3135
     36
    3237PulseApp::PulseApp(int argc, char **argv)
    3338    : BApplication(APP_SIGNATURE)
    3439{
     
    197202void
    198203Usage()
    199204{
    200     printf("Usage: Pulse [--mini] [-w width] [--width=width]\n"
     205    printf(B_TRANSLATE("Usage: Pulse [--mini] [-w width] [--width=width]\n"
    201206           "\t[--deskbar] [--normal] [--framecolor 0xrrggbb]\n"
    202            "\t[--activecolor 0xrrggbb] [--idlecolor 0xrrggbb]\n");
     207           "\t[--activecolor 0xrrggbb] [--idlecolor 0xrrggbb]\n"));
    203208    exit(0);
    204209}
    205210
     
    229234    delete replicant;
    230235    delete deskbar;
    231236    if (err != B_OK) {
    232         BAlert *alert = new BAlert(NULL, strerror(err), "OK");
     237        BAlert *alert = new BAlert(NULL, strerror(err), B_TRANSLATE("OK"));
    233238        alert->Go(NULL);
    234239        return false;
    235240    }
     
    241246int
    242247main(int argc, char **argv)
    243248{
     249    BCatalog fAppCatalog;
     250   
     251    be_locale->GetAppCatalog(&fAppCatalog);
     252
    244253    PulseApp *pulseapp = new PulseApp(argc, argv);
    245254    pulseapp->Run();
    246255    delete pulseapp;
  • src/apps/pulse/NormalPulseView.cpp

     
    1 //****************************************************************************************
     1//*****************************************************************************
    22//
    33//  File:       NormalPulseView.cpp
    44//
     
    66//
    77//  Copyright 1999, Be Incorporated
    88//
    9 //****************************************************************************************
     9//*****************************************************************************
    1010
    1111
    1212#include "NormalPulseView.h"
    1313#include "Common.h"
    1414#include "Pictures"
    1515
     16#include <Catalog.h>
    1617#include <Bitmap.h>
    1718#include <Dragger.h>
     19#include <Locale.h>
    1820#include <Window.h>
    1921
    2022#include <stdlib.h>
     
    2325
    2426#include <cpu_type.h>
    2527
     28#undef B_TRANSLATE_CONTEXT
     29#define B_TRANSLATE_CONTEXT "NormalPulseView"
    2630
     31
    2732float
    2833max_font_size(BFont font, const char* text, float maxSize, float maxWidth)
    2934{
     
    5055    SetViewColor(color);
    5156    SetLowColor(color);
    5257
    53     mode1->SetLabel("Mini mode");
     58    mode1->SetLabel(B_TRANSLATE("Mini mode"));
    5459    mode1->SetMessage(new BMessage(PV_MINI_MODE));
    55     mode2->SetLabel("Deskbar mode");
     60    mode2->SetLabel(B_TRANSLATE("Deskbar mode"));
    5661    mode2->SetMessage(new BMessage(PV_DESKBAR_MODE));
    5762   
    5863    DetermineVendorAndProcessor();
     
    6974        BRect r(PROGRESS_MLEFT, PROGRESS_MTOP + ITEM_OFFSET * x,
    7075            PROGRESS_MLEFT + ProgressBar::PROGRESS_WIDTH,
    7176            PROGRESS_MTOP + ITEM_OFFSET * x + ProgressBar::PROGRESS_HEIGHT);
    72         fProgressBars[x] = new ProgressBar(r, "CPU progress bar");
     77        char* str2 = (char *)B_TRANSLATE("CPU progress bar");
     78        fProgressBars[x] = new ProgressBar(r, str2);
    7379        AddChild(fProgressBars[x]);
    7480
    7581        r.Set(CPUBUTTON_MLEFT, CPUBUTTON_MTOP + ITEM_OFFSET * x,
     
    7783            CPUBUTTON_MTOP + ITEM_OFFSET * x + CPUBUTTON_HEIGHT + 7);
    7884        char temp[4];
    7985        sprintf(temp, "%d", x + 1);
    80         fCpuButtons[x] = new CPUButton(r, "Pulse", temp, NULL);
     86        fCpuButtons[x] = new CPUButton(r, B_TRANSLATE("Pulse"), temp, NULL);
    8187        AddChild(fCpuButtons[x]);
    8288    }
    8389