Ticket #7105: cdplayer-localization-update.patch

File cdplayer-localization-update.patch, 6.7 KB (added by Karvjorm, 10 years ago)

An updated CDPlayer localization patch

  • src/apps/cdplayer/CDPlayer.cpp

     
    8787        BAlert *alert = new BAlert("CDPlayer", B_TRANSLATE(
    8888            "It appears that there are no CD"
    8989            " drives on your computer or there is no system software to "
    90             "support one. Sorry."), "OK");
     90            "support one. Sorry."), B_TRANSLATE("OK"));
    9191        alert->Go();
    9292    }
    9393
     
    151151    r.OffsetBy(0, r.Height() + 5);
    152152    r.right = r.left + (r.Width() / 2);
    153153    fTrackTime = new BStringView(r, B_TRANSLATE("TrackTime"),
    154          "Track: 88:88 / 88:88", B_FOLLOW_LEFT_RIGHT);
     154         B_TRANSLATE("Track: 88:88 / 88:88"), B_FOLLOW_LEFT_RIGHT);
    155155    fTrackTime->ResizeToPreferred();
    156     fTrackTime->SetText("Track: --:-- / --:--");
     156    fTrackTime->SetText(B_TRANSLATE("Track: --:-- / --:--"));
    157157    box->AddChild(fTrackTime);
    158158
    159159    r.OffsetTo(fTrackTime->Frame().right + 5, r.top);
    160160    fDiscTime = new BStringView(r, B_TRANSLATE("DiscTime"),
    161         "Disc: 88:88 / 88:88", B_FOLLOW_RIGHT);
     161        B_TRANSLATE("Disc: 88:88 / 88:88"), B_FOLLOW_RIGHT);
    162162    fDiscTime->ResizeToPreferred();
    163     fDiscTime->SetText("Disc: --:-- / --:--");
     163    fDiscTime->SetText(B_TRANSLATE("Disc: --:-- / --:--"));
    164164    box->AddChild(fDiscTime);
    165165
    166166    float maxWidth = max_c(fDiscTime->Frame().right, fCDTitle->Frame().right);
     
    475475            SetLabel(fCDTitle, B_TRANSLATE("CD drive is empty"));
    476476
    477477            SetLabel(fCurrentTrack, "");
    478             SetLabel(fTrackTime, "Track: --:-- / --:--");
    479             SetLabel(fDiscTime, "Disc: --:-- / --:--");
     478            SetLabel(fTrackTime, B_TRANSLATE("Track: --:-- / --:--"));
     479            SetLabel(fDiscTime, B_TRANSLATE("Disc: --:-- / --:--"));
    480480            fPlayList.SetTrackCount(0);
    481481            fPlayList.SetStartingTrack(1);
    482482            fPlayList.SetCurrentTrack(1);
     
    588588            if (whichTrack == 0)
    589589                whichTrack++;
    590590
    591             currentTrackName << "Track " << whichTrack << ": "
    592                 << fCDData.TrackAt(whichTrack - 1);
     591            currentTrackName << B_TRANSLATE("Track") << " " << whichTrack
     592                << ": " << fCDData.TrackAt(whichTrack - 1);
    593593
    594594            SetLabel(fCurrentTrack, currentTrackName.String());
    595595
     
    606606
    607607    if (fCDDrive.GetTime(trackTime, discTime)) {
    608608        fCDDrive.GetTimeForDisc(discTotal);
    609         sprintf(timeString, "Disc: %ld:%.2ld / %ld:%.2ld",
     609        sprintf(timeString, B_TRANSLATE("Disc: %ld:%.2ld / %ld:%.2ld"),
    610610            discTime.GetMinutes(), discTime.GetSeconds(),
    611611            discTotal.GetMinutes(), discTotal.GetSeconds());
    612612        SetLabel(fDiscTime, timeString);
    613613
    614614        fCDDrive.GetTimeForTrack(playlistTrack, trackTotal);
    615         sprintf(timeString, "Track: %ld:%.2ld / %ld:%.2ld",
     615        sprintf(timeString, B_TRANSLATE("Track: %ld:%.2ld / %ld:%.2ld"),
    616616            trackTime.GetMinutes(), trackTime.GetSeconds(),
    617617            trackTotal.GetMinutes(), trackTotal.GetSeconds());
    618618        SetLabel(fTrackTime, timeString);
     
    627627
    628628
    629629CDPlayerWindow::CDPlayerWindow()
    630     : BWindow(BRect (100, 100, 405, 280), "CDPlayer", B_TITLED_WINDOW,
    631         B_NOT_RESIZABLE | B_NOT_ZOOMABLE | B_ASYNCHRONOUS_CONTROLS)
     630    : BWindow(BRect (100, 100, 405, 280), B_TRANSLATE("CDPlayer"),
     631        B_TITLED_WINDOW, B_NOT_RESIZABLE | B_NOT_ZOOMABLE |
     632        B_ASYNCHRONOUS_CONTROLS)
    632633{
    633634}
    634635
     
    648649    : BApplication("application/x-vnd.Haiku-CDPlayer")
    649650{
    650651    BWindow *window = new CDPlayerWindow();
    651     CDPlayer *view = new CDPlayer(window->Bounds(), "CD");
     652    CDPlayer *view = new CDPlayer(window->Bounds(), B_TRANSLATE("CD"));
    652653    if (view->InitCheck()) {
    653654        window->ResizeTo(view->Bounds().Width(), view->Bounds().Height());
    654655        window->AddChild(view);
  • src/apps/cdplayer/CDAudioDevice.cpp

     
    1010#include "CDAudioDevice.h"
    1111#include "scsi.h"
    1212
     13#include <Catalog.h>
    1314#include <Debug.h>
    1415#include <Directory.h>
    1516#include <Entry.h>
     
    2223#include <string.h>
    2324#include <unistd.h>
    2425
     26#undef B_TRANSLATE_CONTEXT
     27#define B_TRANSLATE_CONTEXT "CDAudioDevice"
    2528
    2629struct ConvertedToc {
    2730    int32 min;
     
    178181
    179182    status_t result = ioctl(fFileHandle, B_SCSI_PLAY_TRACK, &playtrack);
    180183    if (result != B_OK) {
    181         printf("Couldn't play track: %s\n", strerror(errno));
     184        printf(B_TRANSLATE("Couldn't play track: %s\n"), strerror(errno));
    182185        return false;
    183186    }
    184187   
     
    191194{
    192195    status_t result = ioctl(fFileHandle, B_SCSI_PAUSE_AUDIO);
    193196    if (result != B_OK) {
    194         printf("Couldn't pause track: %s\n", strerror(errno));
     197        printf(B_TRANSLATE("Couldn't pause track: %s\n"), strerror(errno));
    195198        return false;
    196199    }
    197200    return true;
     
    213216
    214217    status_t result = ioctl(fFileHandle, B_SCSI_RESUME_AUDIO);
    215218    if (result != B_OK) {
    216         printf("Couldn't resume track: %s\n", strerror(errno));
     219        printf(B_TRANSLATE("Couldn't resume track: %s\n"), strerror(errno));
    217220        return false;
    218221    }
    219222    return true;
     
    225228{
    226229    status_t result = ioctl(fFileHandle, B_SCSI_STOP_AUDIO);
    227230    if (result != B_OK) {
    228         printf("Couldn't stop CD: %s\n", strerror(errno));
     231        printf(B_TRANSLATE("Couldn't stop CD: %s\n"), strerror(errno));
    229232        return false;
    230233    }
    231234    return true;
     
    246249        media_status == B_DEV_DOOR_OPEN ? B_LOAD_MEDIA : B_EJECT_DEVICE);
    247250
    248251    if (result != B_OK) {
    249         printf("Couldn't eject CD: %s\n", strerror(errno));
     252        printf(B_TRANSLATE("Couldn't eject CD: %s\n"), strerror(errno));
    250253        return false;
    251254    }
    252255    return true;
     
    261264    scan.speed = 1;
    262265    status_t result = ioctl(fFileHandle, B_SCSI_SCAN, &scan);
    263266    if (result != B_OK) {
    264         printf("Couldn't fast forward: %s\n", strerror(errno));
     267        printf(B_TRANSLATE("Couldn't fast forward: %s\n"), strerror(errno));
    265268        return false;
    266269    }
    267270    return true;
     
    276279    scan.speed = 1;
    277280    status_t result = ioctl(fFileHandle, B_SCSI_SCAN, &scan);
    278281    if (result != B_OK) {
    279         printf("Couldn't stop fast forwarding: %s\n", strerror(errno));
     282        printf(B_TRANSLATE("Couldn't stop fast forwarding: %s\n"), strerror(errno));
    280283        return false;
    281284    }
    282285    return true;
     
    291294    scan.speed = 1;
    292295    status_t result = ioctl(fFileHandle, B_SCSI_SCAN, &scan);
    293296    if (result != B_OK) {
    294         printf("Couldn't rewind: %s\n", strerror(errno));
     297        printf(B_TRANSLATE("Couldn't rewind: %s\n"), strerror(errno));
    295298        return false;
    296299    }
    297300    return true;
     
    306309    scan.speed = 1;
    307310    status_t result = ioctl(fFileHandle, B_SCSI_SCAN, &scan);
    308311    if (result != B_OK) {
    309         printf("Couldn't stop rewinding: %s\n", strerror(errno));
     312        printf(B_TRANSLATE("Couldn't stop rewinding: %s\n"), strerror(errno));
    310313        return false;
    311314    }
    312315    return true;
     
    324327
    325328    status_t result = ioctl(fFileHandle, B_SCSI_SET_VOLUME, &vol);
    326329    if (result != B_OK) {
    327         printf("Couldn't set volume: %s\n", strerror(errno));
     330        printf(B_TRANSLATE("Couldn't set volume: %s\n"), strerror(errno));
    328331        return false;
    329332    }
    330333    return true;