From 3ada3b1f0d6d2debaaab48eecf828a406e964c8e Mon Sep 17 00:00:00 2001 From: simonb Date: Wed, 21 Jun 2006 14:41:16 +0000 Subject: fix nls... notably classify text on conversion whether its for X or console, plus handle catalogs better. --- ChangeLog | 16 ++++--- nls/C/Translation.m | 11 +++-- src/ClockTool.cc | 10 ++-- src/Ewmh.cc | 2 +- src/FbTk/Color.cc | 2 +- src/FbTk/I18n.cc | 46 +++++++++++++++--- src/FbTk/I18n.hh | 36 ++++++++++---- src/FbTk/ImageControl.cc | 2 +- src/FbTk/Resource.cc | 4 +- src/FbTk/TextureRender.cc | 20 ++++---- src/FbTk/Theme.cc | 2 +- src/FbTk/Transparent.cc | 10 ++-- src/FbTk/XFontImp.cc | 6 +-- src/Gnome.cc | 2 +- src/IconMenu.cc | 2 +- src/IconbarTool.cc | 24 +++++----- src/Keys.cc | 10 ++-- src/LayerMenu.cc | 12 ++--- src/MenuCreator.cc | 28 +++++------ src/RegExp.cc | 2 +- src/Remember.cc | 24 +++++----- src/RootTheme.cc | 2 +- src/Screen.cc | 56 +++++++++++----------- src/Slit.cc | 54 ++++++++++----------- src/Toolbar.cc | 50 ++++++++++---------- src/Workspace.cc | 3 +- src/WorkspaceMenu.cc | 10 ++-- src/Xutil.cc | 4 +- src/fluxbox.cc | 42 ++++++++--------- src/main.cc | 116 +++++++++++++++++++++++++--------------------- 30 files changed, 336 insertions(+), 272 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9b950c2..11a99b1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,13 +1,15 @@ (Format: Year/Month/Day) Changes for 1.0rc2: *06/06/21: - * Fix nls file location. nls wouldn't have worked, why did no-one say? - (Simon) - - Need a couple more fixes too: - * Messages output on stdout/err need to be in local encoding - * Check for existence of catalog file, if not exist, try opening an - iconv for UTF-8, and loading that one instead. - FbTk/I18n.cc + * Fix nls (Simon + - file location waas wrong. nls wouldn't have worked, why did no-one say? + - Messages output on stdout/err now properly in local encoding + - Check for existence of catalog file, if it doesn't exist, and we can + convert from UTF-8, try loading that one instead. + - bunch of files changed due to macro name change: + + Use _FB_XTEXT if the text will go out to X (for X fonts) + + Use _FB_CONSOLETEXT if the text will go to console (stdout/err) + FbTk/I18n.hh/cc (+anything with _FB_TEXT) *06/06/20: * Fix window placement when apps remembers size but not location (Simon) Window.cc diff --git a/nls/C/Translation.m b/nls/C/Translation.m index 67a8d95..54c58b1 100644 --- a/nls/C/Translation.m +++ b/nls/C/Translation.m @@ -34,11 +34,11 @@ $set 3 #Common 4 Compiled options 5 Compiler 6 Compiler version -7 init -8 keys -9 nls -10 menu -11 style +7 init +8 keys +9 nls +10 menu +11 style 12 Defaults 13 disabled 14 Error @@ -46,6 +46,7 @@ $set 3 #Common 16 Maximize Over 17 SVN Revision 18 Visible +19 There is no background option specified in this style.\nPlease consult the manual or read the FAQ. $set 4 #Configmenu diff --git a/src/ClockTool.cc b/src/ClockTool.cc index efc0ffb..7385a98 100644 --- a/src/ClockTool.cc +++ b/src/ClockTool.cc @@ -58,9 +58,9 @@ public: if (m_tool.timeFormat().find("%k") != std::string::npos || m_tool.timeFormat().find("%H") != std::string::npos || m_tool.timeFormat().find("%T") != std::string::npos) - setLabel( _FBTEXT(Toolbar, Clock24, "Clock: 24h", "set Clockmode to 24h") ); + setLabel( _FB_XTEXT(Toolbar, Clock24, "Clock: 24h", "set Clockmode to 24h") ); else - setLabel( _FBTEXT(Toolbar, Clock12, "Clock: 12h", "set Clockmode to 12h") ); + setLabel( _FB_XTEXT(Toolbar, Clock12, "Clock: 12h", "set Clockmode to 12h") ); } void click(int button, int time) { @@ -107,9 +107,9 @@ public: if (m_tool.timeFormat().find("%k") != std::string::npos || m_tool.timeFormat().find("%H") != std::string::npos || m_tool.timeFormat().find("%T") != std::string::npos) - setLabel( _FBTEXT(Toolbar, Clock24, "Clock: 24h", "set Clockmode to 24h") ); + setLabel( _FB_XTEXT(Toolbar, Clock24, "Clock: 24h", "set Clockmode to 24h") ); else - setLabel( _FBTEXT(Toolbar, Clock12, "Clock: 12h", "set Clockmode to 12h") ); + setLabel( _FB_XTEXT(Toolbar, Clock12, "Clock: 12h", "set Clockmode to 12h") ); } // else some other strange format...so we don't do anything FbTk::MenuItem::click(button, time); @@ -166,7 +166,7 @@ ClockTool::ClockTool(const FbTk::FbWindow &parent, item->setCommand(saverc); menu.insert(item); FbTk::RefCount editformat_cmd(new EditClockFormatCmd()); - menu.insert(_FBTEXT(Toolbar, ClockEditFormat, "Edit Clock Format", "edit Clock Format") , editformat_cmd); + menu.insert(_FB_XTEXT(Toolbar, ClockEditFormat, "Edit Clock Format", "edit Clock Format") , editformat_cmd); update(0); diff --git a/src/Ewmh.cc b/src/Ewmh.cc index 502c92c..d74092a 100644 --- a/src/Ewmh.cc +++ b/src/Ewmh.cc @@ -382,7 +382,7 @@ void Ewmh::updateClientList(BScreen &screen) { Window *wl = FB_new_nothrow Window[num]; if (wl == 0) { _FB_USES_NLS; - cerr<<_FBTEXT(Ewmh, OutOfMemoryClientList, + cerr<<_FB_CONSOLETEXT(Ewmh, OutOfMemoryClientList, "Fatal: Out of memory, can't allocate for EWMH client list", "")< @@ -72,7 +73,7 @@ void NLSInit(const char *catalog) { } -I18n::I18n():m_multibyte(false), m_catalog_fd((nl_catd)(-1)) { +I18n::I18n():m_multibyte(false), m_utf8_translate(false), m_catalog_fd((nl_catd)(-1)) { #ifdef HAVE_SETLOCALE //make sure we don't get 0 to m_locale string char *temp = setlocale(LC_MESSAGES, ""); @@ -122,13 +123,33 @@ I18n *I18n::instance() { void I18n::openCatalog(const char *catalog) { #if defined(NLS) && defined(HAVE_CATOPEN) - + string catalog_filename = LOCALEPATH; catalog_filename += '/'; catalog_filename += m_locale; catalog_filename += '/'; catalog_filename += catalog; + if (!FileUtil::isRegularFile(catalog_filename.c_str()) && m_locale != "C" && FbStringUtil::haveUTF8()) { + // try the UTF-8 catalog, this also picks up situations where + // the codeset somehow isn't specified + + // remove everything after @ + string::size_type index = m_locale.find('.'); + // erase all characters starting at index + if (index != string::npos) + m_locale.erase(index); + + m_locale.append(".UTF-8"); + m_utf8_translate = true; + + catalog_filename = LOCALEPATH; + catalog_filename += '/'; + catalog_filename += m_locale; + catalog_filename += '/'; + catalog_filename += catalog; + } + #ifdef MCLoadBySet m_catalog_fd = catopen(catalog_filename.c_str(), MCLoadBySet); #else // !MCLoadBySet @@ -147,16 +168,29 @@ void I18n::openCatalog(const char *catalog) { } +// Translate_FB means it'll become an FbString that goes to X for Fonts, +// No translate means it stays in the local encoding, for printing to the +// console. FbString I18n::getMessage(int set_number, int message_number, - const char *default_message) const { + const char *default_message, bool translate_fb) const { #if defined(NLS) && defined(HAVE_CATGETS) if (m_catalog_fd != (nl_catd)-1) { const char *ret = catgets(m_catalog_fd, set_number, message_number, default_message); + // can't translate, leave it in raw ascii (utf-8 compatible) if (ret == default_message || ret == NULL) - return default_message; // don't recode the default - - return FbStringUtil::LocaleStrToFb(ret); + return default_message; + + if (!m_utf8_translate && translate_fb) + // Local input, UTF-8 output + return FbStringUtil::LocaleStrToFb(ret); + else if (m_utf8_translate && !translate_fb) + // UTF-8 input, local output + return FbStringUtil::FbStrToLocale(ret); + else + // UTF-8 input, UTF-8 output OR + // local input, local output + return ret; } else #endif // NLS && HAVE_CATGETS diff --git a/src/FbTk/I18n.hh b/src/FbTk/I18n.hh index cbf241d..9a936d8 100644 --- a/src/FbTk/I18n.hh +++ b/src/FbTk/I18n.hh @@ -68,20 +68,36 @@ void catclose(nl_catd cat); FbTk::I18n &i18n = *FbTk::I18n::instance() // ignore the description, it's for helping translators -#define _FBTEXT(msgset, msgid, default_text, description) \ - i18n.getMessage(FBNLS::msgset ## Set, FBNLS::msgset ## msgid, default_text) - + +// Text for X +#define _FB_XTEXT(msgset, msgid, default_text, description) \ + i18n.getMessage(FBNLS::msgset ## Set, FBNLS::msgset ## msgid, default_text, true) + +// Text for console +#define _FB_CONSOLETEXT(msgset, msgid, default_text, description) \ + i18n.getMessage(FBNLS::msgset ## Set, FBNLS::msgset ## msgid, default_text, false) + // This ensure that FbTk nls stuff is in a kind of namespace of its own -#define _FBTKTEXT( msgset, msgid, default_text, description) \ - i18n.getMessage(FBNLS::FbTk ## msgset ## Set, FBNLS::FbTk ## msgset ## msgid, default_text) +#define _FBTK_XTEXT( msgset, msgid, default_text, description) \ + i18n.getMessage(FBNLS::FbTk ## msgset ## Set, FBNLS::FbTk ## msgset ## msgid, default_text, true) + +#define _FBTK_CONSOLETEXT( msgset, msgid, default_text, description) \ + i18n.getMessage(FBNLS::FbTk ## msgset ## Set, FBNLS::FbTk ## msgset ## msgid, default_text, false) #else // no NLS #define _FB_USES_NLS -#define _FBTEXT(msgset, msgid, default_text, description) \ + +#define _FB_XTEXT(msgset, msgid, default_text, description) \ std::string(default_text) -#define _FBTKTEXT(msgset, msgid, default_text, description) \ +#define _FB_CONSOLETEXT(msgset, msgid, default_text, description) \ + std::string(default_text) + +#define _FBTK_XTEXT(msgset, msgid, default_text, description) \ + std::string(default_text) + +#define _FBTK_CONSOLETEXT(msgset, msgid, default_text, description) \ std::string(default_text) #endif // defined NLS @@ -96,15 +112,17 @@ public: inline const nl_catd &getCatalogFd() const { return m_catalog_fd; } FbString getMessage(int set_number, int message_number, - const char *default_messsage = 0) const; + const char *default_messsage = 0, bool translate_fb = false) const; + void openCatalog(const char *catalog); private: I18n(); ~I18n(); std::string m_locale; - bool m_multibyte; + bool m_multibyte, m_utf8_translate; nl_catd m_catalog_fd; + }; void NLSInit(const char *); diff --git a/src/FbTk/ImageControl.cc b/src/FbTk/ImageControl.cc index 7fe9154..64e3db5 100644 --- a/src/FbTk/ImageControl.cc +++ b/src/FbTk/ImageControl.cc @@ -660,7 +660,7 @@ void ImageControl::createColorTable() { default: _FB_USES_NLS; - cerr<<"FbTk::ImageControl: "<<_FBTKTEXT(Error, UnsupportedVisual, "Unsupported visual", "A visual is a technical term in X")<setFromString(value.addr); else { _FB_USES_NLS; - cerr<<_FBTKTEXT(Error, FailedRead, "Failed to read", "Couldn't load a resource (following)")<<": "<name()<name()<setDefaultValue(); } } diff --git a/src/FbTk/TextureRender.cc b/src/FbTk/TextureRender.cc index 7af8f08..7626c3b 100644 --- a/src/FbTk/TextureRender.cc +++ b/src/FbTk/TextureRender.cc @@ -70,12 +70,12 @@ TextureRender::TextureRender(ImageControl &imgctrl, _FB_USES_NLS; // clamp to "normal" size if (width > texture_max_width) { - cerr<<"TextureRender: "<<_FBTKTEXT(Error, BigWidth, "Warning! Width > 3200 setting Width = 3200", "Image width seems too big, clamping")< 3200 setting Width = 3200", "Image width seems too big, clamping")< texture_max_height) { - cerr<<"TextureRender: "<<_FBTKTEXT(Error, BigHeight, "Warning! Height > 3200 setting Height = 3200", "Image height seems too big, clamping")< 3200 setting Height = 3200", "Image height seems too big, clamping")<name()<name()<setDefaultValue(); } diff --git a/src/FbTk/Transparent.cc b/src/FbTk/Transparent.cc index edbab62..81aca99 100644 --- a/src/FbTk/Transparent.cc +++ b/src/FbTk/Transparent.cc @@ -52,7 +52,7 @@ Picture createAlphaPic(Window drawable, unsigned char alpha) { PictFormatDepth | PictFormatAlphaMask, &pic_format, 0); if (format == 0) { - cerr<<"FbTk::Transparent: "<<_FBTKTEXT(Error, NoRenderFormat, "Warning: Failed to find valid format for alpha.", "transparency requires a pict format, can't get one...")< saverc_cmd(new FbCommands::SaveResources()); - menu.insert(new ToolbarModeMenuItem(_FBTEXT(Toolbar, IconbarModeNone, + menu.insert(new ToolbarModeMenuItem(_FB_XTEXT(Toolbar, IconbarModeNone, "None", "No icons are shown in the iconbar"), handler, IconbarTool::NONE, saverc_cmd)); menu.insert(new ToolbarModeMenuItem( - _FBTEXT(Toolbar, IconbarModeIcons, + _FB_XTEXT(Toolbar, IconbarModeIcons, "Icons", "Iconified windows from all workspaces are shown"), handler, IconbarTool::ICONS, saverc_cmd)); menu.insert(new ToolbarModeMenuItem( - _FBTEXT(Toolbar, IconbarModeNoIcons, + _FB_XTEXT(Toolbar, IconbarModeNoIcons, "NoIcons", "No iconified windows from all workspaces are shown"), handler, IconbarTool::NOICONS, saverc_cmd)); menu.insert(new ToolbarModeMenuItem( - _FBTEXT(Toolbar, IconbarModeWorkspaceIcons, + _FB_XTEXT(Toolbar, IconbarModeWorkspaceIcons, "WorkspaceIcons", "Iconified windows from this workspace are shown"), handler, IconbarTool::WORKSPACEICONS, saverc_cmd)); menu.insert(new ToolbarModeMenuItem( - _FBTEXT(Toolbar, IconbarModeWorkspaceNoIcons, + _FB_XTEXT(Toolbar, IconbarModeWorkspaceNoIcons, "WorkspaceNoIcons", "No iconified windows from this workspace are shown"), handler, IconbarTool::WORKSPACENOICONS, saverc_cmd)); menu.insert(new ToolbarModeMenuItem( - _FBTEXT(Toolbar, IconbarModeWorkspace, + _FB_XTEXT(Toolbar, IconbarModeWorkspace, "Workspace", "Normal and iconified windows from this workspace are shown"), handler, IconbarTool::WORKSPACE, saverc_cmd)); menu.insert(new ToolbarModeMenuItem( - _FBTEXT(Toolbar, IconbarModeAllWindows, "All Windows", "All windows are shown"), + _FB_XTEXT(Toolbar, IconbarModeAllWindows, "All Windows", "All windows are shown"), handler, IconbarTool::ALLWINDOWS, saverc_cmd)); menu.insert(new FbTk::MenuSeparator()); menu.insert(new ToolbarAlignMenuItem( - _FBTEXT(Align, Left, "Left", "Align to the left"), + _FB_XTEXT(Align, Left, "Left", "Align to the left"), handler, Container::LEFT, saverc_cmd)); menu.insert(new ToolbarAlignMenuItem( - _FBTEXT(Align, Relative, "Relative", "Align relative to the width"), + _FB_XTEXT(Align, Relative, "Relative", "Align relative to the width"), handler, Container::RELATIVE, saverc_cmd)); menu.insert(new ToolbarAlignMenuItem( - _FBTEXT(Align, Right, "Right", "Align to the right"), + _FB_XTEXT(Align, Right, "Right", "Align to the right"), handler, Container::RIGHT, saverc_cmd)); @@ -402,7 +402,7 @@ IconbarTool::IconbarTool(const FbTk::FbWindow &parent, IconbarTheme &theme, BScr save_and_reconfig->add(reconfig); save_and_reconfig->add(save); RefCount s_and_reconfig(save_and_reconfig); - m_menu.insert(new BoolMenuItem(_FBTEXT(Toolbar, ShowIcons, "Show Pictures", "chooses if little icons are shown next to title in the iconbar") , + m_menu.insert(new BoolMenuItem(_FB_XTEXT(Toolbar, ShowIcons, "Show Pictures", "chooses if little icons are shown next to title in the iconbar") , *m_rc_use_pixmap, s_and_reconfig)); m_menu.updateMenu(); // must be internal menu, otherwise toolbar main menu tries to delete it. diff --git a/src/Keys.cc b/src/Keys.cc index c6276c5..eb51f9a 100644 --- a/src/Keys.cc +++ b/src/Keys.cc @@ -226,7 +226,7 @@ bool Keys::addBinding(const std::string &linebuffer) { key = FbTk::KeyUtil::getKey(val[argc].c_str()); if (key == 0) { - cerr<<_FBTEXT(Keys, InvalidKeyMod, + cerr<<_FB_CONSOLETEXT(Keys, InvalidKeyMod, "Keys: Invalid key/modifier on line", "A bad key/modifier string was found on line (number following)")<<" "<< m_current_line<<"): "< "< "<m_command = CommandParser::instance().parseLine(str); if (*last_key->m_command == 0) { - cerr<<_FBTEXT(Keys, BadLine, "Keys: Error on line", "Error on line (number following)")<<": "< "< saverc_cmd(new FbCommands::SaveResources()); diff --git a/src/MenuCreator.cc b/src/MenuCreator.cc index 850c816..2aa73ba 100644 --- a/src/MenuCreator.cc +++ b/src/MenuCreator.cc @@ -193,13 +193,13 @@ static void translateMenuItem(Parser &parse, ParseItem &pitem) { if (submenu == 0) return; if (str_label.empty()) - menu.insert(_FBTEXT(Menu, Icons, "Icons", "Iconic windows menu title")); + menu.insert(_FB_XTEXT(Menu, Icons, "Icons", "Iconic windows menu title")); else menu.insert(str_label, submenu); } else if (str_key == "exit") { // exit FbTk::RefCount exit_cmd(CommandParser::instance().parseLine("exit")); if (str_label.empty()) - menu.insert(_FBTEXT(Menu, Exit, "Exit", "Exit Command"), exit_cmd); + menu.insert(_FB_XTEXT(Menu, Exit, "Exit", "Exit Command"), exit_cmd); else menu.insert(str_label, exit_cmd); } else if (str_key == "exec") { @@ -319,10 +319,10 @@ static void translateMenuItem(Parser &parse, ParseItem &pitem) { // special NLS default labels if (str_label.empty()) { if (str_key == "reconfig" || str_key == "reconfigure") { - menu.insert(_FBTEXT(Menu, Reconfigure, "Reload Config", "Reload all the configs"), command); + menu.insert(_FB_XTEXT(Menu, Reconfigure, "Reload Config", "Reload all the configs"), command); return; } else if (str_key == "restart") { - menu.insert(_FBTEXT(Menu, Restart, "Restart", "Restart Command"), command); + menu.insert(_FB_XTEXT(Menu, Restart, "Restart", "Restart Command"), command); return; } } @@ -490,7 +490,7 @@ bool MenuCreator::createWindowMenuItem(const std::string &type, if (type == "shade") { RefCmd shade_cmd(new WindowCmd(&FluxboxWindow::shade)); - menu.insert(label.empty()?_FBTEXT(Windowmenu, Shade, "Shade", "Shade the window"):label, shade_cmd); + menu.insert(label.empty()?_FB_XTEXT(Windowmenu, Shade, "Shade", "Shade the window"):label, shade_cmd); } else if (type == "maximize") { RefCmd maximize_cmd(new WindowCmd(&FluxboxWindow::maximizeFull)); RefCmd maximize_vert_cmd(new WindowCmd(&FluxboxWindow::maximizeVertical)); @@ -498,7 +498,7 @@ bool MenuCreator::createWindowMenuItem(const std::string &type, FbTk::MultiButtonMenuItem *maximize_item = new FbTk::MultiButtonMenuItem(3, label.empty()? - _FBTEXT(Windowmenu, Maximize, + _FB_XTEXT(Windowmenu, Maximize, "Maximize", "Maximize the window"): label); // create maximize item with: @@ -512,37 +512,37 @@ bool MenuCreator::createWindowMenuItem(const std::string &type, } else if (type == "iconify") { RefCmd iconify_cmd(new WindowCmd(&FluxboxWindow::iconify)); menu.insert(label.empty() ? - _FBTEXT(Windowmenu, Iconify, + _FB_XTEXT(Windowmenu, Iconify, "Iconify", "Iconify the window") : label, iconify_cmd); } else if (type == "close") { RefCmd close_cmd(new WindowCmd(&FluxboxWindow::close)); menu.insert(label.empty() ? - _FBTEXT(Windowmenu, Close, + _FB_XTEXT(Windowmenu, Close, "Close", "Close the window") : label, close_cmd); } else if (type == "kill" || type == "killwindow") { RefCmd kill_cmd(new WindowCmd(&FluxboxWindow::kill)); menu.insert(label.empty() ? - _FBTEXT(Windowmenu, Kill, + _FB_XTEXT(Windowmenu, Kill, "Kill", "Kill the window"): label, kill_cmd); } else if (type == "lower") { RefCmd lower_cmd(new WindowCmd(&FluxboxWindow::lower)); menu.insert( label.empty() ? - _FBTEXT(Windowmenu, Lower, + _FB_XTEXT(Windowmenu, Lower, "Lower", "Lower the window"): label, lower_cmd); } else if (type == "raise") { RefCmd raise_cmd(new WindowCmd(&FluxboxWindow::raise)); menu.insert(label.empty() ? - _FBTEXT(Windowmenu, Raise, + _FB_XTEXT(Windowmenu, Raise, "Raise", "Raise the window"): label, raise_cmd); } else if (type == "stick") { RefCmd stick_cmd(new WindowCmd(&FluxboxWindow::stick)); menu.insert(label.empty() ? - _FBTEXT(Windowmenu, Stick, + _FB_XTEXT(Windowmenu, Stick, "Stick", "Stick the window"): label, stick_cmd); } else if (type == "extramenus") { @@ -555,7 +555,7 @@ bool MenuCreator::createWindowMenuItem(const std::string &type, } } else if (type == "sendto") { - menu.insert(label.empty() ? _FBTEXT(Windowmenu, SendTo, "Send To...", "Send to menu item name"): + menu.insert(label.empty() ? _FB_XTEXT(Windowmenu, SendTo, "Send To...", "Send to menu item name"): label, new SendToMenu(*Fluxbox::instance()->findScreen(menu.screenNumber()))); } else if (type == "layer") { BScreen *screen = Fluxbox::instance()->findScreen(menu.screenNumber()); @@ -570,7 +570,7 @@ bool MenuCreator::createWindowMenuItem(const std::string &type, &context, false); submenu->disableTitle(); - menu.insert(label.empty()?_FBTEXT(Windowmenu, Layer, "Layer ...", "Layer menu"):label, submenu); + menu.insert(label.empty()?_FB_XTEXT(Windowmenu, Layer, "Layer ...", "Layer menu"):label, submenu); } else if (type == "separator") { diff --git a/src/RegExp.cc b/src/RegExp.cc index 50748c5..c716b73 100644 --- a/src/RegExp.cc +++ b/src/RegExp.cc @@ -64,7 +64,7 @@ m_regex(0) { errstr = new char[size]; regerror(ret, m_regex, errstr, size); - cerr<<_FBTEXT(Fluxbox, ErrorRegexp, "Error parsing regular expression", "Error parsing regular expression (following)")<<": "<insert(new RememberMenuItem(_FBTEXT(Remember, Workspace, "Workspace", "Remember Workspace"), + menu->insert(new RememberMenuItem(_FB_XTEXT(Remember, Workspace, "Workspace", "Remember Workspace"), Remember::REM_WORKSPACE)); - menu->insert(new RememberMenuItem(_FBTEXT(Remember, JumpToWorkspace, "Jump to workspace", "Change active workspace to remembered one on open"), + menu->insert(new RememberMenuItem(_FB_XTEXT(Remember, JumpToWorkspace, "Jump to workspace", "Change active workspace to remembered one on open"), Remember::REM_JUMPWORKSPACE)); - menu->insert(new RememberMenuItem(_FBTEXT(Remember, Head, "Head", "Remember Head"), + menu->insert(new RememberMenuItem(_FB_XTEXT(Remember, Head, "Head", "Remember Head"), Remember::REM_HEAD)); - menu->insert(new RememberMenuItem(_FBTEXT(Remember, Dimensions, "Dimensions", "Remember Dimensions - with width and height"), + menu->insert(new RememberMenuItem(_FB_XTEXT(Remember, Dimensions, "Dimensions", "Remember Dimensions - with width and height"), Remember::REM_DIMENSIONS)); - menu->insert(new RememberMenuItem(_FBTEXT(Remember, Position, "Position", "Remember position - window co-ordinates"), + menu->insert(new RememberMenuItem(_FB_XTEXT(Remember, Position, "Position", "Remember position - window co-ordinates"), Remember::REM_POSITION)); - menu->insert(new RememberMenuItem(_FBTEXT(Remember, Sticky, "Sticky", "Remember Sticky"), + menu->insert(new RememberMenuItem(_FB_XTEXT(Remember, Sticky, "Sticky", "Remember Sticky"), Remember::REM_STUCKSTATE)); - menu->insert(new RememberMenuItem(_FBTEXT(Remember, Decorations, "Decorations", "Remember window decorations"), + menu->insert(new RememberMenuItem(_FB_XTEXT(Remember, Decorations, "Decorations", "Remember window decorations"), Remember::REM_DECOSTATE)); - menu->insert(new RememberMenuItem(_FBTEXT(Remember, Shaded, "Shaded", "Remember shaded"), + menu->insert(new RememberMenuItem(_FB_XTEXT(Remember, Shaded, "Shaded", "Remember shaded"), Remember::REM_SHADEDSTATE)); - menu->insert(new RememberMenuItem(_FBTEXT(Remember, Layer, "Layer", "Remember Layer"), + menu->insert(new RememberMenuItem(_FB_XTEXT(Remember, Layer, "Layer", "Remember Layer"), Remember::REM_LAYER)); - menu->insert(new RememberMenuItem(_FBTEXT(Remember, SaveOnClose, "Save on close", "Save remembered attributes on close"), + menu->insert(new RememberMenuItem(_FB_XTEXT(Remember, SaveOnClose, "Save on close", "Save remembered attributes on close"), Remember::REM_SAVEONCLOSE)); menu->updateMenu(); @@ -463,7 +463,7 @@ int Remember::parseApp(std::ifstream &file, Application &app, std::string *first } else if (strcasecmp(str_key.c_str(), "end") == 0) { return row; } else { - cerr << _FBTEXT(Remember, Unknown, "Unknown apps key", "apps entry type not known")<<" = " << str_key << endl; + cerr << _FB_CONSOLETEXT(Remember, Unknown, "Unknown apps key", "apps entry type not known")<<" = " << str_key << endl; } if (had_error) { cerr<<"Error parsing apps entry: ("<load_rc(*this); - m_configmenu.reset(createMenu(_FBTEXT(Menu, Configuration, + m_configmenu.reset(createMenu(_FB_XTEXT(Menu, Configuration, "Configuration", "Title of configuration menu"))); setupConfigmenu(*m_configmenu.get()); m_configmenu->setInternalMenu(); @@ -1525,15 +1525,15 @@ void BScreen::initMenu() { if (m_rootmenu.get() == 0) { _FB_USES_NLS; - m_rootmenu.reset(createMenu(_FBTEXT(Menu, DefaultRootMenu, "Fluxbox default menu", "Title of fallback root menu"))); + m_rootmenu.reset(createMenu(_FB_XTEXT(Menu, DefaultRootMenu, "Fluxbox default menu", "Title of fallback root menu"))); FbTk::RefCount restart_fb(CommandParser::instance().parseLine("restart")); FbTk::RefCount exit_fb(CommandParser::instance().parseLine("exit")); FbTk::RefCount execute_xterm(CommandParser::instance().parseLine("exec xterm")); m_rootmenu->setInternalMenu(); m_rootmenu->insert("xterm", execute_xterm); - m_rootmenu->insert(_FBTEXT(Menu, Restart, "Restart", "Restart command"), + m_rootmenu->insert(_FB_XTEXT(Menu, Restart, "Restart", "Restart command"), restart_fb); - m_rootmenu->insert(_FBTEXT(Menu, Exit, "Exit", "Exit command"), + m_rootmenu->insert(_FB_XTEXT(Menu, Exit, "Exit", "Exit command"), exit_fb); } @@ -1587,16 +1587,16 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) { // create focus menu // we don't set this to internal menu so will // be deleted toghether with the parent - FbTk::FbString focusmenu_label = _FBTEXT(Configmenu, FocusModel, + FbTk::FbString focusmenu_label = _FB_XTEXT(Configmenu, FocusModel, "Focus Model", "Method used to give focus to windows"); FbTk::Menu *focus_menu = createMenu(focusmenu_label); -#define _BOOLITEM(m,a, b, c, d, e, f) (m).insert(new BoolMenuItem(_FBTEXT(a, b, c, d), e, f)) +#define _BOOLITEM(m,a, b, c, d, e, f) (m).insert(new BoolMenuItem(_FB_XTEXT(a, b, c, d), e, f)) #define _FOCUSITEM(a, b, c, d, e) \ - focus_menu->insert(new FocusModelMenuItem(_FBTEXT(a, b, c, d), focusControl(), \ + focus_menu->insert(new FocusModelMenuItem(_FB_XTEXT(a, b, c, d), focusControl(), \ e, save_and_reconfigure)) _FOCUSITEM(Configmenu, ClickFocus, @@ -1615,7 +1615,7 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) { save_and_reconfigure)); - focus_menu->insert(new BoolMenuItem(_FBTEXT(Configmenu, + focus_menu->insert(new BoolMenuItem(_FB_XTEXT(Configmenu, AutoRaise, "Auto Raise", "Auto Raise windows on sloppy"), @@ -1630,11 +1630,11 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) { // BEGIN tab menu - FbTk::FbString tabmenu_label = _FBTEXT(Configmenu, TabMenu, + FbTk::FbString tabmenu_label = _FB_XTEXT(Configmenu, TabMenu, "Tab Options", "heading for tab-related options"); FbTk::Menu *tab_menu = createMenu(tabmenu_label); - FbTk::FbString tabplacement_label = _FBTEXT(Menu, Placement, "Placement", "Title of Placement menu"); + FbTk::FbString tabplacement_label = _FB_XTEXT(Menu, Placement, "Placement", "Title of Placement menu"); FbTk::Menu *tabplacement_menu = createToggleMenu(tabplacement_label); tab_menu->insert(tabplacement_label, tabplacement_menu); @@ -1644,7 +1644,7 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) { *resource.default_internal_tabs, save_and_reconftabs); FbTk::MenuItem *tab_width_item = - new IntResMenuItem(_FBTEXT(Configmenu, ExternalTabWidth, + new IntResMenuItem(_FB_XTEXT(Configmenu, ExternalTabWidth, "External Tab Width", "Width of external-style tabs"), resource.tab_width, 10, 3000, /* silly number */ @@ -1658,14 +1658,14 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) { Placements place_menu; // menu is 2 wide, 2 down - place_menu.push_back(PlacementP(_FBTEXT(Align, TopLeft, "Top Left", "Top Left"), FbWinFrame::TOPLEFT)); - place_menu.push_back(PlacementP(_FBTEXT(Align, LeftTop, "Left Top", "Left Top"), FbWinFrame::LEFTTOP)); - place_menu.push_back(PlacementP(_FBTEXT(Align, LeftBottom, "Left Bottom", "Left Bottom"), FbWinFrame::LEFTBOTTOM)); - place_menu.push_back(PlacementP(_FBTEXT(Align, BottomLeft, "Bottom Left", "Bottom Left"), FbWinFrame::BOTTOMLEFT)); - place_menu.push_back(PlacementP(_FBTEXT(Align, TopRight, "Top Right", "Top Right"), FbWinFrame::TOPRIGHT)); - place_menu.push_back(PlacementP(_FBTEXT(Align, RightTop, "Right Top", "Right Top"), FbWinFrame::RIGHTTOP)); - place_menu.push_back(PlacementP(_FBTEXT(Align, RightBottom, "Right Bottom", "Right Bottom"), FbWinFrame::RIGHTBOTTOM)); - place_menu.push_back(PlacementP(_FBTEXT(Align, BottomRight, "Bottom Right", "Bottom Right"), FbWinFrame::BOTTOMRIGHT)); + place_menu.push_back(PlacementP(_FB_XTEXT(Align, TopLeft, "Top Left", "Top Left"), FbWinFrame::TOPLEFT)); + place_menu.push_back(PlacementP(_FB_XTEXT(Align, LeftTop, "Left Top", "Left Top"), FbWinFrame::LEFTTOP)); + place_menu.push_back(PlacementP(_FB_XTEXT(Align, LeftBottom, "Left Bottom", "Left Bottom"), FbWinFrame::LEFTBOTTOM)); + place_menu.push_back(PlacementP(_FB_XTEXT(Align, BottomLeft, "Bottom Left", "Bottom Left"), FbWinFrame::BOTTOMLEFT)); + place_menu.push_back(PlacementP(_FB_XTEXT(Align, TopRight, "Top Right", "Top Right"), FbWinFrame::TOPRIGHT)); + place_menu.push_back(PlacementP(_FB_XTEXT(Align, RightTop, "Right Top", "Right Top"), FbWinFrame::RIGHTTOP)); + place_menu.push_back(PlacementP(_FB_XTEXT(Align, RightBottom, "Right Bottom", "Right Bottom"), FbWinFrame::RIGHTBOTTOM)); + place_menu.push_back(PlacementP(_FB_XTEXT(Align, BottomRight, "Bottom Right", "Bottom Right"), FbWinFrame::BOTTOMRIGHT)); tabplacement_menu->setMinimumSublevels(2); // create items in sub menu @@ -1733,20 +1733,20 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) { if (FbTk::Transparent::haveRender() || FbTk::Transparent::haveComposite()) { - FbTk::FbString alphamenu_label = _FBTEXT(Configmenu, Transparency, + FbTk::FbString alphamenu_label = _FB_XTEXT(Configmenu, Transparency, "Transparency", "Menu containing various transparency options"); FbTk::Menu *alpha_menu = createMenu(alphamenu_label); if (FbTk::Transparent::haveComposite(true)) { - alpha_menu->insert(new BoolMenuItem(_FBTEXT(Configmenu, ForcePseudoTrans, + alpha_menu->insert(new BoolMenuItem(_FB_XTEXT(Configmenu, ForcePseudoTrans, "Force Pseudo-Transparency", "When composite is available, still use old pseudo-transparency"), Fluxbox::instance()->getPseudoTrans(), save_and_reconfigure)); } FbTk::MenuItem *focused_alpha_item = - new IntResMenuItem(_FBTEXT(Configmenu, FocusedAlpha, + new IntResMenuItem(_FB_XTEXT(Configmenu, FocusedAlpha, "Focused Window Alpha", "Transparency level of the focused window"), resource.focused_alpha, 0, 255, *alpha_menu); @@ -1754,7 +1754,7 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) { alpha_menu->insert(focused_alpha_item); FbTk::MenuItem *unfocused_alpha_item = - new IntResMenuItem(_FBTEXT(Configmenu, + new IntResMenuItem(_FB_XTEXT(Configmenu, UnfocusedAlpha, "Unfocused Window Alpha", "Transparency level of unfocused windows"), @@ -1764,7 +1764,7 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) { alpha_menu->insert(unfocused_alpha_item); FbTk::MenuItem *menu_alpha_item = - new IntResMenuItem(_FBTEXT(Configmenu, MenuAlpha, + new IntResMenuItem(_FB_XTEXT(Configmenu, MenuAlpha, "Menu Alpha", "Transparency level of menu"), resource.menu_alpha, 0, 255, *alpha_menu); menu_alpha_item->setCommand(saverc_cmd); @@ -1862,7 +1862,7 @@ void BScreen::showGeometry(unsigned int gx, unsigned int gy) { _FB_USES_NLS; sprintf(label, - _FBTEXT(Screen, GeometryFormat, + _FB_XTEXT(Screen, GeometryFormat, "W: %4d x H: %4d", "Format for width and height window, %4d for width, and %4d for height").c_str(), gx, gy); @@ -1929,7 +1929,7 @@ void BScreen::renderGeomWindow() { _FB_USES_NLS; sprintf(label, - _FBTEXT(Screen, GeometryFormat, + _FB_XTEXT(Screen, GeometryFormat, "W: %04d x H: %04d", "Representative maximum sized text for width and height dialog").c_str(), 0, 0); diff --git a/src/Slit.cc b/src/Slit.cc index 9e69ce2..c676f30 100644 --- a/src/Slit.cc +++ b/src/Slit.cc @@ -219,8 +219,8 @@ public: std::string reallabel = m_label + " " + ( m_slit.direction() == Slit::HORIZONTAL ? - _FBTEXT(Align, Horizontal, "Horizontal", "Horizontal"): - _FBTEXT(Align, Vertical, "Vertical", "Vertical")); + _FB_XTEXT(Align, Horizontal, "Horizontal", "Horizontal"): + _FB_XTEXT(Align, Vertical, "Vertical", "Vertical")); FbTk::MenuItem::setLabel(reallabel); } private: @@ -294,7 +294,7 @@ Slit::Slit(BScreen &scr, FbTk::XLayer &layer, const char *filename) scr.resizeSig().attach(this); scr.reconfigureSig().attach(this); // if alpha changed (we disablethis signal when we get theme change sig) - scr.addConfigMenu(_FBTEXT(Slit, Slit, "Slit", "The Slit"), m_slitmenu); + scr.addConfigMenu(_FB_XTEXT(Slit, Slit, "Slit", "The Slit"), m_slitmenu); frame.pixmap = None; // move the frame out of sight for a moment @@ -322,7 +322,7 @@ Slit::Slit(BScreen &scr, FbTk::XLayer &layer, const char *filename) getLayer(Layer::MENU), this, true)); - m_layermenu->setLabel(_FBTEXT(Slit, Layer, "Slit Layer", "Title of Slit Layer Menu")); + m_layermenu->setLabel(_FB_XTEXT(Slit, Layer, "Slit Layer", "Title of Slit Layer Menu")); moveToLayer((*m_rc_layernum).getNum()); @@ -1162,12 +1162,12 @@ void Slit::updateClientmenu() { // clear old items m_clientlist_menu.removeAll(); - m_clientlist_menu.setLabel(_FBTEXT(Slit, ClientsMenu, "Clients", "Slit client menu")); + m_clientlist_menu.setLabel(_FB_XTEXT(Slit, ClientsMenu, "Clients", "Slit client menu")); FbTk::RefCount cycle_up(new FbTk::SimpleCommand(*this, &Slit::cycleClientsUp)); FbTk::RefCount cycle_down(new FbTk::SimpleCommand(*this, &Slit::cycleClientsDown)); - m_clientlist_menu.insert(_FBTEXT(Slit, CycleUp, "Cycle Up", "Cycle clients upwards"), cycle_up); - m_clientlist_menu.insert(_FBTEXT(Slit, CycleDown, "Cycle Down", "Cycle clients downwards"), cycle_down); + m_clientlist_menu.insert(_FB_XTEXT(Slit, CycleUp, "Cycle Up", "Cycle clients upwards"), cycle_up); + m_clientlist_menu.insert(_FB_XTEXT(Slit, CycleDown, "Cycle Down", "Cycle clients downwards"), cycle_down); m_clientlist_menu.insert(new FbTk::MenuSeparator()); @@ -1180,7 +1180,7 @@ void Slit::updateClientmenu() { m_clientlist_menu.insert(new FbTk::MenuSeparator()); FbTk::RefCount savecmd(new FbTk::SimpleCommand(*this, &Slit::saveClientList)); - m_clientlist_menu.insert(_FBTEXT(Slit, + m_clientlist_menu.insert(_FB_XTEXT(Slit, SaveSlitList, "Save SlitList", "Saves the current order in the slit"), savecmd); @@ -1242,37 +1242,37 @@ void Slit::setupMenu() { // setup base menu - m_slitmenu.setLabel(_FBTEXT(Slit, Slit, "Slit", "The Slit")); - m_slitmenu.insert(_FBTEXT(Menu, Placement, "Placement", "Title of Placement menu"), + m_slitmenu.setLabel(_FB_XTEXT(Slit, Slit, "Slit", "The Slit")); + m_slitmenu.insert(_FB_XTEXT(Menu, Placement, "Placement", "Title of Placement menu"), placement_menu); - m_slitmenu.insert(_FBTEXT(Menu, Layer, "Layer...", "Title of Layer menu"), m_layermenu.get()); + m_slitmenu.insert(_FB_XTEXT(Menu, Layer, "Layer...", "Title of Layer menu"), m_layermenu.get()); #ifdef XINERAMA if (screen().hasXinerama()) { - m_slitmenu.insert(_FBTEXT(Menu, OnHead, "On Head...", "Title of On Head menu"), + m_slitmenu.insert(_FB_XTEXT(Menu, OnHead, "On Head...", "Title of On Head menu"), new XineramaHeadMenu( screen().menuTheme(), screen(), screen().imageControl(), *screen().layerManager().getLayer(::Layer::MENU), *this, - _FBTEXT(Slit, OnHead, "Slit on Head", "Title of Slits On Head menu") + _FB_XTEXT(Slit, OnHead, "Slit on Head", "Title of Slits On Head menu") )); } #endif //XINERAMA - m_slitmenu.insert(new BoolMenuItem(_FBTEXT(Common, AutoHide, "Auto hide", "This thing automatically hides when not close by"), + m_slitmenu.insert(new BoolMenuItem(_FB_XTEXT(Common, AutoHide, "Auto hide", "This thing automatically hides when not close by"), *m_rc_auto_hide, save_and_reconfigure_slit)); - m_slitmenu.insert(new BoolMenuItem(_FBTEXT(Common, MaximizeOver,"Maximize Over", "Maximize over this thing when maximizing"), + m_slitmenu.insert(new BoolMenuItem(_FB_XTEXT(Common, MaximizeOver,"Maximize Over", "Maximize over this thing when maximizing"), *m_rc_maximize_over, save_and_reconfigure_slit)); // this saves resources and clears the slit window to update alpha value FbTk::MenuItem *alpha_menuitem = - new IntResMenuItem(_FBTEXT(Common, Alpha, "Alpha", "Transparency level"), + new IntResMenuItem(_FB_XTEXT(Common, Alpha, "Alpha", "Transparency level"), m_rc_alpha, 0, 255, m_slitmenu); // setup command for alpha value @@ -1285,14 +1285,14 @@ void Slit::setupMenu() { m_slitmenu.insert(alpha_menuitem); - m_slitmenu.insert(new SlitDirMenuItem(_FBTEXT(Slit, Direction, "Slit Direction", "Orientation of slit"), + m_slitmenu.insert(new SlitDirMenuItem(_FB_XTEXT(Slit, Direction, "Slit Direction", "Orientation of slit"), *this, save_and_reconfigure)); - m_slitmenu.insert(_FBTEXT(Slit, ClientsMenu, "Clients", "Slit client menu"), &m_clientlist_menu); + m_slitmenu.insert(_FB_XTEXT(Slit, ClientsMenu, "Clients", "Slit client menu"), &m_clientlist_menu); m_slitmenu.updateMenu(); // setup sub menu - placement_menu->setLabel(_FBTEXT(Slit, Placement, "Slit Placement", "Slit Placement")); + placement_menu->setLabel(_FB_XTEXT(Slit, Placement, "Slit Placement", "Slit Placement")); placement_menu->setMinimumSublevels(3); m_layermenu->setInternalMenu(); m_clientlist_menu.setInternalMenu(); @@ -1303,15 +1303,15 @@ void Slit::setupMenu() { Placements place_menu; // menu is 3 wide, 5 down - place_menu.push_back(PlacementP(_FBTEXT(Align, TopLeft, "Top Left", "Top Left"), Slit::TOPLEFT)); - place_menu.push_back(PlacementP(_FBTEXT(Align, LeftCenter, "Left Center", "Left Center"), Slit::LEFTCENTER)); - place_menu.push_back(PlacementP(_FBTEXT(Align, BottomLeft, "Bottom Left", "Bottom Left"), Slit::BOTTOMLEFT)); - place_menu.push_back(PlacementP(_FBTEXT(Align, TopCenter, "Top Center", "Top Center"), Slit::TOPCENTER)); + place_menu.push_back(PlacementP(_FB_XTEXT(Align, TopLeft, "Top Left", "Top Left"), Slit::TOPLEFT)); + place_menu.push_back(PlacementP(_FB_XTEXT(Align, LeftCenter, "Left Center", "Left Center"), Slit::LEFTCENTER)); + place_menu.push_back(PlacementP(_FB_XTEXT(Align, BottomLeft, "Bottom Left", "Bottom Left"), Slit::BOTTOMLEFT)); + place_menu.push_back(PlacementP(_FB_XTEXT(Align, TopCenter, "Top Center", "Top Center"), Slit::TOPCENTER)); place_menu.push_back(PlacementP("", Slit::TOPLEFT)); - place_menu.push_back(PlacementP(_FBTEXT(Align, BottomCenter, "Bottom Center", "Bottom Center"), Slit::BOTTOMCENTER)); - place_menu.push_back(PlacementP(_FBTEXT(Align, TopRight, "Top Right", "Top Right"), Slit::TOPRIGHT)); - place_menu.push_back(PlacementP(_FBTEXT(Align, RightCenter, "Right Center", "Right Center"), Slit::RIGHTCENTER)); - place_menu.push_back(PlacementP(_FBTEXT(Align, BottomRight, "Bottom Right", "Bottom Right"), Slit::BOTTOMRIGHT)); + place_menu.push_back(PlacementP(_FB_XTEXT(Align, BottomCenter, "Bottom Center", "Bottom Center"), Slit::BOTTOMCENTER)); + place_menu.push_back(PlacementP(_FB_XTEXT(Align, TopRight, "Top Right", "Top Right"), Slit::TOPRIGHT)); + place_menu.push_back(PlacementP(_FB_XTEXT(Align, RightCenter, "Right Center", "Right Center"), Slit::RIGHTCENTER)); + place_menu.push_back(PlacementP(_FB_XTEXT(Align, BottomRight, "Bottom Right", "Bottom Right"), Slit::BOTTOMRIGHT)); // create items in sub menu diff --git a/src/Toolbar.cc b/src/Toolbar.cc index ba21af8..26b31c4 100644 --- a/src/Toolbar.cc +++ b/src/Toolbar.cc @@ -247,15 +247,15 @@ Toolbar::Toolbar(BScreen &scrn, FbTk::XLayer &layer, size_t width): moveToLayer((*m_rc_layernum).getNum()); - m_layermenu.setLabel(_FBTEXT(Toolbar, Layer, "Toolbar Layer", "Title of toolbar layer menu")); - m_placementmenu.setLabel(_FBTEXT(Toolbar, Placement, "Toolbar Placement", "Title of toolbar placement menu")); + m_layermenu.setLabel(_FB_XTEXT(Toolbar, Layer, "Toolbar Layer", "Title of toolbar layer menu")); + m_placementmenu.setLabel(_FB_XTEXT(Toolbar, Placement, "Toolbar Placement", "Title of toolbar placement menu")); m_layermenu.setInternalMenu(); m_placementmenu.setInternalMenu(); m_toolbarmenu.setInternalMenu(); setupMenus(); // add menu to screen - screen().addConfigMenu(_FBTEXT(Toolbar, Toolbar, "Toolbar", "title of toolbar menu item"), menu()); + screen().addConfigMenu(_FB_XTEXT(Toolbar, Toolbar, "Toolbar", "title of toolbar menu item"), menu()); // geometry settings frame.width = width; @@ -808,7 +808,7 @@ void Toolbar::setupMenus() { typedef RefCount RefCommand; typedef SimpleCommand ToolbarCommand; - menu().setLabel(_FBTEXT(Toolbar, Toolbar, + menu().setLabel(_FB_XTEXT(Toolbar, Toolbar, "Toolbar", "Title of Toolbar menu")); RefCommand reconfig_toolbar(new ToolbarCommand(*this, &Toolbar::reconfigure)); @@ -824,17 +824,17 @@ void Toolbar::setupMenus() { visible_macro->add(reconfig_toolbar); visible_macro->add(save_resources); RefCommand toggle_visible_cmd(visible_macro); - menu().insert(new BoolMenuItem(_FBTEXT(Common, Visible, + menu().insert(new BoolMenuItem(_FB_XTEXT(Common, Visible, "Visible", "Whether this item is visible"), *m_rc_visible, toggle_visible_cmd)); - menu().insert(new BoolMenuItem(_FBTEXT(Common, AutoHide, + menu().insert(new BoolMenuItem(_FB_XTEXT(Common, AutoHide, "Auto hide", "Toggle auto hide of toolbar"), *m_rc_auto_hide, reconfig_toolbar_and_save_resource)); MenuItem *toolbar_menuitem = - new IntResMenuItem(_FBTEXT(Toolbar, WidthPercent, + new IntResMenuItem(_FB_XTEXT(Toolbar, WidthPercent, "Toolbar width percent", "Percentage of screen width taken by toolbar"), m_rc_width_percent, @@ -844,21 +844,21 @@ void Toolbar::setupMenus() { toolbar_menuitem->setCommand(reconfig_toolbar_and_save_resource); menu().insert(toolbar_menuitem); - menu().insert(new BoolMenuItem(_FBTEXT(Common, MaximizeOver, + menu().insert(new BoolMenuItem(_FB_XTEXT(Common, MaximizeOver, "Maximize Over", "Maximize over this thing when maximizing"), *m_rc_maximize_over, reconfig_toolbar_and_save_resource)); - menu().insert(_FBTEXT(Menu, Layer, "Layer...", "Title of Layer menu"), &layerMenu()); + menu().insert(_FB_XTEXT(Menu, Layer, "Layer...", "Title of Layer menu"), &layerMenu()); #ifdef XINERAMA if (screen().hasXinerama()) { - menu().insert(_FBTEXT(Menu, OnHead, "On Head...", "Title of On Head menu"), + menu().insert(_FB_XTEXT(Menu, OnHead, "On Head...", "Title of On Head menu"), new XineramaHeadMenu(screen().menuTheme(), screen(), screen().imageControl(), *screen().layerManager().getLayer(::Layer::MENU), *this, - _FBTEXT(Toolbar, OnHead, "Toolbar on Head", + _FB_XTEXT(Toolbar, OnHead, "Toolbar on Head", "Title of toolbar on head menu"))); } #endif // XINERAMA @@ -868,21 +868,21 @@ void Toolbar::setupMenus() { Placements place_menu; // menu is 3 wide, 5 down - place_menu.push_back(PlacementP(_FBTEXT(Align, TopLeft, "Top Left", "Top Left"), Toolbar::TOPLEFT)); - place_menu.push_back(PlacementP(_FBTEXT(Align, LeftTop, "Left Top", "Left Top"), Toolbar::LEFTTOP)); - place_menu.push_back(PlacementP(_FBTEXT(Align, LeftCenter, "Left Center", "Left Center"), Toolbar::LEFTCENTER)); - place_menu.push_back(PlacementP(_FBTEXT(Align, LeftBottom, "Left Bottom", "Left Bottom"), Toolbar::LEFTBOTTOM)); - place_menu.push_back(PlacementP(_FBTEXT(Align, BottomLeft, "Bottom Left", "Bottom Left"), Toolbar::BOTTOMLEFT)); - place_menu.push_back(PlacementP(_FBTEXT(Align, TopCenter, "Top Center", "Top Center"), Toolbar::TOPCENTER)); + place_menu.push_back(PlacementP(_FB_XTEXT(Align, TopLeft, "Top Left", "Top Left"), Toolbar::TOPLEFT)); + place_menu.push_back(PlacementP(_FB_XTEXT(Align, LeftTop, "Left Top", "Left Top"), Toolbar::LEFTTOP)); + place_menu.push_back(PlacementP(_FB_XTEXT(Align, LeftCenter, "Left Center", "Left Center"), Toolbar::LEFTCENTER)); + place_menu.push_back(PlacementP(_FB_XTEXT(Align, LeftBottom, "Left Bottom", "Left Bottom"), Toolbar::LEFTBOTTOM)); + place_menu.push_back(PlacementP(_FB_XTEXT(Align, BottomLeft, "Bottom Left", "Bottom Left"), Toolbar::BOTTOMLEFT)); + place_menu.push_back(PlacementP(_FB_XTEXT(Align, TopCenter, "Top Center", "Top Center"), Toolbar::TOPCENTER)); place_menu.push_back(PlacementP("", Toolbar::TOPLEFT)); place_menu.push_back(PlacementP("", Toolbar::TOPLEFT)); place_menu.push_back(PlacementP("", Toolbar::TOPLEFT)); - place_menu.push_back(PlacementP(_FBTEXT(Align, BottomCenter, "Bottom Center", "Bottom Center"), Toolbar::BOTTOMCENTER)); - place_menu.push_back(PlacementP(_FBTEXT(Align, TopRight, "Top Right", "Top Right"), Toolbar::TOPRIGHT)); - place_menu.push_back(PlacementP(_FBTEXT(Align, RightTop, "Right Top", "Right Top"), Toolbar::RIGHTTOP)); - place_menu.push_back(PlacementP(_FBTEXT(Align, RightCenter, "Right Center", "Right Center"), Toolbar::RIGHTCENTER)); - place_menu.push_back(PlacementP(_FBTEXT(Align, RightBottom, "Right Bottom", "Right Bottom"), Toolbar::RIGHTBOTTOM)); - place_menu.push_back(PlacementP(_FBTEXT(Align, BottomRight, "Bottom Right", "Bottom Right"), Toolbar::BOTTOMRIGHT)); + place_menu.push_back(PlacementP(_FB_XTEXT(Align, BottomCenter, "Bottom Center", "Bottom Center"), Toolbar::BOTTOMCENTER)); + place_menu.push_back(PlacementP(_FB_XTEXT(Align, TopRight, "Top Right", "Top Right"), Toolbar::TOPRIGHT)); + place_menu.push_back(PlacementP(_FB_XTEXT(Align, RightTop, "Right Top", "Right Top"), Toolbar::RIGHTTOP)); + place_menu.push_back(PlacementP(_FB_XTEXT(Align, RightCenter, "Right Center", "Right Center"), Toolbar::RIGHTCENTER)); + place_menu.push_back(PlacementP(_FB_XTEXT(Align, RightBottom, "Right Bottom", "Right Bottom"), Toolbar::RIGHTBOTTOM)); + place_menu.push_back(PlacementP(_FB_XTEXT(Align, BottomRight, "Bottom Right", "Bottom Right"), Toolbar::BOTTOMRIGHT)); placementMenu().setMinimumSublevels(3); @@ -901,13 +901,13 @@ void Toolbar::setupMenus() { } place_menu.pop_front(); } - menu().insert(_FBTEXT(Menu, Placement, "Placement", "Title of Placement menu"), &placementMenu()); + menu().insert(_FB_XTEXT(Menu, Placement, "Placement", "Title of Placement menu"), &placementMenu()); placementMenu().updateMenu(); // this saves resources and clears the slit window to update alpha value FbTk::MenuItem *alpha_menuitem = - new IntResMenuItem(_FBTEXT(Common, Alpha, "Alpha", "Transparency level"), + new IntResMenuItem(_FB_XTEXT(Common, Alpha, "Alpha", "Transparency level"), m_rc_alpha, 0, 255, menu()); // setup command for alpha value diff --git a/src/Workspace.cc b/src/Workspace.cc index e3f9d74..46d3078 100644 --- a/src/Workspace.cc +++ b/src/Workspace.cc @@ -374,10 +374,9 @@ void Workspace::setName(const std::string &name) { _FB_USES_NLS; char tname[128]; sprintf(tname, - _FBTEXT(Workspace, DefaultNameFormat, + _FB_XTEXT(Workspace, DefaultNameFormat, "Workspace %d", "Default workspace names, with a %d for the workspace number").c_str(), m_id + 1); //m_id starts at 0 - m_name = FbTk::FbStringUtil::LocaleStrToFb(tname); } screen().updateWorkspaceNamesAtom(); diff --git a/src/WorkspaceMenu.cc b/src/WorkspaceMenu.cc index c3dfd9a..1083ea3 100644 --- a/src/WorkspaceMenu.cc +++ b/src/WorkspaceMenu.cc @@ -115,8 +115,8 @@ void WorkspaceMenu::init(BScreen &screen) { removeAll(); - setLabel(_FBTEXT(Workspace, MenuTitle, "Workspaces", "Title of main workspace menu")); - insert(_FBTEXT(Menu, Icons, "Icons", "Iconic windows menu title"), + setLabel(_FB_XTEXT(Workspace, MenuTitle, "Workspaces", "Title of main workspace menu")); + insert(_FB_XTEXT(Menu, Icons, "Icons", "Iconic windows menu title"), MenuCreator::createMenuType("iconmenu", screen.screenNumber())); insert(new FbTk::MenuSeparator()); // for each workspace add workspace name and it's menu to our workspace menu @@ -150,11 +150,11 @@ void WorkspaceMenu::init(BScreen &screen) { RefCount start_edit(CommandParser::instance().parseLine("setworkspacenamedialog")); insert(new FbTk::MenuSeparator()); - insert(_FBTEXT(Workspace, NewWorkspace, "New Workspace", "Add a new workspace"), + insert(_FB_XTEXT(Workspace, NewWorkspace, "New Workspace", "Add a new workspace"), new_workspace_cmd); - insert(_FBTEXT(Toolbar, EditWkspcName, "Edit current workspace name", "Edit current workspace name"), + insert(_FB_XTEXT(Toolbar, EditWkspcName, "Edit current workspace name", "Edit current workspace name"), start_edit); - insert(_FBTEXT(Workspace, RemoveLast, "Remove Last", "Remove the last workspace"), + insert(_FB_XTEXT(Workspace, RemoveLast, "Remove Last", "Remove the last workspace"), remove_last_cmd); updateMenu(); diff --git a/src/Xutil.cc b/src/Xutil.cc index 840b106..87f5253 100644 --- a/src/Xutil.cc +++ b/src/Xutil.cc @@ -70,11 +70,11 @@ FbTk::FbString getWMName(Window window) { XFree(text_prop.value); } else { // default name - name = FbTk::FbStringUtil::LocaleStrToFb(_FBTEXT(Window, Unnamed, "Unnamed", "Default name for a window without a WM_NAME")); + name = _FB_XTEXT(Window, Unnamed, "Unnamed", "Default name for a window without a WM_NAME"); } } else { // default name - name = FbTk::FbStringUtil::LocaleStrToFb(_FBTEXT(Window, Unnamed, "Unnamed", "Default name for a window without a WM_NAME")); + name = _FB_XTEXT(Window, Unnamed, "Unnamed", "Default name for a window without a WM_NAME"); } return name; diff --git a/src/fluxbox.cc b/src/fluxbox.cc index 94c9730..471f46a 100644 --- a/src/fluxbox.cc +++ b/src/fluxbox.cc @@ -234,10 +234,10 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile _FB_USES_NLS; if (s_singleton != 0) - throw _FBTEXT(Fluxbox, FatalSingleton, "Fatal! There can only one instance of fluxbox class.", "Error displayed on weird error where an instance of the Fluxbox class already exists!"); + throw _FB_CONSOLETEXT(Fluxbox, FatalSingleton, "Fatal! There can only one instance of fluxbox class.", "Error displayed on weird error where an instance of the Fluxbox class already exists!"); if (display() == 0) { - throw _FBTEXT(Fluxbox, NoDisplay, + throw _FB_CONSOLETEXT(Fluxbox, NoDisplay, "Can not connect to X server.\nMake sure you started X before you start Fluxbox.", "Error message when no X display appears to exist"); } @@ -312,10 +312,10 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile setupConfigFiles(); if (! XSupportsLocale()) - cerr<<_FBTEXT(Fluxbox, WarningLocale, "Warning: X server does not support locale", "XSupportsLocale returned false")<= m_argc) { - cerr << _FBTEXT(main, ScreenRequiresArg, "error, -screen requires argument", "the -screen option requires a file argument") << endl; + cerr << _FB_CONSOLETEXT(main, ScreenRequiresArg, "error, -screen requires argument", "the -screen option requires a file argument") << endl; exit(1); } @@ -367,7 +367,7 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile if (m_screen_list.empty()) { - throw _FBTEXT(Fluxbox, ErrorNoScreens, + throw _FB_CONSOLETEXT(Fluxbox, ErrorNoScreens, "Couldn't find screens to manage.\nMake sure you don't have another window manager running.", "Error message when no unmanaged screens found - usually means another window manager is running"); } @@ -594,7 +594,7 @@ void Fluxbox::setupConfigFiles() { _FB_USES_NLS; // create directory with perm 700 if (mkdir(dirname.c_str(), 0700)) { - fprintf(stderr, _FBTEXT(Fluxbox, ErrorCreatingDirectory, + fprintf(stderr, _FB_CONSOLETEXT(Fluxbox, ErrorCreatingDirectory, "Can't create %s directory", "Can't create a directory, one %s for directory name").c_str(), dirname.c_str()); @@ -758,7 +758,7 @@ void Fluxbox::handleEvent(XEvent * const e) { screen = searchScreen(e->xmaprequest.parent); if (screen == 0) { - cerr<<"Fluxbox "<<_FBTEXT(Fluxbox, CantMapWindow, "Warning! Could not find screen to map window on!", "")<createWindow(e->xmaprequest.window); @@ -1156,17 +1156,17 @@ void Fluxbox::handleSignal(int signum) { break; default: fprintf(stderr, - _FBTEXT(BaseDisplay, SignalCaught, "%s: signal %d caught\n", "signal catch debug message. Include %s for command and %d for signal number").c_str(), + _FB_CONSOLETEXT(BaseDisplay, SignalCaught, "%s: signal %d caught\n", "signal catch debug message. Include %s for command and %d for signal number").c_str(), m_argv[0], signum); if (! m_starting && ! re_enter) { re_enter = 1; - cerr<<_FBTEXT(BaseDisplay, ShuttingDown, "Shutting Down\n", "Quitting because of signal, end with newline"); + cerr<<_FB_CONSOLETEXT(BaseDisplay, ShuttingDown, "Shutting Down\n", "Quitting because of signal, end with newline"); shutdown(); } - cerr<<_FBTEXT(BaseDisplay, Aborting, "Aborting... dumping core\n", "Aboring and dumping core, end with newline"); + cerr<<_FB_CONSOLETEXT(BaseDisplay, Aborting, "Aborting... dumping core\n", "Aboring and dumping core, end with newline"); abort(); break; } @@ -1455,7 +1455,7 @@ void Fluxbox::save_rc() { m_resourcemanager.save(dbfile.c_str(), dbfile.c_str()); m_screen_rm.save(dbfile.c_str(), dbfile.c_str()); } else - cerr<<_FBTEXT(Fluxbox, BadRCFile, "rc filename is invalid!", "Bad settings file")<empty()) @@ -1555,7 +1555,7 @@ void Fluxbox::load_rc() { if (!Workspace::loadGroups(*m_rc_groupfile)) { #ifdef DEBUG - cerr<<_FBTEXT(Fluxbox, CantLoadGroupFile, "Failed to load groupfile", "Couldn't load the groupfile")<<": "<<*m_rc_groupfile< 0) - ostr << _FBTEXT(Common, SvnRevision, "SVN Revision", "Revision number in SVN repositary") << ": " << svnversion() << endl; + ostr << _FB_CONSOLETEXT(Common, SvnRevision, "SVN Revision", "Revision number in SVN repositary") << ": " << svnversion() << endl; #if defined(__DATE__) && defined(__TIME__) - ostr<<_FBTEXT(Common, Compiled, "Compiled", "Time fluxbox was compiled")<<": "<<__DATE__<<" "<<__TIME__< "<< - _FBTEXT(Common, Disabled, "disabled", "option is turned off")<<"): "<= argc) { - cerr<<_FBTEXT(main, RCRequiresArg, + cerr<<_FB_CONSOLETEXT(main, RCRequiresArg, "error: '-rc' requires an argument", "the -rc option requires a file argument")<= argc) { - cerr<<_FBTEXT(main, DISPLAYRequiresArg, + cerr<<_FB_CONSOLETEXT(main, DISPLAYRequiresArg, "error: '-display' requires an argument", "")<(display_env.c_str()))) { - cerr<<_FBTEXT(main, WarnDisplayEnv, + cerr<<_FB_CONSOLETEXT(main, WarnDisplayEnv, "warning: couldn't set environment variable 'DISPLAY'", "")<= argc) { - cerr<<_FBTEXT(main, LOGRequiresArg, "error: '-log' needs an argument", "")<\t\tuse display connection.\n" @@ -252,9 +262,9 @@ int main(int argc, char **argv) { // setup log file if (log_file) { - cerr<<_FBTEXT(main, LoggingTo, "Logging to", "Logging to a file")<<": "<