diff --git a/build/jam/BeOSRules b/build/jam/BeOSRules index abcf6c6b79..deca5f53e9 100644 --- a/build/jam/BeOSRules +++ b/build/jam/BeOSRules @@ -367,9 +367,10 @@ rule DoCatalogs appName # Application name { genCat = [ FGristFiles $(generatedCatalog) ] ; trans = [ FGristFiles $(translatedCatalogs) ] ; + srcs = [ FGristFiles $(sources) ] ; SEARCH on $(trans) += $(SEARCH_SOURCE) ; - ExtractCatalogEntries $(genCat:S=.catkeys) : $(sources) : $(signature) ; + ExtractCatalogEntries $(genCat:S=.catkeys) : $(srcs) : $(signature) ; LinkApplicationCatalog $(genCat) : $(genCat:S=.catkeys) : $(signature) : $(genCat:B) ; diff --git a/src/preferences/fonts/FontSelectionView.cpp b/src/preferences/fonts/FontSelectionView.cpp index a287ba807e..9b1a96e418 100644 --- a/src/preferences/fonts/FontSelectionView.cpp +++ b/src/preferences/fonts/FontSelectionView.cpp @@ -14,6 +14,8 @@ #include "MainWindow.h" #include +#include +#include #include #include #include @@ -24,6 +26,9 @@ #include +#undef TR_CONTEXT +#define TR_CONTEXT "Font Selection view" + #define INSTANT_UPDATE // 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); // size menu - fSizesMenuField = new BMenuField("size", "Size:", fSizesMenu, NULL); + fSizesMenuField = new BMenuField("size", TR("Size:"), fSizesMenu, NULL); fSizesMenuField->SetAlignment(B_ALIGN_RIGHT); // preview 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->SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, B_SIZE_UNSET)); @@ -201,31 +206,31 @@ FontSelectionView::MessageReceived(BMessage *msg) BLayoutItem* -FontSelectionView::CreateSizesLabelLayoutItem() -{ - return fSizesMenuField->CreateLabelLayoutItem(); -} +FontSelectionView::CreateSizesLabelLayoutItem() +{ + return fSizesMenuField->CreateLabelLayoutItem(); +} BLayoutItem* -FontSelectionView::CreateSizesMenuBarLayoutItem() -{ - return fSizesMenuField->CreateMenuBarLayoutItem(); -} +FontSelectionView::CreateSizesMenuBarLayoutItem() +{ + return fSizesMenuField->CreateMenuBarLayoutItem(); +} BLayoutItem* -FontSelectionView::CreateFontsLabelLayoutItem() -{ - return fFontsMenuField->CreateLabelLayoutItem(); -} +FontSelectionView::CreateFontsLabelLayoutItem() +{ + return fFontsMenuField->CreateLabelLayoutItem(); +} BLayoutItem* -FontSelectionView::CreateFontsMenuBarLayoutItem() -{ - return fFontsMenuField->CreateMenuBarLayoutItem(); -} +FontSelectionView::CreateFontsMenuBarLayoutItem() +{ + return fFontsMenuField->CreateMenuBarLayoutItem(); +} void diff --git a/src/preferences/fonts/FontView.cpp b/src/preferences/fonts/FontView.cpp index f0e8d9b895..6d06046b71 100644 --- a/src/preferences/fonts/FontView.cpp +++ b/src/preferences/fonts/FontView.cpp @@ -14,10 +14,14 @@ #include +#include #include #include +#include #include +#undef TR_CONTEXT +#define TR_CONTEXT "Font view" static void add_font_selection_view(BGridLayout* layout, FontSelectionView* view, @@ -50,10 +54,10 @@ FontView::FontView() { SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); - fPlainView = new FontSelectionView("plain", "Plain Font:"); - fBoldView = new FontSelectionView("bold", "Bold Font:"); - fFixedView = new FontSelectionView("fixed", "Fixed Font:"); - fMenuView = new FontSelectionView("menu", "Menu Font:"); + fPlainView = new FontSelectionView("plain", TR("Plain Font:")); + fBoldView = new FontSelectionView("bold", TR("Bold Font:")); + fFixedView = new FontSelectionView("fixed", TR("Fixed Font:")); + fMenuView = new FontSelectionView("menu", TR("Menu Font:")); BGridLayout* layout = new BGridLayout(5, 5); layout->SetInsets(10, 10, 10, 10); diff --git a/src/preferences/fonts/Jamfile b/src/preferences/fonts/Jamfile index f179c253df..5c291be1ec 100644 --- a/src/preferences/fonts/Jamfile +++ b/src/preferences/fonts/Jamfile @@ -9,7 +9,7 @@ Preference Fonts : FontView.cpp main.cpp MainWindow.cpp - : be $(TARGET_LIBSUPC++) + : be $(TARGET_LIBSUPC++) liblocale.so : Fonts.rdef ; @@ -17,3 +17,15 @@ if $(TARGET_PLATFORM) = libbe_test { HaikuInstall install-test-apps : $(HAIKU_APP_TEST_DIR) : Fonts : tests!apps ; } + +DoCatalogs Fonts : + x-vnd.Haiku-Fonts + : + FontSelectionView.cpp + FontView.cpp + main.cpp + MainWindow.cpp + : en.catalog + : fr.catkeys + ; + diff --git a/src/preferences/fonts/MainWindow.cpp b/src/preferences/fonts/MainWindow.cpp index 52335a2e1e..4aa1e3c81d 100644 --- a/src/preferences/fonts/MainWindow.cpp +++ b/src/preferences/fonts/MainWindow.cpp @@ -18,8 +18,10 @@ #include #include #include +#include #include #include +#include #include #include #include @@ -28,6 +30,9 @@ #include "FontView.h" +#undef TR_CONTEXT +#define TR_CONTEXT "Main window" + static const uint32 kMsgSetDefaults = 'dflt'; static const uint32 kMsgRevert = 'rvrt'; @@ -35,14 +40,14 @@ static const uint32 kMsgCheckFonts = 'chkf'; 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) { - fDefaultsButton = new BButton("defaults", "Defaults", + fDefaultsButton = new BButton("defaults", TR("Defaults"), new BMessage(kMsgSetDefaults), B_WILL_DRAW); fDefaultsButton->SetEnabled(false); - fRevertButton = new BButton("revert", "Revert", + fRevertButton = new BButton("revert", TR("Revert"), new BMessage(kMsgRevert), B_WILL_DRAW); fRevertButton->SetEnabled(false); diff --git a/src/preferences/fonts/fr.catkeys b/src/preferences/fonts/fr.catkeys new file mode 100644 index 0000000000..864550a37c --- /dev/null +++ b/src/preferences/fonts/fr.catkeys @@ -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 diff --git a/src/preferences/fonts/main.cpp b/src/preferences/fonts/main.cpp index 5852f58885..0f4b5ab06c 100644 --- a/src/preferences/fonts/main.cpp +++ b/src/preferences/fonts/main.cpp @@ -13,20 +13,28 @@ #include #include +#include +#include #include +#undef TR_CONTEXT +#define TR_CONTEXT "main" class FontsApp : public BApplication { public: FontsApp(); virtual void AboutRequested(); + + private: + BCatalog fCatalog; }; FontsApp::FontsApp() : BApplication("application/x-vnd.Haiku-Fonts") { + be_locale->GetAppCatalog(&fCatalog); MainWindow *window = new MainWindow(); window->Show(); } @@ -35,8 +43,8 @@ FontsApp::FontsApp() void FontsApp::AboutRequested() { - BAlert *alert = new BAlert("about", "Fonts\n" - "\tCopyright 2004-2005, Haiku.\n\n", "Ok"); + BAlert *alert = new BAlert("about", TR("Fonts\n" + "\tCopyright 2004-2005, Haiku.\n\n"), TR("Ok")); BTextView *view = alert->TextView(); BFont font;