Ticket #5292: midiplayer.diff

File midiplayer.diff, 8.4 KB (added by dancxjo, 15 years ago)
  • src/apps/midiplayer/MidiPlayerApp.cpp

     
    2121 */
    2222
    2323#include <Alert.h>
     24#include <Catalog.h>
     25#include <Locale.h>
    2426#include <StorageKit.h>
    2527
    2628#include "MidiPlayerApp.h"
    2729#include "MidiPlayerWindow.h"
    2830
     31#undef TR_CONTEXT
     32#define TR_CONTEXT "Main Application"
    2933
    3034MidiPlayerApp::MidiPlayerApp()
    3135    : BApplication(MIDI_PLAYER_SIGNATURE)
    3236{
     37    be_locale->GetAppCatalog(&fCatalog);
    3338    window = new MidiPlayerWindow;
    3439}
    3540
     
    4651{
    4752    (new BAlert(
    4853        NULL,
    49         "Haiku MIDI Player 1.0.0 beta\n\n"
     54        TR_CMT("Haiku MIDI Player 1.0.0 beta\n\n"
    5055        "This tiny program\n"
    5156        "Knows how to play thousands of\n"
    52         "Cheesy sounding songs",
     57        "Cheesy sounding songs", "This is a haiku. First line has five syllables, second has seven and last has five again. Create your own."),
    5358        "Okay", NULL, NULL,
    5459        B_WIDTH_AS_USUAL, B_INFO_ALERT))->Go();
    5560}
  • src/apps/midiplayer/ScopeView.cpp

     
    2020 * DEALINGS IN THE SOFTWARE.
    2121 */
    2222
     23#include <Catalog.h>
     24#include <Locale.h>
    2325#include <Synth.h>
    2426#include <Window.h>
    2527
    2628#include "ScopeView.h"
    2729
     30#undef TR_CONTEXT
     31#define TR_CONTEXT "Scope View"
     32
     33
    2834//------------------------------------------------------------------------------
    2935
    3036ScopeView::ScopeView()
     
    180186
    181187void ScopeView::DrawNoFile()
    182188{
    183     DrawText("Drop MIDI file here");
     189    DrawText(TR("Drop MIDI file here"));
    184190}
    185191
    186192//------------------------------------------------------------------------------
  • src/apps/midiplayer/MidiPlayerApp.h

     
    3939
    4040    private:
    4141        typedef BApplication super;
    42 
     42        BCatalog fCatalog;
    4343        MidiPlayerWindow* window;
    4444};
    4545
  • src/apps/midiplayer/Jamfile

     
    77    MidiPlayerWindow.cpp
    88    ScopeView.cpp
    99    SynthBridge.cpp
    10     : be midi midi2 $(TARGET_LIBSUPC++)
     10    : be midi midi2 $(TARGET_LIBSUPC++) liblocale.so
    1111    : MidiPlayer.rdef
    1212;
    1313
     14DoCatalogs MidiPlayer :
     15    x-vnd.Haiku-MidiPlayer
     16    :
     17    MidiPlayerApp.cpp
     18    MidiPlayerWindow.cpp
     19    ScopeView.cpp
     20    : en.catalog
     21    : eo.catkeys
     22    ;
  • src/apps/midiplayer/MidiPlayerWindow.cpp

     
    2020 * DEALINGS IN THE SOFTWARE.
    2121 */
    2222
     23#include <Catalog.h>
    2324#include <GridLayoutBuilder.h>
    2425#include <GroupLayout.h>
    2526#include <GroupLayoutBuilder.h>
     27#include <Locale.h>
    2628#include <MidiProducer.h>
    2729#include <MidiRoster.h>
    2830#include <StorageKit.h>
     
    3638#define _W(a) (a->Frame().Width())
    3739#define _H(a) (a->Frame().Height())
    3840
     41#undef TR_CONTEXT
     42#define TR_CONTEXT "Main Window"
     43
    3944//------------------------------------------------------------------------------
    4045
    4146MidiPlayerWindow::MidiPlayerWindow()
    42     : BWindow(BRect(0, 0, 1, 1), "MidiPlayer", B_TITLED_WINDOW,
     47    : BWindow(BRect(0, 0, 1, 1), TR("MidiPlayer"), B_TITLED_WINDOW,
    4348              B_ASYNCHRONOUS_CONTROLS | B_NOT_RESIZABLE | B_NOT_ZOOMABLE | B_AUTO_UPDATE_SIZE_LIMITS)
    4449{
    4550    playing = false;
     
    188193    msg->what = MSG_INPUT_CHANGED;
    189194    msg->AddInt32("id", -1);
    190195
    191     inputOff = new BMenuItem("Off", msg);
     196    inputOff = new BMenuItem(TR("Off"), msg);
    192197
    193198    inputPopUp->AddItem(inputOff);
    194199
    195     inputMenu = new BMenuField("Live input:", inputPopUp, NULL);
     200    inputMenu = new BMenuField(TR("Live input:"), inputPopUp, NULL);
    196201}
    197202
    198203//------------------------------------------------------------------------------
     
    202207    BPopUpMenu* reverbPopUp = new BPopUpMenu("reverbPopUp");
    203208
    204209    reverbNone = new BMenuItem(
    205         "None", new BMessage(MSG_REVERB_NONE));
     210        TR("None"), new BMessage(MSG_REVERB_NONE));
    206211
    207212    reverbCloset = new BMenuItem(
    208         "Closet", new BMessage(MSG_REVERB_CLOSET));
     213        TR("Closet"), new BMessage(MSG_REVERB_CLOSET));
    209214
    210215    reverbGarage = new BMenuItem(
    211         "Garage", new BMessage(MSG_REVERB_GARAGE));
     216        TR("Garage"), new BMessage(MSG_REVERB_GARAGE));
    212217
    213218    reverbIgor = new BMenuItem(
    214         "Igor's lab", new BMessage(MSG_REVERB_IGOR));
     219        TR("Igor's lab"), new BMessage(MSG_REVERB_IGOR));
    215220
    216221    reverbCavern = new BMenuItem(
    217         "Cavern", new BMessage(MSG_REVERB_CAVERN));
     222        TR("Cavern"), new BMessage(MSG_REVERB_CAVERN));
    218223
    219224    reverbDungeon = new BMenuItem(
    220         "Dungeon", new BMessage(MSG_REVERB_DUNGEON));
     225        TR("Dungeon"), new BMessage(MSG_REVERB_DUNGEON));
    221226
    222227    reverbPopUp->AddItem(reverbNone);
    223228    reverbPopUp->AddItem(reverbCloset);
     
    226231    reverbPopUp->AddItem(reverbCavern);
    227232    reverbPopUp->AddItem(reverbDungeon);
    228233
    229     reverbMenu = new BMenuField("Reverb:", reverbPopUp, NULL);
     234    reverbMenu = new BMenuField(TR("Reverb:"), reverbPopUp, NULL);
    230235}
    231236
    232237//------------------------------------------------------------------------------
     
    236241    // Set up needed views
    237242    scopeView = new ScopeView;
    238243
    239     showScope = new BCheckBox("showScope", "Scope",
     244    showScope = new BCheckBox("showScope", TR("Scope"),
    240245        new BMessage(MSG_SHOW_SCOPE));
    241246    showScope->SetValue(B_CONTROL_ON);
    242247
     
    249254    volumeSlider->UseFillColor(true, &col);
    250255    volumeSlider->SetModificationMessage(new BMessage(MSG_VOLUME));
    251256
    252     playButton = new BButton("playButton", "Play", new BMessage(MSG_PLAY_STOP));
     257    playButton = new BButton("playButton", TR("Play"), new BMessage(MSG_PLAY_STOP));
    253258    playButton->SetEnabled(false);
    254259
    255260    BBox* divider = new BBox(B_EMPTY_STRING, B_WILL_DRAW | B_FRAME_EVENTS,
     
    257262    divider->SetExplicitMaxSize(
    258263        BSize(B_SIZE_UNLIMITED, 1));
    259264
    260     BStringView* volumeLabel = new BStringView(NULL, "Volume:");
     265    BStringView* volumeLabel = new BStringView(NULL, TR("Volume:"));
    261266    volumeLabel->SetAlignment(B_ALIGN_LEFT);
    262267    volumeLabel->SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, B_SIZE_UNSET));
    263268
     
    381386        synth.SetVolume(volume / 100.0f);
    382387
    383388        playButton->SetEnabled(true);
    384         playButton->SetLabel("Stop");
     389        playButton->SetLabel(TR("Stop"));
    385390        scopeView->SetHaveFile(true);
    386391        scopeView->SetPlaying(true);
    387392        scopeView->Invalidate();
     
    391396    else
    392397    {
    393398        playButton->SetEnabled(false);
    394         playButton->SetLabel("Play");
     399        playButton->SetLabel(TR("Play"));
    395400        scopeView->SetHaveFile(false);
    396401        scopeView->SetPlaying(false);
    397402        scopeView->Invalidate();
    398403
    399404        (new BAlert(
    400             NULL, "Could not load song", "OK", NULL, NULL,
     405            NULL, TR("Could not load song"), TR("OK"), NULL, NULL,
    401406            B_WIDTH_AS_USUAL, B_STOP_ALERT))->Go();
    402407    }
    403408}
     
    441446    scopeView->SetPlaying(false);
    442447    scopeView->Invalidate();
    443448    playButton->SetEnabled(true);
    444     playButton->SetLabel("Play");
     449    playButton->SetLabel(TR("Play"));
    445450   
    446451    Unlock();
    447452}
     
    461466    }
    462467    else
    463468    {
    464         playButton->SetLabel("Stop");
     469        playButton->SetLabel(TR("Stop"));
    465470        scopeView->SetPlaying(true);
    466471        scopeView->Invalidate();
    467472
  • data/catalogs/apps/midiplayer/eo.catkeys

     
     11   esperanto   x-vnd.Haiku-MidiPlayer  1406887279
     2None    Main Window     Neniu
     3Live input: Main Window     Viva enigo:
     4Haiku MIDI Player 1.0.0 beta\n\nThis tiny program\nKnows how to play thousands of\nCheesy sounding songs    Main Application    This is a haiku. First line has five syllables, second has seven and last has five again. Create your own.  Haiku MIDI-a Legilo 1.0.0 beta\n\nLa programet' ĉi\nEblas legi milojn da\nRidindaj kantoj
     5Stop    Main Window     Halti
     6Cavern  Main Window     Kavo
     7Volume: Main Window     Laŭteco:
     8Reverb: Main Window     Eĥo:
     9OK  Main Window     Daŭrigi
     10MidiPlayer  Main Window     MIDI-a Legilo
     11Off Main Window     Malŝaltita
     12Dungeon Main Window     Karcero
     13Play    Main Window     Legi
     14Garage  Main Window     Aŭtejo
     15Closet  Main Window     Ĉambreto
     16Drop MIDI file here Scope View      Faligu MIDI-an dosieron ĉi tie
     17Igor's lab  Main Window     La laboratorio de Igoro
     18Scope   Main Window     Skopo
     19Could not load song Main Window     La kanto ne eblis ŝarĝiĝi.