#include "support/debug.h"
#include "support/gettext.h"
+#include "support/lstrings.h"
#include "support/Translator.h"
#include "frontends/Application.h"
#include <sstream>
using namespace std;
+using namespace lyx::support;
namespace lyx {
void InsetBox::setButtonLabel()
{
- BoxType btype = boxtranslator().find(params_.type);
+ BoxType const btype = boxtranslator().find(params_.type);
- docstring label;
- label += _("Box");
- label += " (";
- if (btype == Frameless) {
+ docstring const type = _("Box");
+
+ docstring inner;
+ if (params_.inner_box) {
if (params_.use_parbox)
- label += _("Parbox");
+ inner = _("Parbox");
else
- label += _("Minipage");
- } else {
- label += boxtranslator_loc().find(btype);
+ inner = _("Minipage");
}
- label += ")";
+ docstring frame;
+ if (btype != Frameless)
+ frame = boxtranslator_loc().find(btype);
+
+ docstring label;
+ if (inner.empty() && frame.empty())
+ label = type;
+ else if (inner.empty())
+ label = bformat(_("%1$s (%2$s)"),
+ type, frame);
+ else if (frame.empty())
+ label = bformat(_("%1$s (%2$s)"),
+ type, inner);
+ else
+ label = bformat(_("%1$s (%2$s, %3$s)"),
+ type, inner, frame);
setLabel(label);
}