From ad34440edce9f5d4e604a9a2b0a3116e1dd74fde Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Tue, 27 Oct 2009 15:48:01 +0000 Subject: [PATCH] -Removed unseless reference to adler32 in hashmapcatalog -Localized Keymap preflet and translated it to french git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33790 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- data/catalogs/preferences/keymap/fr.catkeys | 22 +++++++++ src/kits/locale/HashMapCatalog.cpp | 4 -- src/preferences/keymap/Jamfile | 9 +++- src/preferences/keymap/KeymapApplication.cpp | 1 + src/preferences/keymap/KeymapApplication.h | 3 ++ src/preferences/keymap/KeymapWindow.cpp | 47 +++++++++++--------- 6 files changed, 60 insertions(+), 26 deletions(-) create mode 100644 data/catalogs/preferences/keymap/fr.catkeys diff --git a/data/catalogs/preferences/keymap/fr.catkeys b/data/catalogs/preferences/keymap/fr.catkeys new file mode 100644 index 0000000000..ae708ab34f --- /dev/null +++ b/data/catalogs/preferences/keymap/fr.catkeys @@ -0,0 +1,22 @@ +1 english x-vnd-Haiku-Keymap 3527348353 +Select Dead Keys Keymap window Touches mortes +Tilde Trigger Keymap window Tilde +Grave Trigger Keymap window Accent grave +Quit Keymap window Quitter +Circumflex Trigger Keymap window Accent circonflexe +Open… Keymap window Ouvrir… +System: Keymap window Système: +Diaeresis Trigger Keymap window Trema +User: Keymap window Utilisateur: +Sample and Clipboard: Keymap window Exemple et presse-papier: +Keymap Keymap window Keymap +Switch Shortcut Keys Keymap window Touches raccourci +Switch Shortcut Keys To Windows/Linux Mode Keymap window Touches raccourci en mode Linux/Windows +Layout Keymap window Disposition +Revert Keymap window Défaire +Save As… Keymap window Enregistrer sous… +Switch Shortcut Keys To Haiku Mode Keymap window Touches raccourci en mode Haiku +File Keymap window Fichier +(Current) Keymap window (Actif) +Font Keymap window Police +Acute Trigger Keymap window Accent aigu diff --git a/src/kits/locale/HashMapCatalog.cpp b/src/kits/locale/HashMapCatalog.cpp index 63a8ce30d6..cd3bcfc6e1 100644 --- a/src/kits/locale/HashMapCatalog.cpp +++ b/src/kits/locale/HashMapCatalog.cpp @@ -22,10 +22,6 @@ */ -extern "C" uint32 adler32(uint32 adler, const uint8 *buf, uint32 len); - // definition lives in adler32.c - - CatKey::CatKey(const char *str, const char *ctx, const char *cmt) : fString(str), diff --git a/src/preferences/keymap/Jamfile b/src/preferences/keymap/Jamfile index 2121210e82..98cb653fbd 100644 --- a/src/preferences/keymap/Jamfile +++ b/src/preferences/keymap/Jamfile @@ -12,6 +12,13 @@ Preference Keymap : KeymapListItem.cpp KeymapWindow.cpp - : be tracker $(TARGET_LIBSTDC++) + : be tracker liblocale.so $(TARGET_LIBSTDC++) : Keymap.rdef ; + +DoCatalogs Keymap : + x-vnd.Haiku-Keymap + : KeymapWindow.cpp + : en.catalog + : fr.catkeys + ; diff --git a/src/preferences/keymap/KeymapApplication.cpp b/src/preferences/keymap/KeymapApplication.cpp index 502fb0c517..1ad46b9b2c 100644 --- a/src/preferences/keymap/KeymapApplication.cpp +++ b/src/preferences/keymap/KeymapApplication.cpp @@ -13,6 +13,7 @@ KeymapApplication::KeymapApplication() : BApplication("application/x-vnd.Haiku-Keymap") { + be_locale->GetAppCatalog(&fCatalog); // create the window fWindow = new KeymapWindow(); fWindow->Show(); diff --git a/src/preferences/keymap/KeymapApplication.h b/src/preferences/keymap/KeymapApplication.h index ae7cc43c9d..e410be19ce 100644 --- a/src/preferences/keymap/KeymapApplication.h +++ b/src/preferences/keymap/KeymapApplication.h @@ -14,7 +14,9 @@ #include "KeymapWindow.h" #include +#include #include +#include class KeymapApplication : public BApplication { @@ -26,6 +28,7 @@ class KeymapApplication : public BApplication { private: KeymapWindow* fWindow; + BCatalog fCatalog; }; #endif // KEYMAP_APPLICATION_H diff --git a/src/preferences/keymap/KeymapWindow.cpp b/src/preferences/keymap/KeymapWindow.cpp index c75bae1e76..077adf53cc 100644 --- a/src/preferences/keymap/KeymapWindow.cpp +++ b/src/preferences/keymap/KeymapWindow.cpp @@ -17,11 +17,13 @@ #include #include +#include #include #include #include #include #include +#include #include #include #include @@ -37,6 +39,9 @@ #include "KeymapListItem.h" +#define TR_CONTEXT "Keymap window" + + static const uint32 kMsgMenuFileOpen = 'mMFO'; static const uint32 kMsgMenuFileSaveAs = 'mMFA'; @@ -65,7 +70,7 @@ static const char* kCurrentKeymapName = "(Current)"; KeymapWindow::KeymapWindow() : - BWindow(BRect(80, 50, 880, 380), "Keymap", B_TITLED_WINDOW, + BWindow(BRect(80, 50, 880, 380), TR("Keymap"), B_TITLED_WINDOW, B_ASYNCHRONOUS_CONTROLS | B_AUTO_UPDATE_SIZE_LIMITS) { SetLayout(new BGroupLayout(B_VERTICAL)); @@ -73,12 +78,12 @@ KeymapWindow::KeymapWindow() fKeyboardLayoutView = new KeyboardLayoutView("layout"); fKeyboardLayoutView->SetKeymap(&fCurrentMap); - fTextControl = new BTextControl("Sample and Clipboard:", "", NULL); + fTextControl = new BTextControl(TR("Sample and Clipboard:"), "", NULL); fSwitchShortcutsButton = new BButton("switch", "", new BMessage(kMsgSwitchShortcuts)); - fRevertButton = new BButton("revertButton", "Revert", + fRevertButton = new BButton("revertButton", TR("Revert"), new BMessage(kMsgRevertKeymap)); // controls pane @@ -373,19 +378,19 @@ KeymapWindow::_CreateMenu() BMenuItem* item; // Create the File menu - BMenu* menu = new BMenu("File"); - menu->AddItem(new BMenuItem("Open" B_UTF8_ELLIPSIS, + BMenu* menu = new BMenu(TR("File")); + menu->AddItem(new BMenuItem(TR("Open" B_UTF8_ELLIPSIS), new BMessage(kMsgMenuFileOpen), 'O')); menu->AddSeparatorItem(); - menu->AddItem(new BMenuItem("Save As" B_UTF8_ELLIPSIS, + menu->AddItem(new BMenuItem(TR("Save As" B_UTF8_ELLIPSIS), new BMessage(kMsgMenuFileSaveAs))); menu->AddSeparatorItem(); - menu->AddItem(new BMenuItem("Quit", + menu->AddItem(new BMenuItem(TR("Quit"), new BMessage(B_QUIT_REQUESTED), 'Q')); menuBar->AddItem(menu); // Create keyboard layout menu - fLayoutMenu = new BMenu("Layout"); + fLayoutMenu = new BMenu(TR("Layout")); fLayoutMenu->SetRadioMode(true); fLayoutMenu->AddItem(item = new BMenuItem( fKeyboardLayoutView->GetKeyboardLayout()->Name(), @@ -396,7 +401,7 @@ KeymapWindow::_CreateMenu() menuBar->AddItem(fLayoutMenu); // Create the Font menu - fFontMenu = new BMenu("Font"); + fFontMenu = new BMenu(TR("Font")); fFontMenu->SetRadioMode(true); int32 numFamilies = count_font_families(); font_family family, currentFamily; @@ -424,9 +429,9 @@ KeymapWindow::_CreateMenu() BMenuField* KeymapWindow::_CreateDeadKeyMenuField() { - BPopUpMenu* deadKeyMenu = new BPopUpMenu("Select Dead Keys", false, false); + BPopUpMenu* deadKeyMenu = new BPopUpMenu(TR("Select Dead Keys"), false, false); - fAcuteMenu = new BMenu("Acute Trigger"); + fAcuteMenu = new BMenu(TR("Acute Trigger")); fAcuteMenu->SetRadioMode(true); fAcuteMenu->AddItem(new BMenuItem("\xC2\xB4", new BMessage(kMsgDeadKeyAcuteChanged))); @@ -436,7 +441,7 @@ KeymapWindow::_CreateDeadKeyMenuField() new BMessage(kMsgDeadKeyAcuteChanged))); deadKeyMenu->AddItem(fAcuteMenu); - fCircumflexMenu = new BMenu("Circumflex Trigger"); + fCircumflexMenu = new BMenu(TR("Circumflex Trigger")); fCircumflexMenu->SetRadioMode(true); fCircumflexMenu->AddItem(new BMenuItem("^", new BMessage(kMsgDeadKeyCircumflexChanged))); @@ -444,7 +449,7 @@ KeymapWindow::_CreateDeadKeyMenuField() new BMessage(kMsgDeadKeyCircumflexChanged))); deadKeyMenu->AddItem(fCircumflexMenu); - fDiaeresisMenu = new BMenu("Diaeresis Trigger"); + fDiaeresisMenu = new BMenu(TR("Diaeresis Trigger")); fDiaeresisMenu->SetRadioMode(true); fDiaeresisMenu->AddItem(new BMenuItem("\xC2\xA8", new BMessage(kMsgDeadKeyDiaeresisChanged))); @@ -454,7 +459,7 @@ KeymapWindow::_CreateDeadKeyMenuField() new BMessage(kMsgDeadKeyDiaeresisChanged))); deadKeyMenu->AddItem(fDiaeresisMenu); - fGraveMenu = new BMenu("Grave Trigger"); + fGraveMenu = new BMenu(TR("Grave Trigger")); fGraveMenu->SetRadioMode(true); fGraveMenu->AddItem(new BMenuItem("`", new BMessage(kMsgDeadKeyGraveChanged))); @@ -462,7 +467,7 @@ KeymapWindow::_CreateDeadKeyMenuField() new BMessage(kMsgDeadKeyGraveChanged))); deadKeyMenu->AddItem(fGraveMenu); - fTildeMenu = new BMenu("Tilde Trigger"); + fTildeMenu = new BMenu(TR("Tilde Trigger")); fTildeMenu->SetRadioMode(true); fTildeMenu->AddItem(new BMenuItem("~", new BMessage(kMsgDeadKeyTildeChanged))); @@ -499,9 +504,9 @@ KeymapWindow::_CreateMapLists() _SetListViewSize(fUserListView); return BGroupLayoutBuilder(B_VERTICAL) - .Add(new BStringView("system", "System:")) + .Add(new BStringView("system", TR("System:"))) .Add(systemScroller, 3) - .Add(new BStringView("user", "User:")) + .Add(new BStringView("user", TR("User:"))) .Add(userScroller); } @@ -583,13 +588,13 @@ KeymapWindow::_SetKeyboardLayout(const char* path) void KeymapWindow::_UpdateSwitchShortcutButton() { - const char* label = "Switch Shortcut Keys"; + const char* label = TR("Switch Shortcut Keys"); if (fCurrentMap.KeyForModifier(B_LEFT_COMMAND_KEY) == 0x5d && fCurrentMap.KeyForModifier(B_LEFT_CONTROL_KEY) == 0x5c) { - label = "Switch Shortcut Keys To Windows/Linux Mode"; + label = TR("Switch Shortcut Keys To Windows/Linux Mode"); } else if (fCurrentMap.KeyForModifier(B_LEFT_COMMAND_KEY) == 0x5c && fCurrentMap.KeyForModifier(B_LEFT_CONTROL_KEY) == 0x5d) { - label = "Switch Shortcut Keys To Haiku Mode"; + label = TR("Switch Shortcut Keys To Haiku Mode"); } fSwitchShortcutsButton->SetLabel(label); @@ -756,7 +761,7 @@ KeymapWindow::_FillUserMaps() entry_ref ref; _GetCurrentKeymap(ref); - fUserListView->AddItem(new KeymapListItem(ref, "(Current)")); + fUserListView->AddItem(new KeymapListItem(ref, TR("(Current)"))); fCurrentMapName = _GetActiveKeymapName();