-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:
parent
7d183c0492
commit
0007a867cf
@ -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) ;
|
||||
|
@ -14,6 +14,8 @@
|
||||
#include "MainWindow.h"
|
||||
|
||||
#include <Box.h>
|
||||
#include <Catalog.h>
|
||||
#include <Locale.h>
|
||||
#include <MenuField.h>
|
||||
#include <MenuItem.h>
|
||||
#include <PopUpMenu.h>
|
||||
@ -24,6 +26,9 @@
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#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
|
||||
|
@ -14,10 +14,14 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <Catalog.h>
|
||||
#include <GridLayoutBuilder.h>
|
||||
#include <GroupLayoutBuilder.h>
|
||||
#include <Locale.h>
|
||||
#include <SpaceLayoutItem.h>
|
||||
|
||||
#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);
|
||||
|
@ -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
|
||||
;
|
||||
|
||||
|
@ -18,8 +18,10 @@
|
||||
#include <Application.h>
|
||||
#include <Button.h>
|
||||
#include <Box.h>
|
||||
#include <Catalog.h>
|
||||
#include <GridLayoutBuilder.h>
|
||||
#include <GroupLayoutBuilder.h>
|
||||
#include <Locale.h>
|
||||
#include <MessageRunner.h>
|
||||
#include <Screen.h>
|
||||
#include <SpaceLayoutItem.h>
|
||||
@ -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);
|
||||
|
||||
|
12
src/preferences/fonts/fr.catkeys
Normal file
12
src/preferences/fonts/fr.catkeys
Normal 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
|
@ -13,20 +13,28 @@
|
||||
|
||||
#include <Alert.h>
|
||||
#include <Application.h>
|
||||
#include <Catalog.h>
|
||||
#include <Locale.h>
|
||||
#include <TextView.h>
|
||||
|
||||
#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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user