Patch by stargater : localize pairs. Thanks !

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35630 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Adrien Destugues 2010-02-27 13:13:18 +00:00
parent e8e5e0caa0
commit 84df7867f8
10 changed files with 43 additions and 20 deletions

View File

@ -8,6 +8,13 @@ Application Pairs :
PairsView.cpp PairsView.cpp
PairsTopButton.cpp PairsTopButton.cpp
: be $(TARGET_LIBSTDC++) : be liblocale.so $(TARGET_LIBSTDC++)
: Pairs.rdef : Pairs.rdef
; ;
DoCatalogs Pairs :
x-vnd.Haiku-Pairs
:
PairsWindow.cpp
: en.catalog
;

View File

@ -1,11 +1,13 @@
/* /*
* Copyright 2008, Ralf Schülke, teammaui@web.de. All rights reserved. * Copyright 2008 Ralf Schülke, ralf.schuelke@googlemail.com. All rights reserved.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
*/ */
#include <stdlib.h> #include <stdlib.h>
#include <Application.h> #include <Application.h>
#include <Catalog.h>
#include <Locale.h>
#include "Pairs.h" #include "Pairs.h"
#include "PairsWindow.h" #include "PairsWindow.h"
@ -17,6 +19,7 @@ Pairs::Pairs()
: BApplication(kSignature), : BApplication(kSignature),
fWindow(NULL) fWindow(NULL)
{ {
be_locale->GetAppCatalog(&fCatalog);
} }

View File

@ -1,11 +1,13 @@
/* /*
* Copyright 2008, Ralf Schülke, teammaui@web.de. All rights reserved. * Copyright 2008 Ralf Schülke, ralf.schuelke@googlemail.com. All rights reserved.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
*/ */
#ifndef PAIRS_H #ifndef PAIRS_H
#define PAIRS_H #define PAIRS_H
#include <Application.h> #include <Application.h>
#include <Catalog.h>
extern const char* kSignature; extern const char* kSignature;
@ -17,12 +19,14 @@ public:
Pairs(); Pairs();
virtual ~Pairs(); virtual ~Pairs();
virtual void ReadyToRun(); virtual void ReadyToRun();
virtual void RefsReceived(BMessage* message); virtual void RefsReceived(BMessage* message);
virtual void MessageReceived(BMessage* message); virtual void MessageReceived(BMessage* message);
private: private:
PairsWindow* fWindow; PairsWindow* fWindow;
BCatalog fCatalog;
}; };
#endif // PAIRS_H #endif // PAIRS_H

View File

@ -1,7 +1,8 @@
/* /*
* Copyright 2008, Ralf Schülke, teammaui@web.de. All rights reserved. * Copyright 2008 Ralf Schülke, ralf.schuelke@googlemail.com. All rights reserved.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
*/ */
#ifndef PAIRS_GLOBAL_H #ifndef PAIRS_GLOBAL_H
#define PAIRS_GLOBAL_H #define PAIRS_GLOBAL_H

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2008, Ralf Schülke, teammaui@web.de. All rights reserved. * Copyright 2008 Ralf Schülke, ralf.schuelke@googlemail.com. All rights reserved.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
*/ */

View File

@ -1,7 +1,8 @@
/* /*
* Copyright 2008, Ralf Schülke, teammaui@web.de. All rights reserved. * Copyright 2008 Ralf Schülke, ralf.schuelke@googlemail.com. All rights reserved.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
*/ */
#ifndef PAIRS_TOP_BUTTON_H #ifndef PAIRS_TOP_BUTTON_H
#define PAIRS_TOP_BUTTON_H #define PAIRS_TOP_BUTTON_H

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2008, Ralf Schülke, teammaui@web.de. All rights reserved. * Copyright 2008 Ralf Schülke, ralf.schuelke@googlemail.com. All rights reserved.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
*/ */

View File

@ -1,7 +1,8 @@
/* /*
* Copyright 2008, Ralf Schülke, teammaui@web.de. All rights reserved. * Copyright 2008 Ralf Schülke, ralf.schuelke@googlemail.com. All rights reserved.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
*/ */
#ifndef PAIRS_VIEW_H #ifndef PAIRS_VIEW_H
#define PAIRS_VIEW_H #define PAIRS_VIEW_H

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2008, Ralf Schülke, teammaui@web.de. All rights reserved. * Copyright 2008 Ralf Schülke, ralf.schuelke@googlemail.com. All rights reserved.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
*/ */
@ -8,17 +8,22 @@
#include <stdio.h> #include <stdio.h>
#include <Application.h> #include <Application.h>
#include <MessageRunner.h>
#include <Button.h>
#include <Alert.h> #include <Alert.h>
#include <TextView.h> #include <Button.h>
#include <Catalog.h>
#include <Locale.h>
#include <MessageRunner.h>
#include <String.h> #include <String.h>
#include <TextView.h>
#include "Pairs.h" #include "Pairs.h"
#include "PairsGlobal.h" #include "PairsGlobal.h"
#include "PairsView.h" #include "PairsView.h"
#include "PairsTopButton.h" #include "PairsTopButton.h"
// #pragma mark - PairsWindow
#undef TR_CONTEXT
#define TR_CONTEXT "PairsWindow"
PairsWindow::PairsWindow() PairsWindow::PairsWindow()
: BWindow(BRect(100, 100, 405, 405), "Pairs", B_TITLED_WINDOW, : BWindow(BRect(100, 100, 405, 405), "Pairs", B_TITLED_WINDOW,
@ -115,8 +120,8 @@ PairsWindow::MessageReceived(BMessage* message)
<< "You completed the game in " << fButtonClicks << "You completed the game in " << fButtonClicks
<< " clicks.\n"; << " clicks.\n";
BAlert* alert = new BAlert("about", strAbout.String(), BAlert* alert = new BAlert("about", TR(strAbout.String()),
"New game", "Quit game"); TR("New game"), TR("Quit game"));
BTextView* view = alert->TextView(); BTextView* view = alert->TextView();
BFont font; BFont font;

View File

@ -1,7 +1,8 @@
/* /*
* Copyright 2007, Ralf Schülke, teammaui@web.de. All rights reserved. * Copyright 2008 Ralf Schülke, ralf.schuelke@googlemail.com. All rights reserved.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
*/ */
#ifndef PAIRS_WINDOW_H #ifndef PAIRS_WINDOW_H
#define PAIRS_WINDOW_H #define PAIRS_WINDOW_H