-Internationalization and french locale for Fonts preflet

-Added grist to the sourcecode files sent to collectcatkeys to avoid mixups


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33401 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Adrien Destugues
2009-10-01 20:05:56 +00:00
parent 7d183c0492
commit 0007a867cf
7 changed files with 76 additions and 29 deletions
+2 -1
View File
@@ -367,9 +367,10 @@ rule DoCatalogs appName # Application name
{ {
genCat = [ FGristFiles $(generatedCatalog) ] ; genCat = [ FGristFiles $(generatedCatalog) ] ;
trans = [ FGristFiles $(translatedCatalogs) ] ; trans = [ FGristFiles $(translatedCatalogs) ] ;
srcs = [ FGristFiles $(sources) ] ;
SEARCH on $(trans) += $(SEARCH_SOURCE) ; SEARCH on $(trans) += $(SEARCH_SOURCE) ;
ExtractCatalogEntries $(genCat:S=.catkeys) : $(sources) : $(signature) ; ExtractCatalogEntries $(genCat:S=.catkeys) : $(srcs) : $(signature) ;
LinkApplicationCatalog $(genCat) : $(genCat:S=.catkeys) LinkApplicationCatalog $(genCat) : $(genCat:S=.catkeys)
: $(signature) : $(genCat:B) ; : $(signature) : $(genCat:B) ;
+7 -2
View File
@@ -14,6 +14,8 @@
#include "MainWindow.h" #include "MainWindow.h"
#include <Box.h> #include <Box.h>
#include <Catalog.h>
#include <Locale.h>
#include <MenuField.h> #include <MenuField.h>
#include <MenuItem.h> #include <MenuItem.h>
#include <PopUpMenu.h> #include <PopUpMenu.h>
@@ -24,6 +26,9 @@
#include <stdio.h> #include <stdio.h>
#undef TR_CONTEXT
#define TR_CONTEXT "Font Selection view"
#define INSTANT_UPDATE #define INSTANT_UPDATE
// if defined, the system font will be updated immediately, and not // if defined, the system font will be updated immediately, and not
@@ -98,12 +103,12 @@ FontSelectionView::FontSelectionView(const char* name,
fFontsMenuField->SetAlignment(B_ALIGN_RIGHT); fFontsMenuField->SetAlignment(B_ALIGN_RIGHT);
// size menu // size menu
fSizesMenuField = new BMenuField("size", "Size:", fSizesMenu, NULL); fSizesMenuField = new BMenuField("size", TR("Size:"), fSizesMenu, NULL);
fSizesMenuField->SetAlignment(B_ALIGN_RIGHT); fSizesMenuField->SetAlignment(B_ALIGN_RIGHT);
// preview // preview
fPreviewText = new BStringView("preview text", fPreviewText = new BStringView("preview text",
"The quick brown fox jumps over the lazy dog."); TR_CMT("The quick brown fox jumps over the lazy dog.","Don't translate this literally ! Use a phrase showing all chars from A to Z."));
fPreviewText->SetFont(&fCurrentFont); fPreviewText->SetFont(&fCurrentFont);
fPreviewText->SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, B_SIZE_UNSET)); fPreviewText->SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, B_SIZE_UNSET));
+8 -4
View File
@@ -14,10 +14,14 @@
#include <string.h> #include <string.h>
#include <Catalog.h>
#include <GridLayoutBuilder.h> #include <GridLayoutBuilder.h>
#include <GroupLayoutBuilder.h> #include <GroupLayoutBuilder.h>
#include <Locale.h>
#include <SpaceLayoutItem.h> #include <SpaceLayoutItem.h>
#undef TR_CONTEXT
#define TR_CONTEXT "Font view"
static void static void
add_font_selection_view(BGridLayout* layout, FontSelectionView* view, add_font_selection_view(BGridLayout* layout, FontSelectionView* view,
@@ -50,10 +54,10 @@ FontView::FontView()
{ {
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
fPlainView = new FontSelectionView("plain", "Plain Font:"); fPlainView = new FontSelectionView("plain", TR("Plain Font:"));
fBoldView = new FontSelectionView("bold", "Bold Font:"); fBoldView = new FontSelectionView("bold", TR("Bold Font:"));
fFixedView = new FontSelectionView("fixed", "Fixed Font:"); fFixedView = new FontSelectionView("fixed", TR("Fixed Font:"));
fMenuView = new FontSelectionView("menu", "Menu Font:"); fMenuView = new FontSelectionView("menu", TR("Menu Font:"));
BGridLayout* layout = new BGridLayout(5, 5); BGridLayout* layout = new BGridLayout(5, 5);
layout->SetInsets(10, 10, 10, 10); layout->SetInsets(10, 10, 10, 10);
+13 -1
View File
@@ -9,7 +9,7 @@ Preference Fonts :
FontView.cpp FontView.cpp
main.cpp main.cpp
MainWindow.cpp MainWindow.cpp
: be $(TARGET_LIBSUPC++) : be $(TARGET_LIBSUPC++) liblocale.so
: Fonts.rdef : Fonts.rdef
; ;
@@ -17,3 +17,15 @@ if $(TARGET_PLATFORM) = libbe_test {
HaikuInstall install-test-apps : $(HAIKU_APP_TEST_DIR) : Fonts HaikuInstall install-test-apps : $(HAIKU_APP_TEST_DIR) : Fonts
: tests!apps ; : tests!apps ;
} }
DoCatalogs Fonts :
x-vnd.Haiku-Fonts
:
FontSelectionView.cpp
FontView.cpp
main.cpp
MainWindow.cpp
: en.catalog
: fr.catkeys
;
+8 -3
View File
@@ -18,8 +18,10 @@
#include <Application.h> #include <Application.h>
#include <Button.h> #include <Button.h>
#include <Box.h> #include <Box.h>
#include <Catalog.h>
#include <GridLayoutBuilder.h> #include <GridLayoutBuilder.h>
#include <GroupLayoutBuilder.h> #include <GroupLayoutBuilder.h>
#include <Locale.h>
#include <MessageRunner.h> #include <MessageRunner.h>
#include <Screen.h> #include <Screen.h>
#include <SpaceLayoutItem.h> #include <SpaceLayoutItem.h>
@@ -28,6 +30,9 @@
#include "FontView.h" #include "FontView.h"
#undef TR_CONTEXT
#define TR_CONTEXT "Main window"
static const uint32 kMsgSetDefaults = 'dflt'; static const uint32 kMsgSetDefaults = 'dflt';
static const uint32 kMsgRevert = 'rvrt'; static const uint32 kMsgRevert = 'rvrt';
@@ -35,14 +40,14 @@ static const uint32 kMsgCheckFonts = 'chkf';
MainWindow::MainWindow() MainWindow::MainWindow()
: BWindow(BRect(0, 0, 1, 1), "Fonts", B_TITLED_WINDOW, : BWindow(BRect(0, 0, 1, 1), TR("Fonts"), B_TITLED_WINDOW,
B_ASYNCHRONOUS_CONTROLS | B_NOT_ZOOMABLE | B_AUTO_UPDATE_SIZE_LIMITS) B_ASYNCHRONOUS_CONTROLS | B_NOT_ZOOMABLE | B_AUTO_UPDATE_SIZE_LIMITS)
{ {
fDefaultsButton = new BButton("defaults", "Defaults", fDefaultsButton = new BButton("defaults", TR("Defaults"),
new BMessage(kMsgSetDefaults), B_WILL_DRAW); new BMessage(kMsgSetDefaults), B_WILL_DRAW);
fDefaultsButton->SetEnabled(false); fDefaultsButton->SetEnabled(false);
fRevertButton = new BButton("revert", "Revert", fRevertButton = new BButton("revert", TR("Revert"),
new BMessage(kMsgRevert), B_WILL_DRAW); new BMessage(kMsgRevert), B_WILL_DRAW);
fRevertButton->SetEnabled(false); fRevertButton->SetEnabled(false);
+12
View File
@@ -0,0 +1,12 @@
1 french x-vnd.Haiku-Fonts 3656873675
Defaults Main window Défauts
Plain Font: Font view Police de base :
Fonts Main window Polices
Fonts\n\tCopyright 2004-2005, Haiku.\n\n main Polices\n\tCopyright 2004-2005, Haiku.\n\n
Revert Main window Défaire
Size: Font Selection view Taille :
Menu Font: Font view Police de menu :
The quick brown fox jumps over the lazy dog. Font Selection view Don't translate this literally ! Use a phrase showing all chars from A to Z. Portez ce vieux whisky au juge blond qui fume.
Bold Font: Font view Police grasse :
Fixed Font: Font view Police à espacement fixe :
Ok main Ok
+10 -2
View File
@@ -13,20 +13,28 @@
#include <Alert.h> #include <Alert.h>
#include <Application.h> #include <Application.h>
#include <Catalog.h>
#include <Locale.h>
#include <TextView.h> #include <TextView.h>
#undef TR_CONTEXT
#define TR_CONTEXT "main"
class FontsApp : public BApplication { class FontsApp : public BApplication {
public: public:
FontsApp(); FontsApp();
virtual void AboutRequested(); virtual void AboutRequested();
private:
BCatalog fCatalog;
}; };
FontsApp::FontsApp() FontsApp::FontsApp()
: BApplication("application/x-vnd.Haiku-Fonts") : BApplication("application/x-vnd.Haiku-Fonts")
{ {
be_locale->GetAppCatalog(&fCatalog);
MainWindow *window = new MainWindow(); MainWindow *window = new MainWindow();
window->Show(); window->Show();
} }
@@ -35,8 +43,8 @@ FontsApp::FontsApp()
void void
FontsApp::AboutRequested() FontsApp::AboutRequested()
{ {
BAlert *alert = new BAlert("about", "Fonts\n" BAlert *alert = new BAlert("about", TR("Fonts\n"
"\tCopyright 2004-2005, Haiku.\n\n", "Ok"); "\tCopyright 2004-2005, Haiku.\n\n"), TR("Ok"));
BTextView *view = alert->TextView(); BTextView *view = alert->TextView();
BFont font; BFont font;