// File already open?
if (bufferlist.exists(s)) {
string const file = makeDisplayPath(s, 20);
- string text = bformat(_("The document %1$s is already "
- "loaded.\n\nDo you want to revert "
- "to the saved version?"), file);
- int const ret = Alert::prompt(_("Revert to saved document?"),
- text, 0, 1, _("&Revert"), _("&Switch to document"));
+ string text = bformat(lyx::to_utf8(_("The document %1$s is already "
+ "loaded.\n\nDo you want to revert "
+ "to the saved version?")), file);
+ int const ret = Alert::prompt(lyx::to_utf8(_("Revert to saved document?")),
+ text, 0, 1, lyx::to_utf8(_("&Revert")), lyx::to_utf8(_("&Switch to document")));
if (ret != 0) {
setBuffer(bufferlist.getBuffer(s));
return false;
}
} else {
- string text = bformat(_("The document %1$s does not yet "
- "exist.\n\nDo you want to create "
- "a new document?"), s);
- int const ret = Alert::prompt(_("Create new document?"),
- text, 0, 1, _("&Create"), _("Cancel"));
+ string text = bformat(lyx::to_utf8(_("The document %1$s does not yet "
+ "exist.\n\nDo you want to create "
+ "a new document?")), s);
+ int const ret = Alert::prompt(lyx::to_utf8(_("Create new document?")),
+ text, 0, 1, lyx::to_utf8(_("&Create")), lyx::to_utf8(_("Cancel")));
if (ret == 0) {
b = newFile(s, string(), true);
cursor_.pos());
if (i > 0)
// emit message signal.
- bv_->message(bformat(_("Saved bookmark %1$d"), i));
+ bv_->message(bformat(lyx::to_utf8(_("Saved bookmark %1$d")), i));
}
if (i > 0)
// emit message signal.
- bv_->message(bformat(_("Moved to bookmark %1$d"), i));
+ bv_->message(bformat(lyx::to_utf8(_("Moved to bookmark %1$d")), i));
}
initpath = trypath;
}
- FileDialog fileDlg(_("Select LyX document to insert"),
+ FileDialog fileDlg(lyx::to_utf8(_("Select LyX document to insert")),
LFUN_FILE_INSERT,
- make_pair(string(_("Documents|#o#O")),
+ make_pair(string(lyx::to_utf8(_("Documents|#o#O"))),
string(lyxrc.document_path)),
- make_pair(string(_("Examples|#E#e")),
+ make_pair(string(lyx::to_utf8(_("Examples|#E#e"))),
string(addPath(package().system_support(), "examples"))));
FileDialog::Result result =
fileDlg.open(initpath,
- FileFilterList(_("LyX Documents (*.lyx)")),
+ FileFilterList(lyx::to_utf8(_("LyX Documents (*.lyx)"))),
string());
if (result.first == FileDialog::Later)
// check selected filename
if (filename.empty()) {
// emit message signal.
- bv_->message(_("Canceled."));
+ bv_->message(lyx::to_utf8(_("Canceled.")));
return;
}
}
string const disp_fn = makeDisplayPath(filename);
// emit message signal.
- bv_->message(bformat(_("Inserting document %1$s..."), disp_fn));
+ bv_->message(bformat(lyx::to_utf8(_("Inserting document %1$s...")), disp_fn));
string res;
Buffer buf("", false);
el = buf.errorList("Parse");
lyx::cap::pasteParagraphList(cursor_, buf.paragraphs(),
buf.params().textclass, el);
- res = _("Document %1$s inserted.");
+ res = lyx::to_utf8(_("Document %1$s inserted."));
} else
- res = _("Could not insert document %1$s");
+ res = lyx::to_utf8(_("Could not insert document %1$s"));
// emit message signal.
bv_->message(bformat(res, disp_fn));
case LFUN_UNDO:
if (available()) {
- cur.message(_("Undo"));
+ cur.message(lyx::to_utf8(_("Undo")));
cur.clearSelection();
if (!textUndo(*bv_))
- cur.message(_("No further undo information"));
+ cur.message(lyx::to_utf8(_("No further undo information")));
update();
switchKeyMap();
}
case LFUN_REDO:
if (available()) {
- cur.message(_("Redo"));
+ cur.message(lyx::to_utf8(_("Redo")));
cur.clearSelection();
if (!textRedo(*bv_))
- cur.message(_("No further redo information"));
+ cur.message(lyx::to_utf8(_("No further redo information")));
update();
switchKeyMap();
}
string message;
if (count != 1) {
if (cur.selection())
- message = bformat(_("%1$d words in selection."),
+ message = bformat(lyx::to_utf8(_("%1$d words in selection.")),
count);
else
- message = bformat(_("%1$d words in document."),
+ message = bformat(lyx::to_utf8(_("%1$d words in document.")),
count);
}
else {
if (cur.selection())
- message = _("One word in selection.");
+ message = lyx::to_utf8(_("One word in selection."));
else
- message = _("One word in document.");
+ message = lyx::to_utf8(_("One word in document."));
}
- Alert::information(_("Count words"), message);
+ Alert::information(lyx::to_utf8(_("Count words")), message);
}
break;
if (!cur.result().dispatched())
cur.dispatch(tmpcmd);
- if (cur.result().dispatched())
+ if (cur.result().dispatched())
cur.clearSelection();
-
+
break;
}
string const tmp = onlyFilename(changeExtension(file, ".log"));
#if USE_BOOST_FORMAT
- boost::format msg(_("ChkTeX warning id # %1$d"));
+ boost::format msg(lyx::to_utf8(_("ChkTeX warning id # %1$d")));
#else
- string const msg(_("ChkTeX warning id # "));
+ string const msg(lyx::to_utf8(_("ChkTeX warning id # ")));
#endif
ifstream ifs(tmp.c_str());
while (getline(ifs, token)) {
// to the buffer language.
if (p.ownerCode() == InsetBase::ERT_CODE) {
p.changeLanguage(buffer_.params(), latex_language,
- buffer_.getLanguage());
+ buffer_.getLanguage());
}
p.setInsetOwner(0);
}
if (!hasLayout && name != tclass1.defaultLayoutName()) {
string const s = bformat(
- _("Layout had to be changed from\n%1$s to %2$s\n"
- "because of class conversion from\n%3$s to %4$s"),
+ lyx::to_utf8(_("Layout had to be changed from\n%1$s to %2$s\n"
+ "because of class conversion from\n%3$s to %4$s")),
name, it->layout()->name(), tclass1.name(), tclass2.name());
// To warn the user that something had to be done.
- errorlist.push_back(ErrorItem(_("Changed Layout"), s,
+ errorlist.push_back(ErrorItem(lyx::to_utf8(_("Changed Layout")), s,
it->id(), 0,
it->size()));
}
if (found_cs == tclass2.charstyles().end()) {
// The character style is undefined in tclass2
inset.setUndefined();
- string const s = bformat(_(
+ string const s = bformat(lyx::to_utf8(_(
"Character style %1$s is "
"undefined because of class "
- "conversion from\n%2$s to %3$s"),
+ "conversion from\n%2$s to %3$s")),
name, tclass1.name(), tclass2.name());
// To warn the user that something had to be done.
errorlist.push_back(ErrorItem(
- _("Undefined character style"),
+ lyx::to_utf8(_("Undefined character style")),
s, it.paragraph().id(),
it.pos(), it.pos() + 1));
} else if (inset.undefined()) {
// faster we need to be more clever and probably also have more
// calls to cur.bv().owner()->gui().selection().put. (Lgb)
// cur.bv().owner()->gui().selection().put(cur.selectionAsString(true));
-
+
// make sure that the depth behind the selection are restored, too
recordUndoSelection(cur);
{
Pimpl::InfoTab::const_iterator it = pimpl_->infotab.find(c);
if (it != pimpl_->infotab.end())
- return _(it->second.guiname);
+ return lyx::to_utf8(_(it->second.guiname));
return "none";
}
Pimpl::InfoTab::const_iterator it = pimpl_->infotab.begin();
Pimpl::InfoTab::const_iterator end = pimpl_->infotab.end();
for (; it != end; ++it) {
- if (!compare_ascii_no_case(_(it->second.guiname), guiname))
+ if (!compare_ascii_no_case(lyx::to_utf8(_(it->second.guiname)), guiname))
return it->first;
}
return LColor::inherit;
string runMessage(unsigned int count)
{
- return bformat(_("Waiting for LaTeX run number %1$d"), count);
+ return bformat(lyx::to_utf8(_("Waiting for LaTeX run number %1$d")), count);
}
} // anon namespace
if (head.haschanged(onlyFilename(changeExtension(file, ".idx")))) {
// no checks for now
lyxerr[Debug::LATEX] << "Running MakeIndex." << endl;
- message(_("Running MakeIndex."));
+ message(lyx::to_utf8(_("Running MakeIndex.")));
rerun |= runMakeIndex(onlyFilename(changeExtension(file, ".idx")), runparams);
}
// tags is found -> run bibtex and set rerun = true;
// no checks for now
lyxerr[Debug::LATEX] << "Running BibTeX." << endl;
- message(_("Running BibTeX."));
+ message(lyx::to_utf8(_("Running BibTeX.")));
updateBibtexDependencies(head, bibtex_info);
rerun |= runBibTeX(bibtex_info);
} else if (!had_depfile) {
if (head.haschanged(onlyFilename(changeExtension(file, ".idx")))) {
// no checks for now
lyxerr[Debug::LATEX] << "Running MakeIndex." << endl;
- message(_("Running MakeIndex."));
+ message(lyx::to_utf8(_("Running MakeIndex.")));
rerun = runMakeIndex(onlyFilename(changeExtension(file, ".idx")), runparams);
}
// fallback to md_item
case md_item: {
lex.next(true);
- string const name = _(lex.getString());
+ string const name = lyx::to_utf8(_(lex.getString()));
lex.next(true);
string const command = lex.getString();
FuncRequest func = lyxaction.lookupFunc(command);
// fallback to md_submenu
case md_submenu: {
lex.next(true);
- string const mlabel = _(lex.getString());
+ string const mlabel = lyx::to_utf8(_(lex.getString()));
lex.next(true);
string const mname = lex.getString();
add(MenuItem(MenuItem::Submenu, mlabel, mname,
Strings const names = bufferlist.getFileNames();
if (names.empty()) {
- tomenu.add(MenuItem(MenuItem::Command, _("No Documents Open!"),
+ tomenu.add(MenuItem(MenuItem::Command, lyx::to_utf8(_("No Documents Open!")),
FuncRequest(LFUN_NOACTION)), view);
return;
}
{
if (!view->buffer() && kind != MenuItem::ImportFormats) {
tomenu.add(MenuItem(MenuItem::Command,
- _("No Documents Open!"),
+ lyx::to_utf8(_("No Documents Open!")),
FuncRequest(LFUN_NOACTION)),
view);
return;
switch (kind) {
case MenuItem::ImportFormats:
if ((*fit)->name() == "text")
- label = _("Plain Text as Lines");
+ label = lyx::to_utf8(_("Plain Text as Lines"));
else if ((*fit)->name() == "textparagraph")
- label = _("Plain Text as Paragraphs");
+ label = lyx::to_utf8(_("Plain Text as Paragraphs"));
label += "...";
break;
case MenuItem::ViewFormats:
{
if (!view->buffer()) {
tomenu.add(MenuItem(MenuItem::Command,
- _("No Documents Open!"),
+ lyx::to_utf8(_("No Documents Open!")),
FuncRequest(LFUN_NOACTION)),
view);
return;
FloatList::const_iterator end = floats.end();
for (; cit != end; ++cit) {
tomenu.add(MenuItem(MenuItem::Command,
- _(cit->second.listName()),
+ lyx::to_utf8(_(cit->second.listName())),
FuncRequest(LFUN_FLOAT_LIST,
cit->second.type())),
view);
{
if (!view->buffer()) {
tomenu.add(MenuItem(MenuItem::Command,
- _("No Documents Open!"),
+ lyx::to_utf8(_("No Documents Open!")),
FuncRequest(LFUN_NOACTION)),
view);
return;
FloatList::const_iterator end = floats.end();
for (; cit != end; ++cit) {
// normal float
- string const label = _(cit->second.name());
+ string const label = lyx::to_utf8(_(cit->second.name()));
tomenu.add(MenuItem(MenuItem::Command, label,
FuncRequest(LFUN_FLOAT_INSERT,
cit->second.type())),
{
if (!view->buffer()) {
tomenu.add(MenuItem(MenuItem::Command,
- _("No Documents Open!"),
+ lyx::to_utf8(_("No Documents Open!")),
FuncRequest(LFUN_NOACTION)),
view);
return;
Buffer const * buf = view->buffer();
if (!buf) {
tomenu.add(MenuItem(MenuItem::Command,
- _("No Documents Open!"),
+ lyx::to_utf8(_("No Documents Open!")),
FuncRequest(LFUN_NOACTION)),
view);
return;
FuncRequest(ccit->action())));
}
string const & floatName = floatlist.getType(cit->first).listName();
- MenuItem item(MenuItem::Submenu, _(floatName));
+ MenuItem item(MenuItem::Submenu, lyx::to_utf8(_(floatName)));
item.submenu(menu.release());
tomenu.add(item);
}
cit = toc_list.find("TOC");
if (cit == end) {
tomenu.add(MenuItem(MenuItem::Command,
- _("No Table of contents"),
+ lyx::to_utf8(_("No Table of contents")),
FuncRequest()),
view);
} else {
string const SpellBase::error()
{
- return _("Native OS API not yet supported.");
+ return lyx::to_utf8(_("Native OS API not yet supported."));
}
switch (lex.lex()) {
case TO_ADD:
if (lex.next(true)) {
- string const tooltip = _(lex.getString());
+ string const tooltip = lyx::to_utf8(_(lex.getString()));
lex.next(true);
string const func_arg = lex.getString();
lyxerr[Debug::PARSER]
closing();
if (!temppath().empty() && !destroyDir(temppath())) {
- Alert::warning(_("Could not remove temporary directory"),
- bformat(_("Could not remove the temporary directory %1$s"), temppath()));
+ Alert::warning(lyx::to_utf8(_("Could not remove temporary directory")),
+ bformat(lyx::to_utf8(_("Could not remove the temporary directory %1$s")), temppath()));
}
// Remove any previewed LaTeX snippets associated with this buffer.
void unknownClass(string const & unknown)
{
- Alert::warning(_("Unknown document class"),
- bformat(_("Using the default document class, because the "
- "class %1$s is unknown."), unknown));
+ Alert::warning(lyx::to_utf8(_("Unknown document class")),
+ bformat(lyx::to_utf8(_("Using the default document class, because the "
+ "class %1$s is unknown.")), unknown));
}
} // anon
unknownClass(unknown);
} else {
++unknown_tokens;
- string const s = bformat(_("Unknown token: "
- "%1$s %2$s\n"),
+ string const s = bformat(lyx::to_utf8(_("Unknown token: "
+ "%1$s %2$s\n")),
token,
lex.getString());
- errorList.push_back(ErrorItem(_("Document header error"),
+ errorList.push_back(ErrorItem(lyx::to_utf8(_("Document header error")),
s, -1, 0, 0));
}
}
}
if (begin_header_line) {
- string const s = _("\\begin_header is missing");
- errorList.push_back(ErrorItem(_("Document header error"),
+ string const s = lyx::to_utf8(_("\\begin_header is missing"));
+ errorList.push_back(ErrorItem(lyx::to_utf8(_("Document header error")),
s, -1, 0, 0));
}
lex.next();
string const token = lex.getString();
if (token != "\\begin_document") {
- string const s = _("\\begin_document is missing");
- errorList.push_back(ErrorItem(_("Document header error"),
+ string const s = lyx::to_utf8(_("\\begin_document is missing"));
+ errorList.push_back(ErrorItem(lyx::to_utf8(_("Document header error")),
s, -1, 0, 0));
}
readHeader(lex);
if (!params().getLyXTextClass().load(filePath())) {
string theclass = params().getLyXTextClass().name();
- Alert::error(_("Can't load document class"), bformat(
+ Alert::error(lyx::to_utf8(_("Can't load document class")), bformat(
"Using the default document class, because the "
" class %1$s could not be loaded.", theclass));
params().textclass = 0;
BOOST_ASSERT(!filename.empty());
if (!lex.isOK()) {
- Alert::error(_("Document could not be read"),
- bformat(_("%1$s could not be read."), filename));
+ Alert::error(lyx::to_utf8(_("Document could not be read")),
+ bformat(lyx::to_utf8(_("%1$s could not be read.")), filename));
return false;
}
string const token(lex.getString());
if (!lex.isOK()) {
- Alert::error(_("Document could not be read"),
- bformat(_("%1$s could not be read."), filename));
+ Alert::error(lyx::to_utf8(_("Document could not be read")),
+ bformat(lyx::to_utf8(_("%1$s could not be read.")), filename));
return false;
}
if (token != "\\lyxformat") {
lyxerr << "Token: " << token << endl;
- Alert::error(_("Document format failure"),
- bformat(_("%1$s is not a LyX document."),
+ Alert::error(lyx::to_utf8(_("Document format failure")),
+ bformat(lyx::to_utf8(_("%1$s is not a LyX document.")),
filename));
return false;
}
if (file_format != LYX_FORMAT) {
string const tmpfile = tempName();
if (tmpfile.empty()) {
- Alert::error(_("Conversion failed"),
- bformat(_("%1$s is from an earlier"
+ Alert::error(lyx::to_utf8(_("Conversion failed")),
+ bformat(lyx::to_utf8(_("%1$s is from an earlier"
" version of LyX, but a temporary"
" file for converting it could"
- " not be created."),
+ " not be created.")),
filename));
return false;
}
string const lyx2lyx = libFileSearch("lyx2lyx", "lyx2lyx");
if (lyx2lyx.empty()) {
- Alert::error(_("Conversion script not found"),
- bformat(_("%1$s is from an earlier"
+ Alert::error(lyx::to_utf8(_("Conversion script not found")),
+ bformat(lyx::to_utf8(_("%1$s is from an earlier"
" version of LyX, but the"
" conversion script lyx2lyx"
- " could not be found."),
+ " could not be found.")),
filename));
return false;
}
cmd_ret const ret = runCommand(command_str);
if (ret.first != 0) {
- Alert::error(_("Conversion script failed"),
- bformat(_("%1$s is from an earlier version"
+ Alert::error(lyx::to_utf8(_("Conversion script failed")),
+ bformat(lyx::to_utf8(_("%1$s is from an earlier version"
" of LyX, but the lyx2lyx script"
- " failed to convert it."),
+ " failed to convert it.")),
filename));
return false;
} else {
}
if (readDocument(lex)) {
- Alert::error(_("Document format failure"),
- bformat(_("%1$s ended unexpectedly, which means"
- " that it is probably corrupted."),
+ Alert::error(lyx::to_utf8(_("Document format failure")),
+ bformat(lyx::to_utf8(_("%1$s ended unexpectedly, which means"
+ " that it is probably corrupted.")),
filename));
}
fs::copy_file(fileName(), s, false);
}
catch (fs::filesystem_error const & fe) {
- Alert::error(_("Backup failure"),
- bformat(_("LyX was not able to make a backup copy in %1$s.\n"
- "Please check if the directory exists and is writeable."),
+ Alert::error(lyx::to_utf8(_("Backup failure")),
+ bformat(lyx::to_utf8(_("LyX was not able to make a backup copy in %1$s.\n"
+ "Please check if the directory exists and is writeable.")),
fs::path(s).branch_path().native_directory_string()));
lyxerr[Debug::DEBUG] << "Fs error: "
<< fe.what() << endl;
string const org_path = filePath();
Path p(path); // path to LaTeX file
- message(_("Running chktex..."));
+ message(lyx::to_utf8(_("Running chktex...")));
// Generate the LaTeX file if neccessary
OutputParams runparams;
int const res = chktex.run(terr); // run chktex
if (res == -1) {
- Alert::error(_("chktex failure"),
- _("Could not run chktex successfully."));
+ Alert::error(lyx::to_utf8(_("chktex failure")),
+ lyx::to_utf8(_("Could not run chktex successfully.")));
} else if (res > 0) {
// Fill-in the error list with the TeX errors
bufferErrors(*this, terr, errorLists_["ChkTex"]);
return pimpl_->messages->get(l10n);
}
- // FIXME UNICODE When _() is changed to return a docstring
- // the from_utf8 can be removed
- return lyx::from_utf8(_(l10n));
+ return _(l10n);
}
// File information about normal file
if (!fs::exists(s)) {
string const file = makeDisplayPath(s, 50);
- string text = bformat(_("The specified document\n%1$s"
- "\ncould not be read."), file);
- Alert::error(_("Could not read document"), text);
+ string text = bformat(lyx::to_utf8(_("The specified document\n%1$s"
+ "\ncould not be read.")), file);
+ Alert::error(lyx::to_utf8(_("Could not read document")), text);
return false;
}
{
string const file = makeDisplayPath(s, 20);
string const text =
- bformat(_("An emergency save of the document "
+ bformat(lyx::to_utf8(_("An emergency save of the document "
"%1$s exists.\n\n"
- "Recover emergency save?"), file);
- switch (Alert::prompt(_("Load emergency save?"), text, 0, 2,
- _("&Recover"), _("&Load Original"),
- _("&Cancel")))
+ "Recover emergency save?")), file);
+ switch (Alert::prompt(lyx::to_utf8(_("Load emergency save?")), text, 0, 2,
+ lyx::to_utf8(_("&Recover")), lyx::to_utf8(_("&Load Original")),
+ lyx::to_utf8(_("&Cancel"))))
{
case 0:
// the file is not saved if we load the emergency file.
{
string const file = makeDisplayPath(s, 20);
string const text =
- bformat(_("The backup of the document "
+ bformat(lyx::to_utf8(_("The backup of the document "
"%1$s is newer.\n\nLoad the "
- "backup instead?"), file);
- switch (Alert::prompt(_("Load backup?"), text, 0, 2,
- _("&Load backup"), _("Load &original"),
- _("&Cancel") ))
+ "backup instead?")), file);
+ switch (Alert::prompt(lyx::to_utf8(_("Load backup?")), text, 0, 2,
+ lyx::to_utf8(_("&Load backup")), lyx::to_utf8(_("Load &original")),
+ lyx::to_utf8(_("&Cancel") )))
{
case 0:
// the file is not saved if we load the autosave file.
// Here we probably should run
if (LyXVC::file_not_found_hook(s)) {
string const text =
- bformat(_("Do you want to retrieve the document"
- " %1$s from version control?"), file);
- int const ret = Alert::prompt(_("Retrieve from version control?"),
- text, 0, 1, _("&Retrieve"), _("&Cancel"));
+ bformat(lyx::to_utf8(_("Do you want to retrieve the document"
+ " %1$s from version control?")), file);
+ int const ret = Alert::prompt(lyx::to_utf8(_("Retrieve from version control?")),
+ text, 0, 1, lyx::to_utf8(_("&Retrieve")), lyx::to_utf8(_("&Cancel")));
if (ret == 0) {
// How can we know _how_ to do the checkout?
if (!tname.empty()) {
if (!b->readFile(tname)) {
string const file = makeDisplayPath(tname, 50);
- string const text = bformat(_("The specified document template\n%1$s\ncould not be read."), file);
- Alert::error(_("Could not read template"), text);
+ string const text = bformat(lyx::to_utf8(_("The specified document template\n%1$s\ncould not be read.")), file);
+ Alert::error(lyx::to_utf8(_("Could not read template")), text);
bufferlist.release(b);
return 0;
}
// Doesn't work... yet.
// FIXME UNICODE
- s = bformat(_("%1$s #:"), lyx::to_utf8(buf.B_(fl.name())));
+ s = bformat(lyx::to_utf8(_("%1$s #:")), lyx::to_utf8(buf.B_(fl.name())));
} else {
// par->SetLayout(0);
// FIXME UNICODE
file = makeDisplayPath(buf->fileName(), 30);
string const text =
- bformat(_("The document %1$s has unsaved changes.\n\n"
- "Do you want to save the document or discard the changes?"), file);
- int const ret = Alert::prompt(_("Save changed document?"),
- text, 0, 2, _("&Save"), _("&Discard"), _("&Cancel"));
+ bformat(lyx::to_utf8(_("The document %1$s has unsaved changes.\n\n"
+ "Do you want to save the document or discard the changes?")), file);
+ int const ret = Alert::prompt(lyx::to_utf8(_("Save changed document?")),
+ text, 0, 2, lyx::to_utf8(_("&Save")), lyx::to_utf8(_("&Discard")), lyx::to_utf8(_("&Cancel")));
if (ret == 0) {
// FIXME: WriteAs can be asynch !
// save file names to .lyx/session
it = bstore.begin();
for (; it != end; ++it) {
- // if master/slave are both open, do not save slave since it
+ // if master/slave are both open, do not save slave since it
// will be automatically loaded when the master is loaded
if ((*it)->getMasterBuffer() == (*it))
LyX::ref().session().addLastOpenedFile((*it)->fileName());
fname = makeDisplayPath(buf->fileName(), 30);
string const text =
- bformat(_("The document %1$s has unsaved changes.\n\n"
- "Do you want to save the document or discard the changes?"), fname);
- int const ret = Alert::prompt(_("Save changed document?"),
- text, 0, 2, _("&Save"), _("&Discard"), _("&Cancel"));
+ bformat(lyx::to_utf8(_("The document %1$s has unsaved changes.\n\n"
+ "Do you want to save the document or discard the changes?")), fname);
+ int const ret = Alert::prompt(lyx::to_utf8(_("Save changed document?")),
+ text, 0, 2, lyx::to_utf8(_("&Save")), lyx::to_utf8(_("&Discard")), lyx::to_utf8(_("&Cancel")));
if (ret == 0) {
if (buf->isUnnamed()) {
string const doc = buf->isUnnamed()
? onlyFilename(buf->fileName()) : buf->fileName();
- lyxerr << bformat(_("LyX: Attempting to save document %1$s"), doc) << endl;
+ lyxerr << bformat(lyx::to_utf8(_("LyX: Attempting to save document %1$s")), doc) << endl;
// We try to save three places:
// 1) Same place as document. Unless it is an unnamed doc.
lyxerr << " " << s << endl;
if (buf->writeFile(s)) {
buf->markClean();
- lyxerr << _(" Save seems successful. Phew.") << endl;
+ lyxerr << lyx::to_utf8(_(" Save seems successful. Phew.")) << endl;
return;
} else {
- lyxerr << _(" Save failed! Trying...") << endl;
+ lyxerr << lyx::to_utf8(_(" Save failed! Trying...")) << endl;
}
}
lyxerr << ' ' << s << endl;
if (buf->writeFile(s)) {
buf->markClean();
- lyxerr << _(" Save seems successful. Phew.") << endl;
+ lyxerr << lyx::to_utf8(_(" Save seems successful. Phew.")) << endl;
return;
}
- lyxerr << _(" Save failed! Trying...") << endl;
+ lyxerr << lyx::to_utf8(_(" Save failed! Trying...")) << endl;
// 3) In "/tmp" directory.
// MakeAbsPath to prepend the current
lyxerr << ' ' << s << endl;
if (buf->writeFile(s)) {
buf->markClean();
- lyxerr << _(" Save seems successful. Phew.") << endl;
+ lyxerr << lyx::to_utf8(_(" Save seems successful. Phew.")) << endl;
return;
}
- lyxerr << _(" Save failed! Bummer. Document is lost.") << endl;
+ lyxerr << lyx::to_utf8(_(" Save failed! Bummer. Document is lost.")) << endl;
}
pp = textclasslist.addTextClass(classname, filepath);
if (pp.first) {
textclass = pp.second;
- } else {
+ } else {
textclass = 0;
return classname;
- }
+ }
}
// FIXME: isTeXClassAvailable will try to load the layout file, but will
// fail because of the lack of path info. Warnings will be given although
// the layout file will be correctly loaded later.
if (!getLyXTextClass().isTeXClassAvailable()) {
string const msg =
- bformat(_("The document uses a missing "
- "TeX class \"%1$s\".\n"), classname);
- Alert::warning(_("Document class not available"),
- msg + _("LyX will not be able to produce output."));
+ bformat(lyx::to_utf8(_("The document uses a missing "
+ "TeX class \"%1$s\".\n")), classname);
+ Alert::warning(lyx::to_utf8(_("Document class not available")),
+ msg + lyx::to_utf8(_("LyX will not be able to produce output.")));
}
} else if (token == "\\begin_preamble") {
readPreamble(lex);
// end of \documentclass defs
// font selection must be done before loading fontenc.sty
- string const fonts =
+ string const fonts =
loadFonts(features, fontsRoman, fontsSans,
fontsTypewriter, fontsSC, fontsOSF,
fontsSansScale, fontsTypewriterScale);
texrow.newline();
}
if (fontsDefaultFamily != "default")
- os << "\\renewcommand{\\familydefault}{\\"
+ os << "\\renewcommand{\\familydefault}{\\"
<< fontsDefaultFamily << "}\n";
// this one is not per buffer
if (lyxrc.fontenc != "default") {
{
LCursor tmpcur = bv->cursor();
if (!findInset(tmpcur, codes, same_content)) {
- bv->cursor().message(_("No more insets"));
+ bv->cursor().message(lyx::to_utf8(_("No more insets")));
return;
}
return true;
}
}
- Alert::error(_("Cannot convert file"),
- bformat(_("No information for converting %1$s "
- "format files to %2$s.\n"
- "Define a convertor in the preferences."),
+ Alert::error(lyx::to_utf8(_("Cannot convert file")),
+ bformat(lyx::to_utf8(_("No information for converting %1$s "
+ "format files to %2$s.\n"
+ "Define a convertor in the preferences.")),
from_format, to_format));
return false;
}
lyxerr[Debug::FILES] << "Calling " << command << endl;
if (buffer)
- buffer->message(_("Executing command: ")
+ buffer->message(lyx::to_utf8(_("Executing command: "))
+ command);
Systemcall::Starttype const type = (dummy)
if (res) {
if (conv.to == "program") {
- Alert::error(_("Build errors"),
- _("There were errors during the build process."));
+ Alert::error(lyx::to_utf8(_("Build errors")),
+ lyx::to_utf8(_("There were errors during the build process.")));
} else {
// FIXME: this should go out of here. For example, here we cannot say if
// it is a document (.lyx) or something else. Same goes for elsewhere.
- Alert::error(_("Cannot convert file"),
- bformat(_("An error occurred whilst running %1$s"),
+ Alert::error(lyx::to_utf8(_("Cannot convert file")),
+ bformat(lyx::to_utf8(_("An error occurred whilst running %1$s")),
command.substr(0, 50)));
}
return false;
token_base, to_base);
Mover const & mover = movers(conv.from);
if (!mover.rename(from, to)) {
- Alert::error(_("Cannot convert file"),
- bformat(_("Could not move a temporary file from %1$s to %2$s."),
+ Alert::error(lyx::to_utf8(_("Cannot convert file")),
+ bformat(lyx::to_utf8(_("Could not move a temporary file from %1$s to %2$s.")),
from, to));
return false;
}
? mover.copy(from2, to2)
: mover.rename(from2, to2);
if (!moved && no_errors) {
- Alert::error(_("Cannot convert file"),
+ Alert::error(lyx::to_utf8(_("Cannot convert file")),
bformat(copy ?
- _("Could not copy a temporary file from %1$s to %2$s.") :
- _("Could not move a temporary file from %1$s to %2$s."),
+ lyx::to_utf8(_("Could not copy a temporary file from %1$s to %2$s.")) :
+ lyx::to_utf8(_("Could not move a temporary file from %1$s to %2$s.")),
from2, to2));
no_errors = false;
}
OutputParams const & runparams, ErrorList & errorList)
{
buffer.busy(true);
- buffer.message(_("Running LaTeX..."));
+ buffer.message(lyx::to_utf8(_("Running LaTeX...")));
runparams.document_language = buffer.params().language->babel();
// check return value from latex.run().
if ((result & LaTeX::NO_LOGFILE)) {
string const str =
- bformat(_("LaTeX did not run successfully. "
- "Additionally, LyX could not locate "
- "the LaTeX log %1$s."), name);
- Alert::error(_("LaTeX failed"), str);
+ bformat(lyx::to_utf8(_("LaTeX did not run successfully. "
+ "Additionally, LyX could not locate "
+ "the LaTeX log %1$s.")), name);
+ Alert::error(lyx::to_utf8(_("LaTeX failed")), str);
} else if (result & LaTeX::NO_OUTPUT) {
- Alert::warning(_("Output is empty"),
- _("An empty output file was generated."));
+ Alert::warning(lyx::to_utf8(_("Output is empty")),
+ lyx::to_utf8(_("An empty output file was generated.")));
}
if (errorTags[i].level != Debug::ANY
&& errorTags[i].level != Debug::NONE
&& errorTags[i].level & level) {
- // avoid _(...) re-entrance problem
- string const s = _(errorTags[i].desc);
- os << bformat(_("Debugging `%1$s' (%2$s)"),
+ // avoid lyx::to_utf8(_(...)) re-entrance problem
+ string const s = lyx::to_utf8(_(errorTags[i].desc));
+ os << bformat(lyx::to_utf8(_("Debugging `%1$s' (%2$s)")),
errorTags[i].name, s)
<< '\n';
}
for (int i = 0; i < numErrorTags ; ++i)
os << setw(7) << static_cast<unsigned int>(errorTags[i].level)
<< setw(10) << errorTags[i].name
- << " " << _(errorTags[i].desc) << '\n';
+ << " " << lyx::to_utf8(_(errorTags[i].desc)) << '\n';
os.flush();
}
int checkOverwrite(string const & filename)
{
if (fs::exists(filename)) {
- string text = bformat(_("The file %1$s already exists.\n\n"
- "Do you want to over-write that file?"),
+ string text = bformat(lyx::to_utf8(_("The file %1$s already exists.\n\n"
+ "Do you want to over-write that file?")),
makeDisplayPath(filename));
- return Alert::prompt(_("Over-write file?"),
+ return Alert::prompt(lyx::to_utf8(_("Over-write file?")),
text, 0, 2,
- _("&Over-write"), _("Over-write &all"),
- _("&Cancel export"));
+ lyx::to_utf8(_("&Over-write")), lyx::to_utf8(_("Over-write &all")),
+ lyx::to_utf8(_("&Cancel export")));
}
return 0;
}
Mover const & mover = movers(format);
if (!mover.copy(sourceFile, destFile, latexFile))
- Alert::error(_("Couldn't copy file"),
- bformat(_("Copying %1$s to %2$s failed."),
+ Alert::error(lyx::to_utf8(_("Couldn't copy file")),
+ bformat(lyx::to_utf8(_("Copying %1$s to %2$s failed.")),
makeDisplayPath(sourceFile),
makeDisplayPath(destFile)));
}
}
if (backend_format.empty()) {
- Alert::error(_("Couldn't export file"),
- bformat(_("No information for exporting the format %1$s."),
+ Alert::error(lyx::to_utf8(_("Couldn't export file")),
+ bformat(lyx::to_utf8(_("No information for exporting the format %1$s.")),
formats.prettyName(format)));
return false;
}
buffer->makeLaTeXFile(filename, string(), runparams);
} else if (!lyxrc.tex_allows_spaces
&& contains(buffer->filePath(), ' ')) {
- Alert::error(_("File name error"),
- _("The directory path to the document cannot contain spaces."));
+ Alert::error(lyx::to_utf8(_("File name error")),
+ lyx::to_utf8(_("The directory path to the document cannot contain spaces.")));
return false;
} else {
runparams.nice = false;
it->exportName, status == FORCE);
}
if (status == CANCEL) {
- buffer->message(_("Document export cancelled."));
+ buffer->message(lyx::to_utf8(_("Document export cancelled.")));
} else if (fs::exists(tmp_result_file)) {
// Finally copy the main file
status = copyFile(format, tmp_result_file,
result_file, result_file,
status == FORCE);
- buffer->message(bformat(_("Document exported as %1$s "
- "to file `%2$s'"),
+ buffer->message(bformat(lyx::to_utf8(_("Document exported as %1$s "
+ "to file `%2$s'")),
formats.prettyName(format),
makeDisplayPath(result_file)));
} else {
// This must be a dummy converter like fax (bug 1888)
- buffer->message(bformat(_("Document exported as %1$s"),
+ buffer->message(bformat(lyx::to_utf8(_("Document exported as %1$s")),
formats.prettyName(format)));
}
}
Format::Format(string const & n, string const & e, string const & p,
string const & s, string const & v, string const & ed,
- bool d)
+ bool d)
: name_(n), extension_(e), prettyname_(p), shortcut_(s), viewer_(v),
editor_(ed), document_(d)
{}
namespace {
-string fixCommand(string const & cmd, string const & ext,
+string fixCommand(string const & cmd, string const & ext,
os::auto_open_mode mode)
{
// configure.py says we do not want a viewer/editor
if (it == formatlist.end())
formatlist.push_back(Format(name, extension, prettyname,
shortcut, viewer, editor,
- document));
+ document));
else
*it = Format(name, extension, prettyname, shortcut, viewer,
- editor, document);
+ editor, document);
}
{
BOOST_ASSERT(absolutePath(filename));
if (filename.empty() || !fs::exists(filename)) {
- Alert::error(_("Cannot view file"),
- bformat(_("File does not exist: %1$s"),
+ Alert::error(lyx::to_utf8(_("Cannot view file")),
+ bformat(lyx::to_utf8(_("File does not exist: %1$s")),
filename));
return false;
}
if (!format || format->viewer().empty()) {
// FIXME: I believe this is the wrong place to show alerts, it should be done
// by the caller (this should be "utility" code)
- Alert::error(_("Cannot view file"),
- bformat(_("No information for viewing %1$s"),
+ Alert::error(lyx::to_utf8(_("Cannot view file")),
+ bformat(lyx::to_utf8(_("No information for viewing %1$s")),
prettyName(format_name)));
return false;
}
if (os::autoOpenFile(filename, os::VIEW))
return true;
else {
- Alert::error(_("Cannot view file"),
- bformat(_("Auto-view file %1$s failed"),
+ Alert::error(lyx::to_utf8(_("Cannot view file")),
+ bformat(lyx::to_utf8(_("Auto-view file %1$s failed")),
filename));
return false;
}
command = subst(command, token_path, quoteName(onlyPath(filename)));
command = subst(command, token_socket, quoteName(lyxsocket->address()));
lyxerr[Debug::FILES] << "Executing command: " << command << std::endl;
- buffer.message(_("Executing command: ") + command);
+ buffer.message(lyx::to_utf8(_("Executing command: ")) + command);
Systemcall one;
int const res = one.startscript(Systemcall::DontWait, command);
if (res) {
- Alert::error(_("Cannot view file"),
- bformat(_("An error occurred whilst running %1$s"),
+ Alert::error(lyx::to_utf8(_("Cannot view file")),
+ bformat(lyx::to_utf8(_("An error occurred whilst running %1$s")),
makeDisplayPath(command, 50)));
return false;
}
{
BOOST_ASSERT(absolutePath(filename));
if (filename.empty() || !fs::exists(filename)) {
- Alert::error(_("Cannot edit file"),
- bformat(_("File does not exist: %1$s"),
+ Alert::error(lyx::to_utf8(_("Cannot edit file")),
+ bformat(lyx::to_utf8(_("File does not exist: %1$s")),
filename));
return false;
}
if (!format || format->editor().empty()) {
// FIXME: I believe this is the wrong place to show alerts, it should
// be done by the caller (this should be "utility" code)
- Alert::error(_("Cannot edit file"),
- bformat(_("No information for editing %1$s"),
+ Alert::error(lyx::to_utf8(_("Cannot edit file")),
+ bformat(lyx::to_utf8(_("No information for editing %1$s")),
prettyName(format_name)));
return false;
}
if (os::autoOpenFile(filename, os::EDIT))
return true;
else {
- Alert::error(_("Cannot edit file"),
- bformat(_("Auto-edit file %1$s failed"),
+ Alert::error(lyx::to_utf8(_("Cannot edit file")),
+ bformat(lyx::to_utf8(_("Auto-edit file %1$s failed")),
filename));
return false;
}
command = subst(command, token_path, quoteName(onlyPath(filename)));
command = subst(command, token_socket, quoteName(lyxsocket->address()));
lyxerr[Debug::FILES] << "Executing command: " << command << std::endl;
- buffer.message(_("Executing command: ") + command);
+ buffer.message(lyx::to_utf8(_("Executing command: ")) + command);
Systemcall one;
int const res = one.startscript(Systemcall::DontWait, command);
if (res) {
- Alert::error(_("Cannot edit file"),
- bformat(_("An error occurred whilst running %1$s"),
+ Alert::error(lyx::to_utf8(_("Cannot edit file")),
+ bformat(lyx::to_utf8(_("An error occurred whilst running %1$s")),
makeDisplayPath(command, 50)));
return false;
}
maximize_title += ": " + makeDisplayPath(cur_title, 30);
minimize_title = onlyFilename(cur_title);
if (!buffer()->isClean()) {
- maximize_title += _(" (changed)");
+ maximize_title += lyx::to_utf8(_(" (changed)"));
minimize_title += '*';
}
if (buffer()->isReadonly())
- maximize_title += _(" (read only)");
+ maximize_title += lyx::to_utf8(_(" (read only)"));
}
}
LyXTextClass::const_iterator const end = tc.end();
for (; it != end; ++it) {
string const & itname = (*it)->name();
- // Yes, the _() is correct
- if (_(itname) == name) {
+ // Yes, the lyx::to_utf8(_()) is correct
+ if (lyx::to_utf8(_(itname)) == name) {
FuncRequest const func(LFUN_LAYOUT, itname,
FuncRequest::UI);
lv.getLyXFunc().dispatch(func);
void WorkArea::resizeBufferView()
{
lyx_view_.busy(true);
- lyx_view_.message(_("Formatting document..."));
+ lyx_view_.message(lyx::to_utf8(_("Formatting document...")));
buffer_view_->workAreaResize(width(), height());
lyx_view_.updateLayoutChoice();
redraw();
}
if (!found) {
- ss << _("ERROR: LyX wasn't able to read CREDITS file\n")
- << _("Please install correctly to estimate the great\n")
- << _("amount of work other people have done for the LyX project.");
+ ss << lyx::to_utf8(_("ERROR: LyX wasn't able to read CREDITS file\n"))
+ << lyx::to_utf8(_("Please install correctly to estimate the great\n"))
+ << lyx::to_utf8(_("amount of work other people have done for the LyX project."));
}
}
string const ControlAboutlyx::getCopyright() const
{
- return _("LyX is Copyright (C) 1995 by Matthias Ettrich,\n1995-2001 LyX Team");
+ return lyx::to_utf8(_("LyX is Copyright (C) 1995 by Matthias Ettrich,\n1995-2001 LyX Team"));
}
string const ControlAboutlyx::getLicense() const
{
- return _("This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.");
+ return lyx::to_utf8(_("This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version."));
}
string const ControlAboutlyx::getDisclaimer() const
{
- return _("LyX is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\nSee the GNU General Public License for more details.\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.");
+ return lyx::to_utf8(_("LyX is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\nSee the GNU General Public License for more details.\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA."));
}
{
ostringstream ss;
- ss << _("LyX Version ")
+ ss << lyx::to_utf8(_("LyX Version "))
<< lyx_version
<< " ("
<< lyx_release_date
<< ")\n"
- << _("Library directory: ")
+ << lyx::to_utf8(_("Library directory: "))
<< makeDisplayPath(package().system_support())
<< "\n"
- << _("User directory: ")
+ << lyx::to_utf8(_("User directory: "))
<< makeDisplayPath(package().user_support());
return ss.str();
string const ControlBibtex::browseBib(string const & in_name) const
{
- pair<string, string> dir1(_("Documents|#o#O"),
+ // FIXME UNICODE
+ pair<string, string> dir1(lyx::to_utf8(_("Documents|#o#O")),
string(lyxrc.document_path));
- FileFilterList const filter(_("BibTeX Databases (*.bib)"));
+ FileFilterList const filter(lyx::to_utf8(_("BibTeX Databases (*.bib)")));
return browseRelFile(in_name, kernel().bufferFilepath(),
- _("Select a BibTeX database to add"),
+ lyx::to_utf8(_("Select a BibTeX database to add")),
filter, false, dir1);
}
string const ControlBibtex::browseBst(string const & in_name) const
{
- pair<string, string> dir1(_("Documents|#o#O"),
+ // FIXME UNICODE
+ pair<string, string> dir1(lyx::to_utf8(_("Documents|#o#O")),
string(lyxrc.document_path));
- FileFilterList const filter(_("BibTeX Styles (*.bst)"));
+ FileFilterList const filter(lyx::to_utf8(_("BibTeX Styles (*.bst)")));
return browseRelFile(in_name, kernel().bufferFilepath(),
- _("Select a BibTeX style"), filter, false, dir1);
+ lyx::to_utf8(_("Select a BibTeX style")), filter, false, dir1);
}
size_t const ids_size = sizeof(ids_) / sizeof(char *);
ids = vector<string>(ids_, ids_ + ids_size);
gui_names.clear();
- gui_names.push_back(_("No frame drawn"));
- gui_names.push_back(_("Rectangular box"));
- gui_names.push_back(_("Oval box, thin"));
- gui_names.push_back(_("Oval box, thick"));
- gui_names.push_back(_("Shadow box"));
- gui_names.push_back(_("Double box"));
+ // FIXME UNICODE
+ gui_names.push_back(lyx::to_utf8(_("No frame drawn")));
+ gui_names.push_back(lyx::to_utf8(_("Rectangular box")));
+ gui_names.push_back(lyx::to_utf8(_("Oval box, thin")));
+ gui_names.push_back(lyx::to_utf8(_("Oval box, thick")));
+ gui_names.push_back(lyx::to_utf8(_("Shadow box")));
+ gui_names.push_back(lyx::to_utf8(_("Double box")));
}
void box_gui_tokens_special_length(vector<string> & ids,
size_t const ids_size = sizeof(ids_) / sizeof(char *);
ids = vector<string>(ids_, ids_ + ids_size);
gui_names.clear();
- gui_names.push_back(_("None"));
- gui_names.push_back(_("Height"));
- gui_names.push_back(_("Depth"));
- gui_names.push_back(_("Total Height"));
- gui_names.push_back(_("Width"));
+ // FIXME UNICODE
+ gui_names.push_back(lyx::to_utf8(_("None")));
+ gui_names.push_back(lyx::to_utf8(_("Height")));
+ gui_names.push_back(lyx::to_utf8(_("Depth")));
+ gui_names.push_back(lyx::to_utf8(_("Total Height")));
+ gui_names.push_back(lyx::to_utf8(_("Width")));
}
} // namespace frontend
bool ControlErrorList::initialiseParams(string const & error_type)
{
Buffer * buf = kernel().bufferview()->buffer();
- string const title = bformat(_("%1$s Errors (%2$s)"),
- _(error_type), buf->fileName());
+ // FIXME UNICODE
+ string const title = bformat(lyx::to_utf8(_("%1$s Errors (%2$s)")),
+ lyx::to_utf8(_(error_type)),
+ buf->fileName());
errorlist_ = buf->errorList(error_type);
name_ = title;
return true;
string const ControlExternal::browse(string const & input,
string const & template_name) const
{
- string const title = _("Select external file");
+ string const title = lyx::to_utf8(_("Select external file"));
string const bufpath = kernel().bufferFilepath();
FileFilterList const filter =
string const origin_gui_str(size_type i)
{
- return _(origin_gui_strs[i]);
+ return lyx::to_utf8(_(origin_gui_strs[i]));
}
} // namespace external
string const ControlGraphics::browse(string const & in_name) const
{
- string const title = _("Select graphics file");
+ // FIXME UNICODE
+ string const title = lyx::to_utf8(_("Select graphics file"));
// Does user clipart directory exist?
string clipdir = addName(package().user_support(), "clipart");
if (!(fs::exists(clipdir) && fs::is_directory(clipdir)))
// No - bail out to system clipart directory
clipdir = addName(package().system_support(), "clipart");
- pair<string, string> dir1(_("Clipart|#C#c"), clipdir);
- pair<string, string> dir2(_("Documents|#o#O"), string(lyxrc.document_path));
+ pair<string, string> dir1(lyx::to_utf8(_("Clipart|#C#c")), clipdir);
+ pair<string, string> dir2(lyx::to_utf8(_("Documents|#o#O")), string(lyxrc.document_path));
// Show the file browser dialog
return browseRelFile(in_name, kernel().bufferFilepath(),
title,
data.resize(rorigin_size);
for (size_type i = 0; i < rorigin_size; ++i) {
- data[i] = make_pair(_(rorigin_gui_strs[i]),
+ // FIXME UNICODE
+ data[i] = make_pair(lyx::to_utf8(_(rorigin_gui_strs[i])),
rorigin_lyx_strs[i]);
}
string const ControlInclude::browse(string const & in_name, Type in_type) const
{
- string const title = _("Select document to include");
+ // FIXME UNICODE
+ string const title = lyx::to_utf8(_("Select document to include"));
// input TeX, verbatim, or LyX file ?
FileFilterList filters;
switch (in_type) {
case INCLUDE:
case INPUT:
- filters = FileFilterList(_("LaTeX/LyX Documents (*.tex *.lyx)"));
- break;
+ // FIXME UNICODE
+ filters = FileFilterList(lyx::to_utf8(_("LaTeX/LyX Documents (*.tex *.lyx)")));
+ break;
case VERBATIM:
- break;
+ break;
}
pair<string, string> dir1(N_("Documents|#o#O"),
string t;
switch (type_) {
case LatexLog:
- t = _("LaTeX Log");
+ t = lyx::to_utf8(_("LaTeX Log"));
break;
case LiterateLog:
- t = _("Literate Programming Build Log");
+ t = lyx::to_utf8(_("Literate Programming Build Log"));
break;
case Lyx2lyxLog:
- t = _("lyx2lyx Error Log");
+ t = lyx::to_utf8(_("lyx2lyx Error Log"));
break;
case VCLog:
- t = _("Version Control Log");
+ t = lyx::to_utf8(_("Version Control Log"));
break;
}
return t;
switch (type_) {
case LatexLog:
- ss << _("No LaTeX log file found.");
+ ss << lyx::to_utf8(_("No LaTeX log file found."));
break;
case LiterateLog:
- ss << _("No literate programming build log file found.");
+ ss << lyx::to_utf8(_("No literate programming build log file found."));
break;
case Lyx2lyxLog:
- ss << _("No lyx2lyx error log file found.");
+ ss << lyx::to_utf8(_("No lyx2lyx error log file found."));
break;
case VCLog:
- ss << _("No version control log file found.");
+ ss << lyx::to_utf8(_("No version control log file found."));
break;
}
}
string const ControlPrefs::browsebind(string const & file) const
{
- return browseLibFile("bind", file, "bind", _("Choose bind file"),
- FileFilterList(_("LyX bind files (*.bind)")));
+ // FIXME UNICODE
+ return browseLibFile("bind", file, "bind",
+ lyx::to_utf8(_("Choose bind file")),
+ FileFilterList(lyx::to_utf8(_("LyX bind files (*.bind)"))));
}
string const ControlPrefs::browseUI(string const & file) const
{
- return browseLibFile("ui", file, "ui", _("Choose UI file"),
- FileFilterList(_("LyX UI files (*.ui)")));
+ // FIXME UNICODE
+ return browseLibFile("ui", file, "ui",
+ lyx::to_utf8(_("Choose UI file")),
+ FileFilterList(lyx::to_utf8(_("LyX UI files (*.ui)"))));
}
string const ControlPrefs::browsekbmap(string const & file) const
{
- return browseLibFile("kbd", file, "kmap", _("Choose keyboard map"),
- FileFilterList(_("LyX keyboard maps (*.kmap)")));
+ // FIXME UNICODE
+ return browseLibFile("kbd", file, "kmap",
+ lyx::to_utf8(_("Choose keyboard map")),
+ FileFilterList(lyx::to_utf8(_("LyX keyboard maps (*.kmap)"))));
}
string const ControlPrefs::browsedict(string const & file) const
{
- return browseFile(file, _("Choose personal dictionary"),
- FileFilterList(_("*.ispell")));
+ // FIXME UNICODE
+ return browseFile(file,
+ lyx::to_utf8(_("Choose personal dictionary")),
+ FileFilterList(lyx::to_utf8(_("*.ispell"))));
}
string const ControlPrint::browse(string const & in_name) const
{
+ // FIXME UNICODE
return browseRelFile(in_name, kernel().buffer().filePath(),
- _("Print to file"),
- FileFilterList(_("PostScript files (*.ps)")),
+ lyx::to_utf8(_("Print to file")),
+ FileFilterList(lyx::to_utf8(_("PostScript files (*.ps)"))),
true);
}
bool const success = speller_->error().empty();
if (!success) {
- Alert::error(_("Spellchecker error"),
- _("The spellchecker could not be started\n")
+ // FIXME UNICODE
+ Alert::error(lyx::to_utf8(_("Spellchecker error")),
+ lyx::to_utf8(_("The spellchecker could not be started\n"))
+ speller_->error());
speller_.reset(0);
}
return true;
string message;
+ // FIXME UNICODE
if (speller_->error().empty())
- message = _("The spellchecker has died for some reason.\n"
- "Maybe it has been killed.");
+ message = lyx::to_utf8(_("The spellchecker has died for some reason.\n"
+ "Maybe it has been killed."));
else
- message = _("The spellchecker has failed.\n")
+ message = lyx::to_utf8(_("The spellchecker has failed.\n"))
+ speller_->error();
dialog().CancelButton();
- Alert::error(_("The spellchecker has failed"), message);
+ Alert::error(lyx::to_utf8(_("The spellchecker has failed")), message);
return false;
}
}
string message;
+ // FIXME UNICODE
if (count_ != 1)
- message = bformat(_("%1$d words checked."), count_);
+ message = bformat(lyx::to_utf8(_("%1$d words checked.")), count_);
else
- message = _("One word checked.");
+ message = lyx::to_utf8(_("One word checked."));
dialog().CancelButton();
- Alert::information(_("Spelling check completed"), message);
+ Alert::information(lyx::to_utf8(_("Spelling check completed")), message);
}
string const ControlToc::getGuiName(string const & type) const
{
if (type == "TOC")
- return _("Table of Contents");
+ return lyx::to_utf8(_("Table of Contents"));
else
- return _(toc::getGuiName(type, kernel().buffer()));
+ return lyx::to_utf8(_(toc::getGuiName(type, kernel().buffer())));
}
default:
BOOST_ASSERT(false);
}
- return _(source_type + " Source");
+ return lyx::to_utf8(_(source_type + " Source"));
}
} // namespace frontend
return author;
if (authors.size() == 2)
- return bformat(_("%1$s and %2$s"),
+ // FIXME UNICODE
+ return bformat(lyx::to_utf8(_("%1$s and %2$s")),
familyName(authors[0]), familyName(authors[1]));
if (authors.size() > 2)
- return bformat(_("%1$s et al."), familyName(authors[0]));
+ // FIXME UNICODE
+ return bformat(lyx::to_utf8(_("%1$s et al.")), familyName(authors[0]));
return familyName(authors[0]);
}
string year = parseBibTeX(data, "year");
if (year.empty())
- year = _("No year");
+ year = lyx::to_utf8(_("No year"));
return year;
}
case CITE:
// jurabib only: Author/Annotator
// (i.e. the "before" field, 2nd opt arg)
- str = author + "/<" + _("before") + '>';
+ str = author + "/<" + lyx::to_utf8(_("before")) + '>';
break;
case CITET:
FamilyPair pr;
- pr.first = _("No change");
+ pr.first = lyx::to_utf8(_("No change"));
pr.second = LyXFont::IGNORE_FAMILY;
family[0] = pr;
- pr.first = _("Roman");
+ pr.first = lyx::to_utf8(_("Roman"));
pr.second = LyXFont::ROMAN_FAMILY;
family[1] = pr;
- pr.first = _("Sans Serif");
+ pr.first = lyx::to_utf8(_("Sans Serif"));
pr.second = LyXFont::SANS_FAMILY;
family[2] = pr;
- pr.first = _("Typewriter");
+ pr.first = lyx::to_utf8(_("Typewriter"));
pr.second = LyXFont::TYPEWRITER_FAMILY;
family[3] = pr;
- pr.first = _("Reset");
+ pr.first = lyx::to_utf8(_("Reset"));
pr.second = LyXFont::INHERIT_FAMILY;
family[4] = pr;
SeriesPair pr;
- pr.first = _("No change");
+ pr.first = lyx::to_utf8(_("No change"));
pr.second = LyXFont::IGNORE_SERIES;
series[0] = pr;
- pr.first = _("Medium");
+ pr.first = lyx::to_utf8(_("Medium"));
pr.second = LyXFont::MEDIUM_SERIES;
series[1] = pr;
- pr.first = _("Bold");
+ pr.first = lyx::to_utf8(_("Bold"));
pr.second = LyXFont::BOLD_SERIES;
series[2] = pr;
- pr.first = _("Reset");
+ pr.first = lyx::to_utf8(_("Reset"));
pr.second = LyXFont::INHERIT_SERIES;
series[3] = pr;
ShapePair pr;
- pr.first = _("No change");
+ pr.first = lyx::to_utf8(_("No change"));
pr.second = LyXFont::IGNORE_SHAPE;
shape[0] = pr;
- pr.first = _("Upright");
+ pr.first = lyx::to_utf8(_("Upright"));
pr.second = LyXFont::UP_SHAPE;
shape[1] = pr;
- pr.first = _("Italic");
+ pr.first = lyx::to_utf8(_("Italic"));
pr.second = LyXFont::ITALIC_SHAPE;
shape[2] = pr;
- pr.first = _("Slanted");
+ pr.first = lyx::to_utf8(_("Slanted"));
pr.second = LyXFont::SLANTED_SHAPE;
shape[3] = pr;
- pr.first = _("Small Caps");
+ pr.first = lyx::to_utf8(_("Small Caps"));
pr.second = LyXFont::SMALLCAPS_SHAPE;
shape[4] = pr;
- pr.first = _("Reset");
+ pr.first = lyx::to_utf8(_("Reset"));
pr.second = LyXFont::INHERIT_SHAPE;
shape[5] = pr;
SizePair pr;
- pr.first = _("No change");
+ pr.first = lyx::to_utf8(_("No change"));
pr.second = LyXFont::IGNORE_SIZE;
size[0] = pr;
- pr.first = _("Tiny");
+ pr.first = lyx::to_utf8(_("Tiny"));
pr.second = LyXFont::SIZE_TINY;
size[1] = pr;
- pr.first = _("Smallest");
+ pr.first = lyx::to_utf8(_("Smallest"));
pr.second = LyXFont::SIZE_SCRIPT;
size[2] = pr;
- pr.first = _("Smaller");
+ pr.first = lyx::to_utf8(_("Smaller"));
pr.second = LyXFont::SIZE_FOOTNOTE;
size[3] = pr;
- pr.first = _("Small");
+ pr.first = lyx::to_utf8(_("Small"));
pr.second = LyXFont::SIZE_SMALL;
size[4] = pr;
- pr.first = _("Normal");
+ pr.first = lyx::to_utf8(_("Normal"));
pr.second = LyXFont::SIZE_NORMAL;
size[5] = pr;
- pr.first = _("Large");
+ pr.first = lyx::to_utf8(_("Large"));
pr.second = LyXFont::SIZE_LARGE;
size[6] = pr;
- pr.first = _("Larger");
+ pr.first = lyx::to_utf8(_("Larger"));
pr.second = LyXFont::SIZE_LARGER;
size[7] = pr;
- pr.first = _("Largest");
+ pr.first = lyx::to_utf8(_("Largest"));
pr.second = LyXFont::SIZE_LARGEST;
size[8] = pr;
- pr.first = _("Huge");
+ pr.first = lyx::to_utf8(_("Huge"));
pr.second = LyXFont::SIZE_HUGE;
size[9] = pr;
- pr.first = _("Huger");
+ pr.first = lyx::to_utf8(_("Huger"));
pr.second = LyXFont::SIZE_HUGER;
size[10] = pr;
- pr.first = _("Increase");
+ pr.first = lyx::to_utf8(_("Increase"));
pr.second = LyXFont::INCREASE_SIZE;
size[11] = pr;
- pr.first = _("Decrease");
+ pr.first = lyx::to_utf8(_("Decrease"));
pr.second = LyXFont::DECREASE_SIZE;
size[12] = pr;
- pr.first = _("Reset");
+ pr.first = lyx::to_utf8(_("Reset"));
pr.second = LyXFont::INHERIT_SIZE;
size[13] = pr;
BarPair pr;
- pr.first = _("No change");
+ pr.first = lyx::to_utf8(_("No change"));
pr.second = IGNORE;
bar[0] = pr;
- pr.first = _("Emph");
+ pr.first = lyx::to_utf8(_("Emph"));
pr.second = EMPH_TOGGLE;
bar[1] = pr;
- pr.first = _("Underbar");
+ pr.first = lyx::to_utf8(_("Underbar"));
pr.second = UNDERBAR_TOGGLE;
bar[2] = pr;
- pr.first = _("Noun");
+ pr.first = lyx::to_utf8(_("Noun"));
pr.second = NOUN_TOGGLE;
bar[3] = pr;
- pr.first = _("Reset");
+ pr.first = lyx::to_utf8(_("Reset"));
pr.second = INHERIT;
bar[4] = pr;
ColorPair pr;
- pr.first = _("No change");
+ pr.first = lyx::to_utf8(_("No change"));
pr.second = LColor::ignore;
color[0] = pr;
- pr.first = _("No color");
+ pr.first = lyx::to_utf8(_("No color"));
pr.second = LColor::none;
color[1] = pr;
- pr.first = _("Black");
+ pr.first = lyx::to_utf8(_("Black"));
pr.second = LColor::black;
color[2] = pr;
- pr.first = _("White");
+ pr.first = lyx::to_utf8(_("White"));
pr.second = LColor::white;
color[3] = pr;
- pr.first = _("Red");
+ pr.first = lyx::to_utf8(_("Red"));
pr.second = LColor::red;
color[4] = pr;
- pr.first = _("Green");
+ pr.first = lyx::to_utf8(_("Green"));
pr.second = LColor::green;
color[5] = pr;
- pr.first = _("Blue");
+ pr.first = lyx::to_utf8(_("Blue"));
pr.second = LColor::blue;
color[6] = pr;
- pr.first = _("Cyan");
+ pr.first = lyx::to_utf8(_("Cyan"));
pr.second = LColor::cyan;
color[7] = pr;
- pr.first = _("Magenta");
+ pr.first = lyx::to_utf8(_("Magenta"));
pr.second = LColor::magenta;
color[8] = pr;
- pr.first = _("Yellow");
+ pr.first = lyx::to_utf8(_("Yellow"));
pr.second = LColor::yellow;
color[9] = pr;
- pr.first = _("Reset");
+ pr.first = lyx::to_utf8(_("Reset"));
pr.second = LColor::inherit;
color[10] = pr;
vector<LanguagePair> langs(size);
if (character_dlg) {
- langs[0].first = _("No change");
+ langs[0].first = lyx::to_utf8(_("No change"));
langs[0].second = "ignore";
- langs[1].first = _("Reset");
+ langs[1].first = lyx::to_utf8(_("Reset"));
langs[1].second = "reset";
}
vector<string>::size_type i = character_dlg ? 2 : 0;
for (Languages::const_iterator cit = languages.begin();
cit != languages.end(); ++cit) {
- langs[i].first = _(cit->second.display());
+ langs[i].first = lyx::to_utf8(_(cit->second.display()));
langs[i].second = cit->second.lang();
++i;
}
string const & title,
FileFilterList const & filters)
{
- pair<string,string> const dir1(_("System files|#S#s"),
+ // FIXME UNICODE
+ pair<string,string> const dir1(lyx::to_utf8(_("System files|#S#s")),
addName(package().system_support(), dir));
- pair<string,string> const dir2(_("User files|#U#u"),
+ pair<string,string> const dir2(lyx::to_utf8(_("User files|#U#u")),
addName(package().user_support(), dir));
string const result = browseFile(libFileSearch(dir, name, ext), title,
quoteName(command));
if (status == 0)
return;
- Alert::error(_("Could not update TeX information"),
- bformat(_("The script `%s' failed."), command));
+ // FIXME UNICODE
+ Alert::error(lyx::to_utf8(_("Could not update TeX information")),
+ bformat(lyx::to_utf8(_("The script `%s' failed.")), command));
}
} else if (name == "index") {
dialog->bc().view(new GBC(dialog->bc()));
dialog->setController(new ControlCommand(*dialog, name));
+ // FIXME UNICODE
dialog->setView(new GText(*dialog,
- _("Index Entry"), _("Keyword:|#K")));
+ lyx::to_utf8(_("Index Entry")),
+ lyx::to_utf8(_("Keyword:|#K"))));
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
} else if (name == "label") {
dialog->bc().view(new GBC(dialog->bc()));
dialog->setController(new ControlCommand(*dialog, name));
+ // FIXME UNICODE
dialog->setView(new GText(*dialog,
- _("Label"), _("Label:|#L")));
+ lyx::to_utf8(_("Label")),
+ lyx::to_utf8(_("Label:|#L"))));
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
} else if (name == "log") {
dialog->bc().view(new GBC(dialog->bc()));
} else if (name == "mathaccents") {
// FormMathsBitmap * bitmap =
-// createFormBitmap(*dialog, _("Maths Decorations & Accents"),
+// createFormBitmap(*dialog, lyx::to_utf8(_("Maths Decorations & Accents")),
// latex_deco, nr_latex_deco);
// bitmap->addBitmap(
// BitmapStore(12, 3, 4, deco1_width, deco1_height, deco1_bits, true));
} else if (name == "matharrows") {
// FormMathsBitmap * bitmap =
-// createFormBitmap(*dialog, _("Arrows"), latex_arrow, nr_latex_arrow);
+// createFormBitmap(*dialog, lyx::to_utf8(_("Arrows"), latex_arrow, nr_latex_arrow));
// bitmap->addBitmap(
// BitmapStore(20, 5, 4, arrow_width, arrow_height, arrow_bits, true));
// bitmap->addBitmap(
} else if (name == "mathoperators") {
// FormMathsBitmap * bitmap =
-// createFormBitmap(*dialog, _("Binary Ops"),
+// createFormBitmap(*dialog, lyx::to_utf8(_("Binary Ops")),
// latex_bop, nr_latex_bop);
// bitmap->addBitmap(
// BitmapStore(31, 4, 8, bop_width, bop_height, bop_bits, true));
} else if (name == "mathrelations") {
// FormMathsBitmap * bitmap =
-// createFormBitmap(*dialog, _("Binary Relations"),
+// createFormBitmap(*dialog, lyx::to_utf8(_("Binary Relations")),
// latex_brel, nr_latex_brel);
// bitmap->addBitmap(
// BitmapStore(35, 4, 9, brel_width, brel_height, brel_bits, true));
} else if (name == "mathgreek") {
// FormMathsBitmap * bitmap =
-// createFormBitmap(*dialog, _("Greek"),
+// createFormBitmap(*dialog, lyx::to_utf8(_("Greek")),
// latex_greek, nr_latex_greek);
// bitmap->addBitmap(
// BitmapStore(11, 6, 2, Greek_width, Greek_height, Greek_bits, true));
} else if (name == "mathmisc") {
// FormMathsBitmap * bitmap =
-// createFormBitmap(*dialog, _("Misc"),
+// createFormBitmap(*dialog, lyx::to_utf8(_("Misc")),
// latex_misc, nr_latex_misc);
// bitmap->addBitmap(
// BitmapStore(29, 5, 6, misc_width, misc_height, misc_bits, true));
} else if (name == "mathdots") {
// FormMathsBitmap * bitmap =
-// createFormBitmap(*dialog, _("Dots"),
+// createFormBitmap(*dialog, lyx::to_utf8(_("Dots")),
// latex_dots, nr_latex_dots);
// bitmap->addBitmap(
// BitmapStore(4, 4, 1, dots_width, dots_height, dots_bits, true));
} else if (name == "mathbigoperators") {
// FormMathsBitmap * bitmap =
-// createFormBitmap(*dialog, _("Big Operators"),
+// createFormBitmap(*dialog, lyx::to_utf8(_("Big Operators")),
// latex_varsz, nr_latex_varsz);
// bitmap->addBitmap(
// BitmapStore(14, 3, 5, varsz_width, varsz_height, varsz_bits, true));
} else if (name == "mathamsmisc") {
// FormMathsBitmap * bitmap =
-// createFormBitmap(*dialog, _("AMS Misc"),
+// createFormBitmap(*dialog, lyx::to_utf8(_("AMS Misc")),
// latex_ams_misc, nr_latex_ams_misc);
// bitmap->addBitmap(
// BitmapStore(9, 5, 2, ams1_width, ams1_height, ams1_bits, true));
} else if (name == "mathamsarrows") {
// FormMathsBitmap * bitmap =
-// createFormBitmap(*dialog, _("AMS Arrows"),
+// createFormBitmap(*dialog, lyx::to_utf8(_("AMS Arrows")),
// latex_ams_arrows, nr_latex_ams_arrows);
// bitmap->addBitmap(
// BitmapStore(32, 3, 11, ams2_width, ams2_height, ams2_bits, true));
} else if (name == "mathamsrelations") {
// FormMathsBitmap * bitmap =
-// createFormBitmap(*dialog, _("AMS Relations"),
+// createFormBitmap(*dialog, lyx::to_utf8(_("AMS Relations")),
// latex_ams_rel, nr_latex_ams_rel);
// bitmap->addBitmap(
// BitmapStore(66, 6, 11, ams_rel_width, ams_rel_height, ams_rel_bits, true));
} else if (name == "mathamsnegatedrelations") {
// FormMathsBitmap * bitmap =
-// createFormBitmap(*dialog, _("AMS Negated Rel"),
+// createFormBitmap(*dialog, lyx::to_utf8(_("AMS Negated Rel")),
// latex_ams_nrel, nr_latex_ams_nrel);
// bitmap->addBitmap(
// BitmapStore(51, 6, 9, ams_nrel_width, ams_nrel_height, ams_nrel_bits, true));
} else if (name == "mathamsoperators") {
// FormMathsBitmap * bitmap =
-// createFormBitmap(*dialog, _("AMS Operators"),
+// createFormBitmap(*dialog, lyx::to_utf8(_("AMS Operators")),
// latex_ams_ops, nr_latex_ams_ops);
// bitmap->addBitmap(
// BitmapStore(23, 3, 8, ams_ops_width, ams_ops_height, ams_ops_bits, true));
button->hide();
}
+ // FIXME UNICODE
Gtk::Button &authorbutton = *Gtk::manage(
- new Gtk::Button(_("C_redits"), true));
+ new Gtk::Button(lyx::to_utf8(_("C_redits")), true));
authorbutton.set_image(*Gtk::manage(
new Gtk::Image(Gtk::Stock::ABOUT, Gtk::ICON_SIZE_BUTTON)));
dialog->get_action_area()->pack_end(authorbutton);
class GBC : public GuiBC<Gtk::Button, Gtk::Widget> {
public:
GBC(ButtonController const & parent,
- std::string const & cancel = _("Cancel"),
- std::string const & close = _("Close"));
+ std::string const & cancel = lyx::to_utf8(_("Cancel")),
+ std::string const & close = lyx::to_utf8(_("Close")));
private:
/// Updates the button sensitivity (enabled/disabled)
void setButtonEnabled(Gtk::Button *, bool enabled) const;
namespace lyx {
namespace frontend {
+// FIXME UNICODE
GBibItem::GBibItem(Dialog & parent)
- : GViewCB<ControlCommand, GViewGladeB>(parent, _("Bibliography Entry Settings"), false)
+ : GViewCB<ControlCommand, GViewGladeB>(parent, lyx::to_utf8(_("Bibliography Entry Settings")), false)
{}
void GBibItem::apply()
{
- controller().params().setContents(keyentry_->get_text());
- controller().params().setOptions(labelentry_->get_text());
+ controller().params().setContents(keyentry_->get_text());
+ controller().params().setOptions(labelentry_->get_text());
}
void GBibItem::changed()
namespace lyx {
namespace frontend {
+// FIXME UNICODE
GBibtex::GBibtex(Dialog & parent)
- : GViewCB<ControlBibtex, GViewGladeB>(parent, _("BibTeX Bibliography"), false)
+ : GViewCB<ControlBibtex, GViewGladeB>(parent, lyx::to_utf8(_("BibTeX Bibliography")), false)
{}
string defaultUnit("cm");
} // namespace anon
+// FIXME UNICODE
GBox::GBox(Dialog & parent)
- : GViewCB<ControlBox, GViewGladeB>(parent, _("Box Settings"), false)
+ : GViewCB<ControlBox, GViewGladeB>(parent, lyx::to_utf8(_("Box Settings")), false)
{}
widthspin_->get_adjustment()->set_value(controller().params().width.value());
unitsComboFromLength(widthunitscombo_, stringcol_,
- controller().params().width, defaultUnit);
+ controller().params().width, defaultUnit);
string const special(controller().params().special);
if (!special.empty() && special != "none") {
heightspin_->get_adjustment()->set_value(controller().params().height.value());
unitsComboFromLength(heightunitscombo_, stringcol_,
- controller().params().height, defaultUnit);
+ controller().params().height, defaultUnit);
string const height_special(controller().params().height_special);
if (!height_special.empty() && height_special != "none") {
if (frameless && oldsize != 2) {
innerboxstore_->clear();
- (*innerboxstore_->append())[stringcol_] = _("Parbox");
- (*innerboxstore_->append())[stringcol_] = _("Minipage");
+ (*innerboxstore_->append())[stringcol_] = lyx::to_utf8(_("Parbox"));
+ (*innerboxstore_->append())[stringcol_] = lyx::to_utf8(_("Minipage"));
// Cope when the backend asks for no inner box in
// a frameless box
if (i == 0) {
innerboxcombo_->set_active(i - 1);
} else if (!frameless && oldsize != 3) {
innerboxstore_->clear();
- (*innerboxstore_->append())[stringcol_] = _("None");
- (*innerboxstore_->append())[stringcol_] = _("Parbox");
- (*innerboxstore_->append())[stringcol_] = _("Minipage");
+ (*innerboxstore_->append())[stringcol_] = lyx::to_utf8(_("None"));
+ (*innerboxstore_->append())[stringcol_] = lyx::to_utf8(_("Parbox"));
+ (*innerboxstore_->append())[stringcol_] = lyx::to_utf8(_("Minipage"));
innerboxcombo_->set_active(i);
} else {
// we're not changing the liststore, just selecting i
return;
controller().params().use_parbox =
- (*innerboxcombo_->get_active())[stringcol_] == _("Parbox");
+ (*innerboxcombo_->get_active())[stringcol_] == lyx::to_utf8(_("Parbox"));
- bool const ibox = (*innerboxcombo_->get_active())[stringcol_] != _("None");
+ bool const ibox = (*innerboxcombo_->get_active())[stringcol_] != lyx::to_utf8(_("None"));
controller().params().inner_box = ibox;
setSpecial(ibox);
namespace lyx {
namespace frontend {
-
+// FIXME UNICODE
GBranch::GBranch(Dialog & parent)
- : GViewCB<ControlBranch, GViewGladeB>(parent, _("Branch Settings"), false)
+ : GViewCB<ControlBranch, GViewGladeB>(parent, lyx::to_utf8(_("Branch Settings")), false)
{}
namespace lyx {
namespace frontend {
-
+// FIXME UNICODE
GChanges::GChanges(Dialog & parent)
- : GViewCB<ControlChanges, GViewGladeB>(parent, _("Merge Changes"), false)
+ : GViewCB<ControlChanges, GViewGladeB>(parent, lyx::to_utf8(_("Merge Changes")), false)
{}
void GChanges::promptChange()
{
- string const header = _("Accept highlighted change?");
+ string const header = lyx::to_utf8(_("Accept highlighted change?"));
string author = controller().getChangeAuthor();
string date = controller().getChangeDate();
if(author.empty())
- author = _("unknown author");
+ author = lyx::to_utf8(_("unknown author"));
if(date.empty())
- date = _("unknown date");
+ date = lyx::to_utf8(_("unknown date"));
messagelabel_->set_markup("<big><b>" + header +
- "</b></big>\n\nChanged by <b>" + author
- + "</b> on <b>" + date + "</b>");
+ "</b></big>\n\nChanged by <b>" + author
+ + "</b> on <b>" + date + "</b>");
acceptbutton_->set_sensitive(true && !readOnly());
rejectbutton_->set_sensitive(true && !readOnly());
void GChanges::promptDismiss()
{
- string const header = _("Done merging changes");
+ string const header = lyx::to_utf8(_("Done merging changes"));
messagelabel_->set_markup("<big><b>" + header +
- "</b></big>");
+ "</b></big>");
// Disable all buttons but close.
acceptbutton_->set_sensitive(false);
namespace lyx {
namespace frontend {
-
+// FIXME UNICODE
GCharacter::GCharacter(Dialog & parent)
- : GViewCB<ControlCharacter, GViewGladeB>(parent, _("Text Style"), false)
+ : GViewCB<ControlCharacter, GViewGladeB>(parent, lyx::to_utf8(_("Text Style")), false)
{}
styleModelColumns styleColumns;
+// FIXME UNICODE
GCitation::GCitation(Dialog & parent)
- : GViewCB<ControlCitation, GViewGladeB>(parent, _("Citation"), false)
+ : GViewCB<ControlCitation, GViewGladeB>(parent, lyx::to_utf8(_("Citation")), false)
{}
Gtk::TreeModel::Path rootpath; //required for gtkmm < 2.6
- citekeysview_->append_column(_("CiteKeys"), bibColumns.name);
+ // FIXME UNICODE
+ citekeysview_->append_column(lyx::to_utf8(_("CiteKeys")), bibColumns.name);
citeFilter_ = Gtk::TreeModelFilter::create(allListStore_, rootpath);
citeFilter_->set_visible_column(bibColumns.cite);
citekeysview_->set_model(citeFilter_);
citeselection_ = citekeysview_->get_selection();
- bibkeysview_->append_column(_("BibKeys"), bibColumns.name);
+ // FIXME UNICODE
+ bibkeysview_->append_column(lyx::to_utf8(_("BibKeys")), bibColumns.name);
bibSort_ = Gtk::TreeModelSort::create(allListStore_);
bibSort_->set_sort_column(bibColumns.bib_order, Gtk::SORT_ASCENDING );
bibFilter_ = Gtk::TreeModelFilter::create(bibSort_, rootpath);
sigc::mem_fun(*this, &GCitation::bibkeysview_activated));
bibselection_->signal_changed().connect(
sigc::mem_fun(*this, &GCitation::bib_selected));
-
+
citeselection_->signal_changed().connect(
sigc::mem_fun(*this, &GCitation::cite_selected));
styleStore_->clear();
for (; it != end; ++it) {
- Gtk::TreeModel::iterator iter2 = styleStore_->append();
- (*iter2)[styleColumns.name] = Glib::locale_to_utf8(*it);
+ Gtk::TreeModel::iterator iter2 = styleStore_->append();
+ (*iter2)[styleColumns.name] = Glib::locale_to_utf8(*it);
}
if(orig)
}
}
if (!found) {
- // It wasn't in the list of keys, but to support
+ // It wasn't in the list of keys, but to support
// working on a document away from the bibtex file
// we should keep it anyway.
Gtk::TreeModel::iterator iter = allListStore_->append();
}
+// FIXME UNICODE
GDocument::GDocument(Dialog & parent)
- : GViewCB<ControlDocument, GViewGladeB>(parent, _("Document Settings"), false),
+ : GViewCB<ControlDocument, GViewGladeB>(parent, lyx::to_utf8(_("Document Settings")), false),
lang_(getSecond(getLanguageData(false)))
{}
if (cit->isTeXClassAvailable()) {
classcombo_.append_text(cit->description());
} else {
+ // FIXME UNICODE
string item =
- bformat(_("Unavailable: %1$s"), cit->description());
+ bformat(lyx::to_utf8(_("Unavailable: %1$s")), cit->description());
classcombo_.append_text(item);
}
}
// Populate sans font combo
for (int i = 0; tex_fonts_sans_gui[i][0]; ++i) {
- string font = _(tex_fonts_sans_gui[i]);
+ string font = lyx::to_utf8(_(tex_fonts_sans_gui[i]));
if (!controller().isFontAvailable(tex_fonts_sans[i]))
- font += _(" (not installed)");
+ // FIXME UNICODE
+ font += lyx::to_utf8(_(" (not installed)"));
fontsanscombo_.append_text(font);
}
// Populate roman font combo
for (int i = 0; tex_fonts_roman_gui[i][0]; ++i) {
- string font = _(tex_fonts_roman_gui[i]);
+ string font = lyx::to_utf8(_(tex_fonts_roman_gui[i]));
if (!controller().isFontAvailable(tex_fonts_roman[i]))
- font += _(" (not installed)");
+ font += lyx::to_utf8(_(" (not installed)"));
fontsanscombo_.append_text(font);
}
// Populate typewriter font combo
for (int i = 0; tex_fonts_monospaced_gui[i][0]; ++i) {
- string font = _(tex_fonts_monospaced_gui[i]);
+ string font = lyx::to_utf8(_(tex_fonts_monospaced_gui[i]));
if (!controller().isFontAvailable(tex_fonts_monospaced[i]))
- font += _(" (not installed)");
+ font += lyx::to_utf8(_(" (not installed)"));
fontsanscombo_.append_text(font);
}
// Populate font default family combo
for (int i = 0; ControlDocument::fontfamilies_gui[i][0]; ++i)
- fontdefaultfamilycombo_.append_text(_(ControlDocument::fontfamilies_gui[i]));
+ fontdefaultfamilycombo_.append_text(lyx::to_utf8(_(ControlDocument::fontfamilies_gui[i])));
xml_->get_widget("FontSize", box);
box->pack_start(fontsizecombo_, true, true, 0);
box->pack_start(vspacesizecombo_, true, true, 0);
box->show_all();
// The order of these items is magic
- vspacesizecombo_.append_text(_("Small Skip"));
- vspacesizecombo_.append_text(_("Medium Skip"));
- vspacesizecombo_.append_text(_("Big Skip"));
- vspacesizecombo_.append_text(_("Custom"));
+ vspacesizecombo_.append_text(lyx::to_utf8(_("Small Skip")));
+ vspacesizecombo_.append_text(lyx::to_utf8(_("Medium Skip")));
+ vspacesizecombo_.append_text(lyx::to_utf8(_("Big Skip")));
+ vspacesizecombo_.append_text(lyx::to_utf8(_("Custom")));
vspacesizemap_[0] = VSpace::SMALLSKIP;
vspacesizemap_[1] = VSpace::MEDSKIP;
vspacesizemap_[2] = VSpace::BIGSKIP;
xml_->get_widget("PageSize", box);
box->pack_start(pagesizecombo_, true, true, 0);
box->show_all();
- pagesizecombo_.append_text(_("Default"));
- pagesizecombo_.append_text(_("Custom"));
- pagesizecombo_.append_text(_("US letter"));
- pagesizecombo_.append_text(_("US legal"));
- pagesizecombo_.append_text(_("US executive"));
- pagesizecombo_.append_text(_("A3"));
- pagesizecombo_.append_text(_("A4"));
- pagesizecombo_.append_text(_("A5"));
- pagesizecombo_.append_text(_("B3"));
- pagesizecombo_.append_text(_("B4"));
- pagesizecombo_.append_text(_("B5"));
+ pagesizecombo_.append_text(lyx::to_utf8(_("Default")));
+ pagesizecombo_.append_text(lyx::to_utf8(_("Custom")));
+ pagesizecombo_.append_text(lyx::to_utf8(_("US letter")));
+ pagesizecombo_.append_text(lyx::to_utf8(_("US legal")));
+ pagesizecombo_.append_text(lyx::to_utf8(_("US executive")));
+ pagesizecombo_.append_text(lyx::to_utf8(_("A3")));
+ pagesizecombo_.append_text(lyx::to_utf8(_("A4")));
+ pagesizecombo_.append_text(lyx::to_utf8(_("A5")));
+ pagesizecombo_.append_text(lyx::to_utf8(_("B3")));
+ pagesizecombo_.append_text(lyx::to_utf8(_("B4")));
+ pagesizecombo_.append_text(lyx::to_utf8(_("B5")));
pagesizecombo_.signal_changed().connect(
sigc::mem_fun(*this, &GDocument::pageSizeChanged));
branchliststore_ = Gtk::ListStore::create(branchCols_);
branchesview_->set_model(branchliststore_);
- branchesview_->append_column_editable(_("Name"), branchColName_);
- branchesview_->append_column_editable(_("Activated"), branchColActivated_);
- branchesview_->append_column_editable(_("Color"), branchColColor_);
+ branchesview_->append_column_editable(lyx::to_utf8(_("Name")), branchColName_);
+ branchesview_->append_column_editable(lyx::to_utf8(_("Activated")), branchColActivated_);
+ branchesview_->append_column_editable(lyx::to_utf8(_("Color")), branchColColor_);
branchsel_ = branchesview_->get_selection();
branchsel_->signal_changed().connect(
// Font & Size
int i = findToken(tex_fonts_sans, params.fontsSans);
if (i >= 0)
- fontsanscombo_.set_active_text(_(tex_fonts_sans_gui[i]));
+ fontsanscombo_.set_active_text(lyx::to_utf8(_(tex_fonts_sans_gui[i])));
i = findToken(tex_fonts_sans, params.fontsRoman);
if (i >= 0)
- fontromancombo_.set_active_text(_(tex_fonts_roman_gui[i]));
+ fontromancombo_.set_active_text(lyx::to_utf8(_(tex_fonts_roman_gui[i])));
i = findToken(tex_fonts_monospaced, params.fontsTypewriter);
if (i >= 0)
fonttypewritercombo_.set_active_text(tex_fonts_monospaced_gui[i]);
i = findToken(ControlDocument::fontfamilies, params.fontsDefaultFamily);
if (i >= 0)
fontdefaultfamilycombo_.set_active_text(
- _(ControlDocument::fontfamilies_gui[i]));
+ lyx::to_utf8(_(ControlDocument::fontfamilies_gui[i])));
fontsizecombo_.set_active_text (params.fontsize);
scaleSansSB_->set_value(params.fontsSansScale);
scaleTypewriterSB_->set_value(params.fontsTypewriterScale);
void GDocument::numberingChanged()
{
- string const numberinglabels[] = {
+ docstring const numberinglabels[] = {
_("No headings numbered"),
_("Only parts numbered"),
_("Chapters and above numbered"),
};
int const value = (int)(numberingadj_->get_value());
- numberinglabel_->set_label("<i>" + numberinglabels[value] + "</i>");
+ // FIXME UNICODE
+ numberinglabel_->set_label("<i>" + lyx::to_utf8(numberinglabels[value]) + "</i>");
}
void GDocument::TOCChanged()
{
- string const TOClabels[] = {
+ docstring const TOClabels[] = {
_("Only Parts appear in TOC"),
_("Chapters and above appear in TOC"),
_("Sections and above appear in TOC"),
};
int const value = (int)(TOCadj_->get_value());
- TOClabel_->set_label("<i>" + TOClabels[value] + "</i>");
+ // FIXME UNICODE
+ TOClabel_->set_label("<i>" + lyx::to_utf8(TOClabels[value]) + "</i>");
}
namespace frontend {
GERT::GERT(Dialog & parent)
- : GViewCB<ControlERT, GViewGladeB>(parent, _("TeX Settings"), false)
+ : GViewCB<ControlERT, GViewGladeB>(parent, lyx::to_utf8(_("TeX Settings")), false)
{}
namespace frontend {
GErrorList::GErrorList(Dialog & parent)
- : GViewCB<ControlErrorList, GViewGladeB>(parent, _("Errors"), false)
+ : GViewCB<ControlErrorList, GViewGladeB>(parent, lyx::to_utf8(_("Errors")), false)
{}
errliststore_->clear();
ErrorList const & errors = controller().errorList();
if (errors.empty()) {
- (*errliststore_->append())[listCol_] = _("*** No Errors ***");
+ (*errliststore_->append())[listCol_] = lyx::to_utf8(_("*** No Errors ***"));
errlistview_->set_sensitive(false);
return;
}
std::string description = ff.description();
if (description.empty())
- filters[i]->set_name(Glib::locale_to_utf8(alttitle) +
- " " + _("files"));
- else
+ filters[i]->set_name(Glib::locale_to_utf8(alttitle) +
+ " " + lyx::to_utf8(_("files")));
+ else
filters[i]->set_name(Glib::locale_to_utf8(description));
for (FileFilterList::Filter::glob_iterator git = ff.begin();
- git!=ff.end(); ++git)
+ git!=ff.end(); ++git)
filters[i]->add_pattern(Glib::locale_to_utf8(*git));
}
return filters;
}
-void set_display(Gtk::CheckButton * show_check, Gtk::ComboBox * display_combo,
+void set_display(Gtk::CheckButton * show_check, Gtk::ComboBox * display_combo,
Gtk::Label * display_label, GtkLengthEntry * scale_length,
Gtk::Label * scale_label,
external::DisplayType display, unsigned int scale)
{
typedef Gtk::TreeModel::const_iterator gcit;
- Glib::RefPtr<const Gtk::TreeModel> const display_store =
+ Glib::RefPtr<const Gtk::TreeModel> const display_store =
display_combo->get_model();
bool const no_display = display == external::NoDisplay;
display_combo->set_active(
*(display_store->children().begin())); //Default
else
- for (gcit it = display_store->children().begin();
+ for (gcit it = display_store->children().begin();
it != display_store->children().end(); ++it) {
if ((*it)[displayColumns().type] == display) {
display_combo->set_active(*it);
void get_rotation(external::RotationData & data,
- Gtk::Entry const * angle_entry,
+ Gtk::Entry const * angle_entry,
Gtk::ComboBox const * origin_combo)
{
typedef external::RotationData::OriginType OriginType;
if (using_scale) {
width_length->get_spin()->set_value(scale);
width_length->get_combo()->set_active_text(
- Glib::locale_to_utf8(_("Scale%")));
+ lyx::to_utf8(_("Scale%")));
} else {
width_length->set_length(data.width);
}
height_length->set_length(data.height);
- if (!data.width.zero())
+ if (!data.width.zero())
height_length->get_combo()->set_active(data.width.unit());
height_length->set_sensitive(!using_scale);
GtkLengthEntry * height_length,
Gtk::CheckButton * ar_check)
{
- if (width_length->get_combo()->get_active_text() !=
- Glib::locale_to_utf8(_("Scale%"))) {
+ if (width_length->get_combo()->get_active_text() !=
+ lyx::to_utf8(_("Scale%"))) {
data.width = width_length->get_length();
data.scale = string();
Gtk::TreeModel::iterator it = format_store->children().begin();
Gtk::TreeModel::iterator end = format_store->children().end();
for (; it != end; ++it)
- data.set(Glib::locale_from_utf8((*it)[formatColumns.name]),
+ data.set(Glib::locale_from_utf8((*it)[formatColumns.name]),
trim(Glib::locale_from_utf8((*it)[formatColumns.extra])));
}
GExternal::GExternal(Dialog & parent)
- : GViewCB<ControlExternal, GViewGladeB>(parent, _("External Settings"), false)
+ : GViewCB<ControlExternal, GViewGladeB>(parent, lyx::to_utf8(_("External Settings")), false)
{}
cit != templates.end(); ++cit, ++count) {
external::Template templ = controller().getTemplate(count);
- Gtk::TreeModel::iterator iter = templatestore_->append();
- (*iter)[templateColumns().name] = Glib::locale_to_utf8(*cit);
- (*iter)[templateColumns().info] =
+ Gtk::TreeModel::iterator iter = templatestore_->append();
+ (*iter)[templateColumns().name] = Glib::locale_to_utf8(*cit);
+ (*iter)[templateColumns().info] =
Glib::locale_to_utf8(templ.helpText);
(*iter)[templateColumns().filters] = get_filters(
controller().getTemplateFilters(*cit),*cit);
// *** Start "File" Page ***
xml_->get_widget("TemplateFile", templatefcbutton_);
- templatefcbutton_->set_title(_("Select external file"));
+ templatefcbutton_->set_title(lyx::to_utf8(_("Select external file")));
templatefcbutton_->signal_file_activated().connect(
sigc::mem_fun(*this, &GExternal::file_changed));
// Fill the display combo
Gtk::TreeModel::iterator iter = displaystore_->append();
- (*iter)[displayColumns().name] = Glib::locale_to_utf8(_("Default"));
+ (*iter)[displayColumns().name] = lyx::to_utf8(_("Default"));
(*iter)[displayColumns().type] = external::DefaultDisplay;
iter = displaystore_->append();
- (*iter)[displayColumns().name] = Glib::locale_to_utf8(_("Monochrome"));
+ (*iter)[displayColumns().name] = lyx::to_utf8(_("Monochrome"));
(*iter)[displayColumns().type] = external::MonochromeDisplay;
iter = displaystore_->append();
- (*iter)[displayColumns().name] = Glib::locale_to_utf8(_("Grayscale"));
+ (*iter)[displayColumns().name] = lyx::to_utf8(_("Grayscale"));
(*iter)[displayColumns().type] = external::GrayscaleDisplay;
iter = displaystore_->append();
- (*iter)[displayColumns().name] = Glib::locale_to_utf8(_("Color"));
+ (*iter)[displayColumns().name] = lyx::to_utf8(_("Color"));
(*iter)[displayColumns().type] = external::ColorDisplay;
iter = displaystore_->append();
- (*iter)[displayColumns().name] = Glib::locale_to_utf8(_("Preview"));
+ (*iter)[displayColumns().name] = lyx::to_utf8(_("Preview"));
(*iter)[displayColumns().type] = external::PreviewDisplay;
xml_->get_widget("Display", displaycombo_);
scalespin_->set_increments(1,10);
scalecombo_ = scalelength_->get_combo();
scalecombo_->clear();
- scalecombo_->append_text(Glib::locale_to_utf8(_("Scale%")));
- scalecombo_->set_active_text(Glib::locale_to_utf8(_("Scale%")));
+ scalecombo_->append_text(lyx::to_utf8(_("Scale%")));
+ scalecombo_->set_active_text(lyx::to_utf8(_("Scale%")));
xml_->get_widget("ScaleLabel", scalelabel_);
scalelabel_->set_mnemonic_widget(*scalespin_);
Origins const & all_origins = external::all_origins();
for (Origins::size_type i = 0; i != all_origins.size(); ++i)
origincombo_.append_text(
- Glib::locale_to_utf8(external::origin_gui_str(i)));
+ external::origin_gui_str(i));
xml_->get_widget("OriginLabel", originlabel_);
originlabel_->set_mnemonic_widget(origincombo_);
// *** Start "Scale" Page ***
xml_->get_widget_derived ("Width", widthlength_);
widthcombo_ = widthlength_->get_combo();
- widthcombo_->prepend_text(Glib::locale_to_utf8(_("Scale%")));
- widthcombo_->set_active_text(Glib::locale_to_utf8(_("Scale%")));
+ widthcombo_->prepend_text(lyx::to_utf8(_("Scale%")));
+ widthcombo_->set_active_text(lyx::to_utf8(_("Scale%")));
xml_->get_widget("WidthLabel", widthlabel_);
widthlabel_->set_mnemonic_widget(*(widthlength_->get_spin()));
sigc::mem_fun(*this, &GExternal::size_changed));
heightlength_->signal_changed().connect(
sigc::mem_fun(*this, &GExternal::size_changed));
-
+
xml_->get_widget("HeightLabel", heightlabel_);
heightlabel_->set_mnemonic_widget(*(heightlength_->get_spin()));
xml_->get_widget("Options", optionsview_);
optionsview_->set_model(formatstore_);
- optionsview_->append_column(_("Forma_t"), formatColumns.name);
- optionsview_->append_column_editable(_("O_ption"), formatColumns.extra);
+ optionsview_->append_column(lyx::to_utf8(_("Forma_t")), formatColumns.name);
+ optionsview_->append_column_editable(lyx::to_utf8(_("O_ption")), formatColumns.extra);
// *** End "Options" Page ***
}
}
else {
editfilebutton_->set_sensitive(false);
- bbfromfilebutton_->set_sensitive(false);
+ bbfromfilebutton_->set_sensitive(false);
}
templatecombo_->set_active(
templatefilters =
(*currenttemplate_)[templateColumns().filters];
- for (ffit it = templatefilters.begin();
+ for (ffit it = templatefilters.begin();
it != templatefilters.end(); ++it)
templatefcbutton_->remove_filter(**it);
}
Gtk::Widget * widget = notebook_->get_nth_page(2);
widget->set_sensitive(found);
notebook_->get_tab_label(*widget)->set_sensitive(found);
-
+
found = find(tr_begin, tr_end, external::Resize) != tr_end;
widget = notebook_->get_nth_page(3);
widget->set_sensitive(found);
// Ascertain whether the template has any formats supporting
// the 'Extra' option
- Glib::ustring templatename =
+ Glib::ustring templatename =
(*currenttemplate_)[templateColumns().name];
formatstore_->clear();
external::Template::Formats::const_iterator it = templ.formats.begin();
string const format = it->first;
string const opt = controller().params().extradata.get(format);
- Gtk::TreeModel::iterator iter = formatstore_->append();
- (*iter)[formatColumns.name] = Glib::locale_to_utf8(format);
- (*iter)[formatColumns.extra] = Glib::locale_to_utf8(opt);
+ Gtk::TreeModel::iterator iter = formatstore_->append();
+ (*iter)[formatColumns.name] = Glib::locale_to_utf8(format);
+ (*iter)[formatColumns.extra] = Glib::locale_to_utf8(opt);
}
// widget is still the 'Options' tab
- notebook_->get_tab_label(*widget)->set_sensitive(enabled);
+ notebook_->get_tab_label(*widget)->set_sensitive(enabled);
}
angleentry_, &origincombo_);
if (notebook_->get_nth_page(3)->is_sensitive())
- get_size(params.resizedata,
+ get_size(params.resizedata,
widthlength_, heightlength_, archeck_);
if (notebook_->get_nth_page(4)->is_sensitive())
bool GExternal::activate_ar() const
{
- if (widthlength_->get_combo()->get_active_text() ==
- Glib::locale_to_utf8(_("Scale%")))
+ if (widthlength_->get_combo()->get_active_text() ==
+ lyx::to_utf8(_("Scale%")))
return false;
if (widthlength_->get_spin()->get_value() < 0.05)
{
archeck_->set_sensitive(activate_ar());
- bool useHeight = widthlength_->get_combo()->get_active_text() !=
- Glib::locale_to_utf8(_("Scale%"));
+ bool useHeight = widthlength_->get_combo()->get_active_text() !=
+ lyx::to_utf8(_("Scale%"));
heightlength_->set_sensitive(useHeight);
}
}
else {
editfilebutton_->set_sensitive(false);
- bbfromfilebutton_->set_sensitive(false);
+ bbfromfilebutton_->set_sensitive(false);
}
bc().valid(true);
}
namespace frontend {
GFloat::GFloat(Dialog & parent)
- : GViewCB<ControlFloat, GViewGladeB>(parent, _("Float Settings"), false)
+ : GViewCB<ControlFloat, GViewGladeB>(parent, lyx::to_utf8(_("Float Settings")), false)
{}
} // namespace anon
GGraphics::GGraphics(Dialog & parent)
- : GViewCB<ControlGraphics, GViewGladeB>(parent, _("Graphics"), false)
+ : GViewCB<ControlGraphics, GViewGladeB>(parent, lyx::to_utf8(_("Graphics")), false)
{}
righttopyspin_->set_text("");
}
unitsComboFromLength(bbunitscombo_, stringcol_,
- LyXLength("bp"), defaultUnit);
+ LyXLength("bp"), defaultUnit);
} else {
// get the values from the inset
lyxerr[Debug::GRAPHICS]
righttopxspin_->set_text(token(bb, ' ', 2));
righttopyspin_->set_text(token(bb, ' ', 3));
unitsComboFromLength(bbunitscombo_, stringcol_,
- LyXLength("bp"), defaultUnit);
+ LyXLength("bp"), defaultUnit);
}
controller().bbChanged = false;
} else {
righttopxspin_->set_text("");
righttopyspin_->set_text("");
unitsComboFromLength(bbunitscombo_, stringcol_,
- LyXLength("bp"), defaultUnit);
+ LyXLength("bp"), defaultUnit);
}
bc().input(ButtonPolicy::SMI_VALID);
}
namespace frontend {
GInclude::GInclude(Dialog & parent)
- : GViewCB<ControlInclude, GViewGladeB>(parent, _("Child Document"), false)
+ : GViewCB<ControlInclude, GViewGladeB>(parent, lyx::to_utf8(_("Child Document")), false)
{}
namespace frontend {
GLog::GLog(Dialog & parent)
- : GViewCB<ControlLog, GViewGladeB>(parent, _("Log Viewer"), false)
+ : GViewCB<ControlLog, GViewGladeB>(parent, lyx::to_utf8(_("Log Viewer")), false)
{}
if (!contents.str().empty())
contentbuffer_->set_text(contents.str());
else
- contentbuffer_->set_text(_("Error reading file!"));
+ contentbuffer_->set_text(lyx::to_utf8(_("Error reading file!")));
}
} // namespace frontend
GMathDelim::GMathDelim(Dialog & parent) :
- GViewCB<ControlMath, GViewGladeB>(parent, _("Math Delimiters")),
+ GViewCB<ControlMath, GViewGladeB>(parent, lyx::to_utf8(_("Math Delimiters"))),
delimTbl_(delimTblRows, delimTblCols, xbm)
{
}
GMathPanel::GMathPanel(Dialog & parent)
- : GViewCB<ControlMath, GViewGladeB>(parent, _("Math Panel")),
+ : GViewCB<ControlMath, GViewGladeB>(parent, lyx::to_utf8(_("Math Panel"))),
tableUp_(2, 5, xpmUp), tableDown_(4, 3, xpmDown)
{
}
GMathsMatrix::GMathsMatrix(Dialog & parent)
- : GViewCB<ControlMath, GViewGladeB>(parent, _("Math Matrix"), false)
+ : GViewCB<ControlMath, GViewGladeB>(parent, lyx::to_utf8(_("Math Matrix")), false)
{}
namespace frontend {
GNote::GNote(Dialog & parent)
- : GViewCB<ControlNote, GViewGladeB>(parent, _("Note Settings"), false)
+ : GViewCB<ControlNote, GViewGladeB>(parent, lyx::to_utf8(_("Note Settings")), false)
{}
GParagraph::GParagraph(Dialog & parent)
- : GViewCB<ControlParagraph, GViewGladeB>(parent, _("Paragraph Settings"), false)
+ : GViewCB<ControlParagraph, GViewGladeB>(parent, lyx::to_utf8(_("Paragraph Settings")), false)
{}
void GParagraph::doBuild()
string const labelwidth = controller().params().labelWidthString();
maxlabelwidthentry_->set_text(labelwidth);
maxlabelwidthentry_->set_sensitive(
- labelwidth != _("Senseless with this layout!"));
+ labelwidth != lyx::to_utf8(_("Senseless with this layout!")));
// alignment
LyXAlignment const current_alignment = controller().params().align();
namespace frontend {
GPreferences::GPreferences(Dialog & parent)
- : GViewCB<ControlPrefs, GViewGladeB>(parent, _("Preferences"), false)
+ : GViewCB<ControlPrefs, GViewGladeB>(parent, lyx::to_utf8(_("Preferences")), false)
{}
dpiadj_ = spin->get_adjustment();
xml_->get_widget("Zoom", spin);
zoomadj_ = spin->get_adjustment();
-
+
// *** Graphics ***
xml_->get_widget("GraphicsColor", graphicscolorradio_);
xml_->get_widget("GraphicsGrayscale", graphicsgrayscaleradio_);
xml_->get_widget("GraphicsMonochrome", graphicsmonoradio_);
xml_->get_widget("GraphicsDoNotDisplay", graphicsnoneradio_);
-
+
xml_->get_widget("InstantPreviewOn", instprevonradio_);
xml_->get_widget("InstantPreviewOff", instprevoffradio_);
xml_->get_widget("InstantPreviewNoMath", instprevnomathradio_);
xml_->get_widget("UseKeyboardMap", keyboardmapcheck_);
xml_->get_widget("FirstKeyboardMap", keyboardmap1fcbutton_);
xml_->get_widget("SecondKeyboardMap", keyboardmap2fcbutton_);
-
+
Gtk::FileFilter kmapfilter;
kmapfilter.set_name ("LyX keyboard maps");
kmapfilter.add_pattern ("*.kmap");
keyboardmap2fcbutton_->add_filter (kmapfilter);
keyboardmap2fcbutton_->add_filter (allfilter);
keyboardmap2fcbutton_->set_filter (kmapfilter);
-
+
keyboardmapcheck_->signal_toggled().connect(
sigc::mem_fun(*this, &GPreferences::keyboard_sensitivity));
-
+
// *** Language ***
-
+
xml_->get_widget("DefaultLanguage", box);
box->pack_start (defaultlanguagecombo_);
defaultlanguagecombo_.show();
xml_->get_widget("RTLSupport", RTLsupportcheck_);
xml_->get_widget("AutoBegin", autobegincheck_);
xml_->get_widget("AutoEnd", autoendcheck_);
-
+
// Store the lang identifiers for later
vector<LanguagePair> const langs = getLanguageData(false);
lang_ = getSecond(langs);
Gtk::FileFilter ispellfilter;
ispellfilter.set_name ("iSpell Dictionary Files");
ispellfilter.add_pattern ("*.ispell");
-
+
personaldictionaryfcbutton_->add_filter (ispellfilter);
personaldictionaryfcbutton_->add_filter (allfilter);
personaldictionaryfcbutton_->set_filter (ispellfilter);
spellcheckercombo_.append_text (_("aspell (library)"));
#endif
#endif
-
+
}
instprevoffradio_->set_active();
break;
}
-
+
// *** Keyboard ***
keyboardmapcheck_->set_active (rc.use_kbmap);
keyboardmap1fcbutton_->set_filename (rc.primary_kbmap);
// *** Language ***
int const pos = int(findPos(lang_, rc.default_language));
defaultlanguagecombo_.set_active(pos);
-
+
languagepackageentry_->set_text(rc.language_package);
commandstartentry_->set_text(rc.language_command_begin);
commandendentry_->set_text(rc.language_command_end);
spellcheckercombo_.set_active (3);
#endif
}
-
+
// FIXME: remove isp_use_alt_lang
alternativelanguageentry_->set_text(rc.isp_alt_lang);
// FIXME: remove isp_use_esc_chars
rc.primary_kbmap = keyboardmap1fcbutton_->get_filename();
rc.secondary_kbmap = keyboardmap2fcbutton_->get_filename();
}
-
+
// *** Language ***
rc.default_language = lang_[
defaultlanguagecombo_.get_active_row_number()];
GRef::GRef(Dialog & parent)
- : GViewCB<ControlRef, GViewGladeB>(parent, _("Cross-reference"), false)
+ : GViewCB<ControlRef, GViewGladeB>(parent, lyx::to_utf8(_("Cross-reference")), false)
{}
xml_->get_widget("Back", backbutton_);
xml_->get_widget("Refresh", refreshbutton_);
- refview_->append_column(_("Label"), refColumns.name);
+ refview_->append_column(lyx::to_utf8(_("Label")), refColumns.name);
buffercombo_->signal_changed().connect(
sigc::mem_fun(*this, &GRef::buffer_changed));
vector<string>::const_iterator it = buffers.begin();
vector<string>::const_iterator const end = buffers.end();
for (; it != end; ++it) {
- Gtk::TreeModel::iterator iter = bufferstore_->append();
- (*iter)[bufferColumns.name] = *it;
+ Gtk::TreeModel::iterator iter = bufferstore_->append();
+ (*iter)[bufferColumns.name] = *it;
}
buffercombo_->set_active(controller().getBufferNum());
refview_->set_sensitive(true);
} else {
Gtk::TreeModel::iterator iter =refListStore_->append();
- (*iter)[refColumns.name] = _("No labels found.");
+ (*iter)[refColumns.name] = lyx::to_utf8(_("No labels found."));
refview_->set_sensitive(false);
}
refview_->set_model(refListStore_);
GSearch::GSearch(Dialog & parent)
- : base_class(parent, _("Find and Replace"), false)
+ : base_class(parent, lyx::to_utf8(_("Find and Replace")), false)
{}
void GSearch::onFindNext()
{
controller().find(findentry->get_text(),
- casecheck->get_active(),
- matchwordcheck->get_active(),
- !backwardscheck->get_active());
+ casecheck->get_active(),
+ matchwordcheck->get_active(),
+ !backwardscheck->get_active());
}
void GSearch::onReplace()
{
controller().replace(findentry->get_text(),
- replaceentry->get_text(),
- casecheck->get_active(),
- matchwordcheck->get_active(),
- !backwardscheck->get_active(),
- false);
+ replaceentry->get_text(),
+ casecheck->get_active(),
+ matchwordcheck->get_active(),
+ !backwardscheck->get_active(),
+ false);
}
void GSearch::onReplaceAll()
{
controller().replace(findentry->get_text(),
- replaceentry->get_text(),
- casecheck->get_active(),
- matchwordcheck->get_active(),
- !backwardscheck->get_active(),
- true);
+ replaceentry->get_text(),
+ casecheck->get_active(),
+ matchwordcheck->get_active(),
+ !backwardscheck->get_active(),
+ true);
}
namespace frontend {
GSendto::GSendto(Dialog & parent)
- : GViewCB<ControlSendto, GViewGladeB>(parent, _("Send document to command"), false)
+ : GViewCB<ControlSendto, GViewGladeB>(parent, lyx::to_utf8(_("Send document to command")), false)
{}
namespace frontend {
GShowFile::GShowFile(Dialog & parent)
- : GViewCB<ControlShowFile, GViewGladeB>(parent, _("Show File"), false)
+ : GViewCB<ControlShowFile, GViewGladeB>(parent, lyx::to_utf8(_("Show File")), false)
{}
if (!contents.empty())
contentbuffer_->set_text(contents);
else
- contentbuffer_->set_text(_("Error reading file!"));
+ contentbuffer_->set_text(lyx::to_utf8(_("Error reading file!")));
}
} // namespace frontend
namespace frontend {
GSpellchecker::GSpellchecker(Dialog & parent)
- : GViewCB<ControlSpellchecker, GViewGladeB>
- (parent, _("Spellchecker"), false)
+ : GViewCB<ControlSpellchecker, GViewGladeB>(parent, lyx::to_utf8(_("Spellchecker")), false)
{}
int const progress = controller().getProgress();
if (progress != 0) {
progress_->set_fraction(float(progress)/100.0f);
- progress_->set_text(convert<string>(progress) + "% " + _("checked"));
+ progress_->set_text(convert<string>(progress) + "% " + lyx::to_utf8(_("checked")));
}
}
namespace frontend {
GTableCreate::GTableCreate(Dialog & parent)
- : GViewCB<ControlTabularCreate, GViewGladeB>(parent, _("Insert Table"))
+ : GViewCB<ControlTabularCreate, GViewGladeB>(parent, lyx::to_utf8(_("Insert Table")))
{
}
namespace frontend {
GTabular::GTabular(Dialog & parent)
- : GViewCB<ControlTabular, GViewGladeB>(parent, _("Table Settings"), false)
+ : GViewCB<ControlTabular, GViewGladeB>(parent, lyx::to_utf8(_("Table Settings")), false)
{}
// Deprecated in favor of clear_items in gtkmm >= 2.8
unsigned int const oldselection = horzaligncombo_->get_active_row_number();
horzaligncombo_->clear();
- horzaligncombo_->append_text(_("Left"));
- horzaligncombo_->append_text(_("Center"));
- horzaligncombo_->append_text(_("Right"));
+ horzaligncombo_->append_text(lyx::to_utf8(_("Left")));
+ horzaligncombo_->append_text(lyx::to_utf8(_("Center")));
+ horzaligncombo_->append_text(lyx::to_utf8(_("Right")));
if (extraoption)
- horzaligncombo_->append_text(_("Block"));
+ horzaligncombo_->append_text(lyx::to_utf8(_("Block")));
if (oldselection < horzaligncombo_->get_model()->children().size())
horzaligncombo_->set_active(oldselection);
else
GTexinfo::GTexinfo(Dialog & parent)
- : GViewCB<ControlTexinfo, GViewGladeB>(parent, _("TeX Information"), false),
+ : GViewCB<ControlTexinfo, GViewGladeB>(parent, lyx::to_utf8(_("TeX Information")), false),
activeStyle(ControlTexinfo::cls)
{}
sigc::mem_fun(*this, >exinfo::onTypeComboChanged));
Gtk::TreeModel::iterator row = typestore_->append();
- (*row)[listCol_] = _("LaTeX classes");
+ (*row)[listCol_] = lyx::to_utf8(_("LaTeX classes"));
(*row)[listColIndex_] = ControlTexinfo::cls;
// This is the default selection
typecombo_->set_active(row);
activeStyle = ControlTexinfo::cls;
row = typestore_->append();
- (*row)[listCol_] = _("LaTeX styles");
+ (*row)[listCol_] = lyx::to_utf8(_("LaTeX styles"));
(*row)[listColIndex_] = ControlTexinfo::sty;
row = typestore_->append();
- (*row)[listCol_] = _("BibTeX styles");
+ (*row)[listCol_] = lyx::to_utf8(_("BibTeX styles"));
(*row)[listColIndex_] = ControlTexinfo::bst;
updateStyles();
GThesaurus::GThesaurus(Dialog & parent)
- : GViewCB<ControlThesaurus, GViewGladeB>(parent, _("Thesaurus"), false)
+ : GViewCB<ControlThesaurus, GViewGladeB>(parent, lyx::to_utf8(_("Thesaurus")), false)
{}
xml_->get_widget("Keyword", keywordentry_);
xml_->get_widget("Meanings", meaningsview_);
- meaningsview_->append_column(_("Synonym"), synColumns.name);
+ meaningsview_->append_column(lyx::to_utf8(_("Synonym")), synColumns.name);
// Keyword entry changed
for (std::vector<string>::const_iterator cit2 = cit->second.begin();
cit2 != cit->second.end(); ++cit2) {
- Gtk::TreeModel::Row childrow = *(synTreeStore_->append(row.children()));
+ Gtk::TreeModel::Row childrow = *(synTreeStore_->append(row.children()));
childrow[synColumns.name] = *cit2;
}
}
meaningsview_->set_sensitive(true);
} else {
Gtk::TreeModel::Row row = *(synTreeStore_->append());
- row[synColumns.name] = _("No synonyms found");
+ row[synColumns.name] = lyx::to_utf8(_("No synonyms found"));
meaningsview_->set_sensitive(false);
}
meaningsview_->set_model(synTreeStore_);
namespace frontend {
GToc::GToc(Dialog & parent)
- : GViewCB<ControlToc, GViewGladeB>(parent, _("Table of Contents"), false)
+ : GViewCB<ControlToc, GViewGladeB>(parent, lyx::to_utf8(_("Table of Contents")), false)
{}
{
if (typestore_->children().empty()) {
tocstore_->clear();
- (*tocstore_->append())[listCol_] = _("*** No Lists ***");
+ (*tocstore_->append())[listCol_] = lyx::to_utf8(_("*** No Lists ***"));
tocview_->set_sensitive(false);
return;
}
if (contents.empty()) {
tocstore_->clear();
- (*tocstore_->append())[listCol_] = _("*** No Items ***");
+ (*tocstore_->append())[listCol_] = lyx::to_utf8(_("*** No Items ***"));
tocview_->set_sensitive(false);
return;
}
GUrl::GUrl(Dialog & parent)
- : GViewCB<ControlCommand, GViewGladeB>(parent, _("URL"))
+ : GViewCB<ControlCommand, GViewGladeB>(parent, lyx::to_utf8(_("URL")))
{
}
namespace frontend {
GVSpace::GVSpace(Dialog & parent)
- : GViewCB<ControlVSpace, GViewGladeB>(parent, _("VSpace Settings"), false)
+ : GViewCB<ControlVSpace, GViewGladeB>(parent, lyx::to_utf8(_("VSpace Settings")), false)
{}
namespace frontend {
GWrap::GWrap(Dialog & parent)
- : GViewCB<ControlWrap, GViewGladeB>(parent, _("Text Wrap Settings"), false)
+ : GViewCB<ControlWrap, GViewGladeB>(parent, lyx::to_utf8(_("Text Wrap Settings")), false)
{}
int default_button, int cancel_button,
string const & b1, string const & b2, string const & b3)
{
- string const title = bformat(_("LyX: %1$s"), tit);
+ string const title = bformat(lyx::to_utf8(_("LyX: %1$s")), tit);
QWidget * const parent = qApp->focusWidget() ?
qApp->focusWidget() : qApp->mainWidget();
QWidget * const parent = qApp->focusWidget() ?
qApp->focusWidget() : qApp->mainWidget();
- string const title = bformat(_("LyX: %1$s"), tit);
+ string const title = bformat(lyx::to_utf8(_("LyX: %1$s")), tit);
QMessageBox::warning(parent,
toqstr(title),
toqstr(formatted(message)));
QWidget * const parent = qApp->focusWidget() ?
qApp->focusWidget() : qApp->mainWidget();
- string const title = bformat(_("LyX: %1$s"), tit);
+ string const title = bformat(lyx::to_utf8(_("LyX: %1$s")), tit);
QMessageBox::critical(parent,
toqstr(title),
toqstr(formatted(message)));
QWidget * const parent = qApp->focusWidget() ?
qApp->focusWidget() : qApp->mainWidget();
- string const title = bformat(_("LyX: %1$s"), tit);
+ string const title = bformat(lyx::to_utf8(_("LyX: %1$s")), tit);
QMessageBox::information(parent,
toqstr(title),
toqstr(formatted(message)));
QWidget * const parent = qApp->focusWidget() ?
qApp->focusWidget() : qApp->mainWidget();
- string const title = bformat(_("LyX: %1$s"), msg);
+ string const title = bformat(lyx::to_utf8(_("LyX: %1$s")), msg);
QAskForTextDialog d(parent, toqstr(title), true);
// less than ideal !
d.askLA->setText(toqstr('&' + msg));
} else if (name == "index") {
dialog->setController(new ControlCommand(*dialog, name));
dialog->setView(new QIndex(*dialog,
- _("Index Entry"),
+ lyx::to_utf8(_("Index Entry")),
qt_("&Keyword:")));
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
} else if (name == "label") {
dialog->setController(new ControlCommand(*dialog, name));
dialog->setView(new QIndex(*dialog,
- _("Label"),
+ lyx::to_utf8(_("Label")),
qt_("&Label:")));
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
} else if (name == "log") {
qApp->focusWidget() ? qApp->focusWidget() : qApp->mainWidget(),
title_.c_str()));
#else
- FileFilterList const filter(_("Directories"));
+ FileFilterList const filter(lyx::to_utf8(_("Directories")));
LyXFileDialog dlg(path, filter, title_, private_->b1, private_->b2);
typedef QController<ControlAboutlyx, QView<QAboutDialog> > base_class;
QAbout::QAbout(Dialog & parent)
- : base_class(parent, _("About LyX"))
+ : base_class(parent, lyx::to_utf8(_("About LyX")))
{
}
QBibitem::QBibitem(Dialog & parent)
- : base_class(parent, _("Bibliography Entry Settings"))
+ : base_class(parent, lyx::to_utf8(_("Bibliography Entry Settings")))
{
}
typedef QController<ControlBibtex, QView<QBibtexDialog> > base_class;
QBibtex::QBibtex(Dialog & parent)
- : base_class(parent, _("BibTeX Bibliography"))
+ : base_class(parent, lyx::to_utf8(_("BibTeX Bibliography")))
{
}
typedef QController<ControlBox, QView<QBoxDialog> > base_class;
QBox::QBox(Dialog & parent)
- : base_class(parent, _("Box Settings"))
+ : base_class(parent, lyx::to_utf8(_("Box Settings")))
{}
QBranch::QBranch(Dialog & parent)
- : base_class(parent, _("Branch Settings"))
+ : base_class(parent, lyx::to_utf8(_("Branch Settings")))
{}
QChanges::QChanges(Dialog & parent)
- : base_class(parent, _("Merge Changes"))
+ : base_class(parent, lyx::to_utf8(_("Merge Changes")))
{
}
string date(controller().getChangeDate());
if (!author.empty())
- text += bformat(_("Change by %1$s\n\n"), author);
+ text += bformat(lyx::to_utf8(_("Change by %1$s\n\n")), author);
if (!date.empty())
- text += bformat(_("Change made at %1$s\n"), date);
+ text += bformat(lyx::to_utf8(_("Change made at %1$s\n")), date);
dialog_->changeTV->setText(toqstr(text));
}
QCharacter::QCharacter(Dialog & parent)
- : base_class(parent, _("Text Style"))
+ : base_class(parent, lyx::to_utf8(_("Text Style")))
{
}
typedef QController<ControlCitation, QView<QCitationDialog> > base_class;
QCitation::QCitation(Dialog & parent)
- : base_class(parent, _("Citation"))
+ : base_class(parent, lyx::to_utf8(_("Citation")))
{}
QDocument::QDocument(Dialog & parent)
- : base_class(parent, _("Document Settings")),
+ : base_class(parent, lyx::to_utf8(_("Document Settings"))),
lang_(getSecond(getLanguageData(false)))
{}
dialog_->latexModule->classCO->insertItem(toqstr(cit->description()));
} else {
string item =
- bformat(_("Unavailable: %1$s"), cit->description());
+ bformat(lyx::to_utf8(_("Unavailable: %1$s")), cit->description());
dialog_->latexModule->classCO->insertItem(toqstr(item));
}
}
branchesModule = new BranchesModuleBase(this);
preambleModule = new PreambleModuleBase(this);
- docPS->addPanel(latexModule, _("Document Class"));
- docPS->addPanel(fontModule, _("Fonts"));
- docPS->addPanel(textLayoutModule, _("Text Layout"));
- docPS->addPanel(pageLayoutModule, _("Page Layout"));
- docPS->addPanel(marginsModule, _("Page Margins"));
- docPS->addPanel(langModule, _("Language"));
- docPS->addPanel(numberingModule, _("Numbering & TOC"));
- docPS->addPanel(biblioModule, _("Bibliography"));
- docPS->addPanel(mathsModule, _("Math Options"));
- docPS->addPanel(floatModule, _("Float Placement"));
- docPS->addPanel(bulletsModule, _("Bullets"));
- docPS->addPanel(branchesModule, _("Branches"));
- docPS->addPanel(preambleModule, _("LaTeX Preamble"));
- docPS->setCurrentPanel(_("Document Class"));
+ docPS->addPanel(latexModule, lyx::to_utf8(_("Document Class")));
+ docPS->addPanel(fontModule, lyx::to_utf8(_("Fonts")));
+ docPS->addPanel(textLayoutModule, lyx::to_utf8(_("Text Layout")));
+ docPS->addPanel(pageLayoutModule, lyx::to_utf8(_("Page Layout")));
+ docPS->addPanel(marginsModule, lyx::to_utf8(_("Page Margins")));
+ docPS->addPanel(langModule, lyx::to_utf8(_("Language")));
+ docPS->addPanel(numberingModule, lyx::to_utf8(_("Numbering & TOC")));
+ docPS->addPanel(biblioModule, lyx::to_utf8(_("Bibliography")));
+ docPS->addPanel(mathsModule, lyx::to_utf8(_("Math Options")));
+ docPS->addPanel(floatModule, lyx::to_utf8(_("Float Placement")));
+ docPS->addPanel(bulletsModule, lyx::to_utf8(_("Bullets")));
+ docPS->addPanel(branchesModule, lyx::to_utf8(_("Branches")));
+ docPS->addPanel(preambleModule, lyx::to_utf8(_("LaTeX Preamble")));
+ docPS->setCurrentPanel(lyx::to_utf8(_("Document Class")));
// preamble
connect(preambleModule->preambleMLE, SIGNAL(textChanged()), this, SLOT(change_adaptor()));
void QDocumentDialog::showPreamble()
{
- docPS->setCurrentPanel(_("LaTeX Preamble"));
+ docPS->setCurrentPanel(lyx::to_utf8(_("LaTeX Preamble")));
}
void QDocumentDialog::romanChanged(int item)
{
string const font = tex_fonts_roman[item];
-
+
fontModule->fontScCB->setEnabled(
form_->controller().providesSC(font));
fontModule->fontOsfCB->setEnabled(
void QDocumentDialog::sansChanged(int item)
{
string const font = tex_fonts_sans[item];
-
+
fontModule->scaleSansSB->setEnabled(
form_->controller().providesScale(font));
}
void QDocumentDialog::ttChanged(int item)
{
string const font = tex_fonts_monospaced[item];
-
+
fontModule->scaleTypewriterSB->setEnabled(
form_->controller().providesScale(font));
}
QERT::QERT(Dialog & parent)
- : base_class(parent, _("TeX Code Settings"))
+ : base_class(parent, lyx::to_utf8(_("TeX Code Settings")))
{
}
typedef QController<ControlExternal, QView<QExternalDialog> > base_class;
QExternal::QExternal(Dialog & parent)
- : base_class(parent, _("External Material"))
+ : base_class(parent, lyx::to_utf8(_("External Material")))
{}
QFloat::QFloat(Dialog & parent)
- : base_class(parent, _("Float Settings"))
+ : base_class(parent, lyx::to_utf8(_("Float Settings")))
{
}
typedef QController<ControlGraphics, QView<QGraphicsDialog> > base_class;
QGraphics::QGraphics(Dialog & parent)
- : base_class(parent, _("Graphics"))
+ : base_class(parent, lyx::to_utf8(_("Graphics")))
{
}
QInclude::QInclude(Dialog & parent)
- : base_class(parent, _("Child Document"))
+ : base_class(parent, lyx::to_utf8(_("Child Document")))
{}
QMath::QMath(Dialog & parent)
- : math_base(parent, _("Math Panel"))
+ : math_base(parent, lyx::to_utf8(_("Math Panel")))
{}
QMathMatrix::QMathMatrix(Dialog & parent)
- : matrix_base(parent, _("Math Matrix"))
+ : matrix_base(parent, lyx::to_utf8(_("Math Matrix")))
{}
QMathDelimiter::QMathDelimiter(Dialog & parent)
- : delimiter_base(parent, _("Math Delimiter"))
+ : delimiter_base(parent, lyx::to_utf8(_("Math Delimiter")))
{}
QNote::QNote(Dialog & parent)
- : base_class(parent, _("Note Settings"))
+ : base_class(parent, lyx::to_utf8(_("Note Settings")))
{}
QParagraph::QParagraph(Dialog & parent)
- : base_class(parent, _("Paragraph Settings"))
+ : base_class(parent, lyx::to_utf8(_("Paragraph Settings")))
{}
// label width
string const & labelwidth = params.labelWidthString();
- // _() is correct here (this is stupid though !)
- if (labelwidth != _("Senseless with this layout!")) {
+ // lyx::to_utf8(_() is correct here (this is stupid though !))
+ if (labelwidth != lyx::to_utf8(_("Senseless with this layout!"))) {
dialog_->labelwidthGB->setEnabled(true);
dialog_->labelWidth->setText(toqstr(labelwidth));
} else {
typedef QController<ControlPrefs, QView<QPrefsDialog> > base_class;
QPrefs::QPrefs(Dialog & parent)
- : base_class(parent, _("Preferences"))
+ : base_class(parent, lyx::to_utf8(_("Preferences")))
{
}
uiModule = new QPrefUIModule(this);
identityModule = new QPrefIdentityModule(this);
- string const laf = _("Look and feel");
+ string const laf = lyx::to_utf8(_("Look and feel"));
prefsPS->addCategory(laf);
- prefsPS->addPanel(uiModule, _("User interface"), laf);
- prefsPS->addPanel(screenfontsModule, _("Screen fonts"), laf);
- prefsPS->addPanel(colorsModule, _("Colors"), laf);
- prefsPS->addPanel(displayModule, _("Graphics"), laf);
- prefsPS->addPanel(keyboardModule, _("Keyboard"), laf);
+ prefsPS->addPanel(uiModule, lyx::to_utf8(_("User interface")), laf);
+ prefsPS->addPanel(screenfontsModule, lyx::to_utf8(_("Screen fonts")), laf);
+ prefsPS->addPanel(colorsModule, lyx::to_utf8(_("Colors")), laf);
+ prefsPS->addPanel(displayModule, lyx::to_utf8(_("Graphics")), laf);
+ prefsPS->addPanel(keyboardModule, lyx::to_utf8(_("Keyboard")), laf);
- string const ls = _("Language settings");
+ string const ls = lyx::to_utf8(_("Language settings"));
prefsPS->addCategory(ls);
- prefsPS->addPanel(languageModule, _("Language"), ls);
- prefsPS->addPanel(spellcheckerModule, _("Spellchecker"), ls);
+ prefsPS->addPanel(languageModule, lyx::to_utf8(_("Language")), ls);
+ prefsPS->addPanel(spellcheckerModule, lyx::to_utf8(_("Spellchecker")), ls);
- string const op = _("Outputs");
+ string const op = lyx::to_utf8(_("Outputs"));
prefsPS->addCategory(op);
- prefsPS->addPanel(asciiModule, _("Plain text"), op);
- prefsPS->addPanel(dateModule, _("Date format"), op);
- prefsPS->addPanel(latexModule, _("LaTeX"), op);
+ prefsPS->addPanel(asciiModule, lyx::to_utf8(_("Plain text")), op);
+ prefsPS->addPanel(dateModule, lyx::to_utf8(_("Date format")), op);
+ prefsPS->addPanel(latexModule, lyx::to_utf8(_("LaTeX")), op);
#if defined(__CYGWIN__) || defined(_WIN32)
- prefsPS->addPanel(cygwinpathModule, _("Paths"), op);
+ prefsPS->addPanel(cygwinpathModule, lyx::to_utf8(_("Paths")), op);
#endif
- prefsPS->addPanel(printerModule, _("Printer"), op);
+ prefsPS->addPanel(printerModule, lyx::to_utf8(_("Printer")), op);
- prefsPS->addPanel(identityModule, _("Identity"));
- prefsPS->addPanel(pathsModule, _("Paths"));
- prefsPS->addPanel(fileformatsModule, _("File formats"));
- prefsPS->addPanel(convertersModule, _("Converters"));
- prefsPS->addPanel(copiersModule, _("Copiers"));
+ prefsPS->addPanel(identityModule, lyx::to_utf8(_("Identity")));
+ prefsPS->addPanel(pathsModule, lyx::to_utf8(_("Paths")));
+ prefsPS->addPanel(fileformatsModule, lyx::to_utf8(_("File formats")));
+ prefsPS->addPanel(convertersModule, lyx::to_utf8(_("Converters")));
+ prefsPS->addPanel(copiersModule, lyx::to_utf8(_("Copiers")));
- prefsPS->setCurrentPanel(_("User interface"));
+ prefsPS->setCurrentPanel(lyx::to_utf8(_("User interface")));
// FIXME: put in controller
for (int i = 0; i < LColor::ignore; ++i) {
bool const document = fileformatsModule->documentCB->isChecked();
form_->formats().add(name, extension, prettyname, shortcut, viewer,
- editor, document);
+ editor, document);
form_->formats().sort();
updateFormats();
fileformatsModule->formatsLB->setCurrentItem(form_->formats().getNumber(name));
bool const document = fileformatsModule->documentCB->isChecked();
form_->formats().add(name, extension, prettyname, shortcut, viewer,
- editor, document);
+ editor, document);
form_->formats().sort();
fileformatsModule->formatsLB->setUpdatesEnabled(false);
return;
string const current_text = form_->formats().get(nr).name();
if (form_->converters().formatIsUsed(current_text)) {
- Alert::error(_("Format in use"),
- _("Cannot remove a Format used by a Converter. "
- "Remove the converter first."));
+ Alert::error(lyx::to_utf8(_("Format in use")),
+ lyx::to_utf8(_("Cannot remove a Format used by a Converter. "
+ "Remove the converter first.")));
return;
}
form_->formats().erase(current_text);
}
-// NB: the _() is OK here because it gets passed back and we toqstr() them
+// NB: the lyx::to_utf8(_() is OK here because it gets passed back and we toqstr()) them
void QPrefsDialog::select_templatedir()
{
- string file(form_->controller().browsedir(fromqstr(pathsModule->templateDirED->text()), _("Select a document templates directory")));
+ string file(form_->controller().browsedir(fromqstr(pathsModule->templateDirED->text()), lyx::to_utf8(_("Select a document templates directory"))));
if (!file.empty())
pathsModule->templateDirED->setText(toqstr(file));
}
void QPrefsDialog::select_tempdir()
{
- string file(form_->controller().browsedir(fromqstr(pathsModule->tempDirED->text()), _("Select a temporary directory")));
+ string file(form_->controller().browsedir(fromqstr(pathsModule->tempDirED->text()), lyx::to_utf8(_("Select a temporary directory"))));
if (!file.empty())
pathsModule->tempDirED->setText(toqstr(file));
}
void QPrefsDialog::select_backupdir()
{
- string file(form_->controller().browsedir(fromqstr(pathsModule->backupDirED->text()), _("Select a backups directory")));
+ string file(form_->controller().browsedir(fromqstr(pathsModule->backupDirED->text()), lyx::to_utf8(_("Select a backups directory"))));
if (!file.empty())
pathsModule->backupDirED->setText(toqstr(file));
}
void QPrefsDialog::select_workingdir()
{
- string file(form_->controller().browsedir(fromqstr(pathsModule->workingDirED->text()), _("Select a document directory")));
+ string file(form_->controller().browsedir(fromqstr(pathsModule->workingDirED->text()), lyx::to_utf8(_("Select a document directory"))));
if (!file.empty())
pathsModule->workingDirED->setText(toqstr(file));
}
void QPrefsDialog::select_lyxpipe()
{
- string file(form_->controller().browse(fromqstr(pathsModule->lyxserverDirED->text()), _("Give a filename for the LyX server pipe")));
+ string file(form_->controller().browse(fromqstr(pathsModule->lyxserverDirED->text()), lyx::to_utf8(_("Give a filename for the LyX server pipe"))));
if (!file.empty())
pathsModule->lyxserverDirED->setText(toqstr(file));
}
QPrint::QPrint(Dialog & parent)
- : base_class(parent, _("Print Document"))
+ : base_class(parent, lyx::to_utf8(_("Print Document")))
{
}
QRef::QRef(Dialog & parent)
- : base_class(parent, _("Cross-reference")),
+ : base_class(parent, lyx::to_utf8(_("Cross-reference"))),
sort_(false), at_ref_(false)
{
}
QSearch::QSearch(Dialog & parent)
- : base_class(parent, _("Find and Replace"))
+ : base_class(parent, lyx::to_utf8(_("Find and Replace")))
{
}
QSendto::QSendto(Dialog & parent)
- : base_class(parent, _("Send Document to Command"))
+ : base_class(parent, lyx::to_utf8(_("Send Document to Command")))
{
}
QShowFile::QShowFile(Dialog & parent)
- : base_class(parent, _("Show File"))
+ : base_class(parent, lyx::to_utf8(_("Show File")))
{
}
QSpellchecker::QSpellchecker(Dialog & parent)
- : base_class(parent, _("Spellchecker"))
+ : base_class(parent, lyx::to_utf8(_("Spellchecker")))
{}
typedef QController<ControlTabular, QView<QTabularDialog> > base_class;
QTabular::QTabular(Dialog & parent)
- : base_class(parent, _("Table Settings"))
+ : base_class(parent, lyx::to_utf8(_("Table Settings")))
{
}
QTabularCreate::QTabularCreate(Dialog & parent)
- : base_class(parent, _("Insert Table"))
+ : base_class(parent, lyx::to_utf8(_("Insert Table")))
{
}
typedef QController<ControlTexinfo, QView<QTexinfoDialog> > base_class;
QTexinfo::QTexinfo(Dialog & parent)
- : base_class(parent, _("TeX Information")),
+ : base_class(parent, lyx::to_utf8(_("TeX Information"))),
warningPosted(false), activeStyle(ControlTexinfo::cls)
{
}
typedef QController<ControlThesaurus, QView<QThesaurusDialog> > base_class;
QThesaurus::QThesaurus(Dialog & parent)
- : base_class(parent, _("Thesaurus"))
+ : base_class(parent, lyx::to_utf8(_("Thesaurus")))
{
}
typedef QController<ControlToc, QView<QTocDialog> > base_class;
QToc::QToc(Dialog & parent)
- : base_class(parent, _("Table of Contents")), depth_(1)
+ : base_class(parent, lyx::to_utf8(_("Table of Contents"))), depth_(1)
{}
typedef QController<ControlCommand, QView<QURLDialog> > base_class;
QURL::QURL(Dialog & parent)
- : base_class(parent, _("URL"))
+ : base_class(parent, lyx::to_utf8(_("URL")))
{
}
typedef QController<ControlVSpace, QView<QVSpaceDialog> > base_class;
QVSpace::QVSpace(Dialog & parent)
- : base_class(parent, _("Vertical Space Settings"))
+ : base_class(parent, lyx::to_utf8(_("Vertical Space Settings")))
{}
typedef QController<ControlWrap, QView<QWrapDialog> > base_class;
QWrap::QWrap(Dialog & parent)
- : base_class(parent, _("Text Wrap Settings"))
+ : base_class(parent, lyx::to_utf8(_("Text Wrap Settings")))
{
}
public:
///
Qt2BC(ButtonController const &,
- std::string const & = _("Cancel"), std::string const & = _("Close"));
+ std::string const & = lyx::to_utf8(_("Cancel")),
+ std::string const & = lyx::to_utf8(_("Close")));
private:
/// Updates the button sensitivity (enabled/disabled)
void setButtonEnabled(QButton *, bool enabled) const;
if (it != begin)
ss << ", ";
if (*it == ' ')
- ss << _("space");
+ ss << lyx::to_utf8(_("space"));
else
ss << *it;
}
static int counter = 0;
if (counter == 0) {
- Alert::error(_("Invalid filename"),
- _("LyX does not provide LateX support for file names containing any of these characters:\n") +
+ Alert::error(lyx::to_utf8(_("Invalid filename")),
+ lyx::to_utf8(_("LyX does not provide LateX support for file names containing any of these characters:\n")) +
printable_list(invalid_chars));
}
++counter;
int default_button, int cancel_button,
string const & b1, string const & b2, string const & b3)
{
- string const title = bformat(_("LyX: %1$s"), tit);
+ string const title = bformat(lyx::to_utf8(_("LyX: %1$s")), tit);
// FIXME replace that with theApp->gui()->currentView()
int res = QMessageBox::information(qApp->focusWidget(),
void warning_pimpl(string const & tit, string const & message)
{
- string const title = bformat(_("LyX: %1$s"), tit);
+ string const title = bformat(lyx::to_utf8(_("LyX: %1$s")), tit);
QMessageBox::warning(qApp->focusWidget(),
toqstr(title),
toqstr(formatted(message)));
void error_pimpl(string const & tit, string const & message)
{
- string const title = bformat(_("LyX: %1$s"), tit);
+ string const title = bformat(lyx::to_utf8(_("LyX: %1$s")), tit);
QMessageBox::critical(qApp->focusWidget(),
toqstr(title),
toqstr(formatted(message)));
void information_pimpl(string const & tit, string const & message)
{
- string const title = bformat(_("LyX: %1$s"), tit);
+ string const title = bformat(lyx::to_utf8(_("LyX: %1$s")), tit);
QMessageBox::information(qApp->focusWidget(),
toqstr(title),
toqstr(formatted(message)));
pair<bool, string> const
askForText_pimpl(string const & msg, string const & dflt)
{
- string const title = bformat(_("LyX: %1$s"), msg);
+ string const title = bformat(lyx::to_utf8(_("LyX: %1$s")), msg);
bool ok;
QString text = QInputDialog::getText(qApp->focusWidget(),
} else if (name == "index") {
dialog->setController(new ControlCommand(*dialog, name));
dialog->setView(new QIndex(*dialog,
- _("Index Entry"),
+ lyx::to_utf8(_("Index Entry")),
qt_("&Keyword:")));
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
} else if (name == "label") {
dialog->setController(new ControlCommand(*dialog, name));
dialog->setView(new QIndex(*dialog,
- _("Label"),
+ lyx::to_utf8(_("Label")),
qt_("&Label:")));
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
} else if (name == "log") {
qApp->focusWidget(),
title_.c_str(),toqstr(startsWith) ));
#else
- FileFilterList const filter(_("Directories"));
+ FileFilterList const filter(lyx::to_utf8(_("Directories")));
LyXFileDialog dlg(title_, path, filter, private_->b1, private_->b2);
typedef QController<ControlAboutlyx, QView<QAboutDialog> > base_class;
QAbout::QAbout(Dialog & parent)
- : base_class(parent, _("About LyX"))
+ : base_class(parent, lyx::to_utf8(_("About LyX")))
{
}
QBibitem::QBibitem(Dialog & parent)
- : base_class(parent, _("Bibliography Entry Settings"))
+ : base_class(parent, lyx::to_utf8(_("Bibliography Entry Settings")))
{
}
typedef QController<ControlBibtex, QView<QBibtexDialog> > base_class;
QBibtex::QBibtex(Dialog & parent)
- : base_class(parent, _("BibTeX Bibliography"))
+ : base_class(parent, lyx::to_utf8(_("BibTeX Bibliography")))
{
}
typedef QController<ControlBox, QView<QBoxDialog> > base_class;
QBox::QBox(Dialog & parent)
- : base_class(parent, _("Box Settings"))
+ : base_class(parent, lyx::to_utf8(_("Box Settings")))
{}
QBranch::QBranch(Dialog & parent)
- : base_class(parent, _("Branch Settings"))
+ : base_class(parent, lyx::to_utf8(_("Branch Settings")))
{}
QChanges::QChanges(Dialog & parent)
- : base_class(parent, _("Merge Changes"))
+ : base_class(parent, lyx::to_utf8(_("Merge Changes")))
{
}
string date(controller().getChangeDate());
if (!author.empty())
- text += bformat(_("Change by %1$s\n\n"), author);
+ text += bformat(lyx::to_utf8(_("Change by %1$s\n\n")), author);
if (!date.empty())
- text += bformat(_("Change made at %1$s\n"), date);
+ text += bformat(lyx::to_utf8(_("Change made at %1$s\n")), date);
dialog_->changeTB->setPlainText(toqstr(text));
}
QCharacter::QCharacter(Dialog & parent)
- : base_class(parent, _("Text Style"))
+ : base_class(parent, lyx::to_utf8(_("Text Style")))
{
}
QDocument::QDocument(Dialog & parent)
- : base_class(parent, _("Document Settings"))
+ : base_class(parent, lyx::to_utf8(_("Document Settings")))
{}
latexModule->classCO->addItem(toqstr(cit->description()));
} else {
string item =
- bformat(_("Unavailable: %1$s"), cit->description());
+ bformat(lyx::to_utf8(_("Unavailable: %1$s")), cit->description());
latexModule->classCO->addItem(toqstr(item));
}
}
floatModule = new FloatPlacement;
connect(floatModule, SIGNAL(changed()), this, SLOT(change_adaptor()));
- docPS->addPanel(latexModule, _("Document Class"));
- docPS->addPanel(fontModule, _("Fonts"));
- docPS->addPanel(textLayoutModule, _("Text Layout"));
- docPS->addPanel(pageLayoutModule, _("Page Layout"));
- docPS->addPanel(marginsModule, _("Page Margins"));
- docPS->addPanel(langModule, _("Language"));
- docPS->addPanel(numberingModule, _("Numbering & TOC"));
- docPS->addPanel(biblioModule, _("Bibliography"));
- docPS->addPanel(mathsModule, _("Math Options"));
- docPS->addPanel(floatModule, _("Float Placement"));
- docPS->addPanel(bulletsModule, _("Bullets"));
- docPS->addPanel(branchesModule, _("Branches"));
- docPS->addPanel(preambleModule, _("LaTeX Preamble"));
- docPS->setCurrentPanel(_("Document Class"));
+ docPS->addPanel(latexModule, lyx::to_utf8(_("Document Class")));
+ docPS->addPanel(fontModule, lyx::to_utf8(_("Fonts")));
+ docPS->addPanel(textLayoutModule, lyx::to_utf8(_("Text Layout")));
+ docPS->addPanel(pageLayoutModule, lyx::to_utf8(_("Page Layout")));
+ docPS->addPanel(marginsModule, lyx::to_utf8(_("Page Margins")));
+ docPS->addPanel(langModule, lyx::to_utf8(_("Language")));
+ docPS->addPanel(numberingModule, lyx::to_utf8(_("Numbering & TOC")));
+ docPS->addPanel(biblioModule, lyx::to_utf8(_("Bibliography")));
+ docPS->addPanel(mathsModule, lyx::to_utf8(_("Math Options")));
+ docPS->addPanel(floatModule, lyx::to_utf8(_("Float Placement")));
+ docPS->addPanel(bulletsModule, lyx::to_utf8(_("Bullets")));
+ docPS->addPanel(branchesModule, lyx::to_utf8(_("Branches")));
+ docPS->addPanel(preambleModule, lyx::to_utf8(_("LaTeX Preamble")));
+ docPS->setCurrentPanel(lyx::to_utf8(_("Document Class")));
}
void QDocumentDialog::showPreamble()
{
- docPS->setCurrentPanel(_("LaTeX Preamble"));
+ docPS->setCurrentPanel(lyx::to_utf8(_("LaTeX Preamble")));
}
QERT::QERT(Dialog & parent)
- : base_class(parent, _("TeX Code Settings"))
+ : base_class(parent, lyx::to_utf8(_("TeX Code Settings")))
{
}
typedef QController<ControlExternal, QView<QExternalDialog> > base_class;
QExternal::QExternal(Dialog & parent)
- : base_class(parent, _("External Material"))
+ : base_class(parent, lyx::to_utf8(_("External Material")))
{}
QFloat::QFloat(Dialog & parent)
- : base_class(parent, _("Float Settings"))
+ : base_class(parent, lyx::to_utf8(_("Float Settings")))
{
}
typedef QController<ControlGraphics, QView<QGraphicsDialog> > base_class;
QGraphics::QGraphics(Dialog & parent)
- : base_class(parent, _("Graphics"))
+ : base_class(parent, lyx::to_utf8(_("Graphics")))
{
}
QInclude::QInclude(Dialog & parent)
- : base_class(parent, _("Child Document"))
+ : base_class(parent, lyx::to_utf8(_("Child Document")))
{}
QMath::QMath(Dialog & parent)
- : math_base(parent, _("Math Panel"))
+ : math_base(parent, lyx::to_utf8(_("Math Panel")))
{}
QMathMatrix::QMathMatrix(Dialog & parent)
- : matrix_base(parent, _("Math Matrix"))
+ : matrix_base(parent, lyx::to_utf8(_("Math Matrix")))
{}
QMathDelimiter::QMathDelimiter(Dialog & parent)
- : delimiter_base(parent, _("Math Delimiter"))
+ : delimiter_base(parent, lyx::to_utf8(_("Math Delimiter")))
{}
QNote::QNote(Dialog & parent)
- : base_class(parent, _("Note Settings"))
+ : base_class(parent, lyx::to_utf8(_("Note Settings")))
{}
QParagraph::QParagraph(Dialog & parent)
- : base_class(parent, _("Paragraph Settings"))
+ : base_class(parent, lyx::to_utf8(_("Paragraph Settings")))
{}
// label width
string const & labelwidth = params.labelWidthString();
- // _() is correct here (this is stupid though !)
- if (labelwidth != _("Senseless with this layout!")) {
+ // lyx::to_utf8(_() is correct here (this is stupid though !))
+ if (labelwidth != lyx::to_utf8(_("Senseless with this layout!"))) {
dialog_->labelwidthGB->setEnabled(true);
dialog_->labelWidth->setText(toqstr(labelwidth));
} else {
typedef QController<ControlPrefs, QView<QPrefsDialog> > base_class;
QPrefs::QPrefs(Dialog & parent)
- : base_class(parent, _("Preferences"))
+ : base_class(parent, lyx::to_utf8(_("Preferences")))
{
}
PrefAscii::PrefAscii(QWidget * parent)
-: PrefModule(_(Outputs), _("Plain text"), 0, parent)
+: PrefModule(lyx::to_utf8(_(Outputs)), lyx::to_utf8(_("Plain text")), 0, parent)
{
setupUi(this);
connect(asciiLinelengthSB, SIGNAL(valueChanged(int)),
PrefDate::PrefDate(QWidget * parent)
-: PrefModule(_(Outputs), _("Date format"), 0, parent)
+: PrefModule(lyx::to_utf8(_(Outputs)), lyx::to_utf8(_("Date format")), 0, parent)
{
setupUi(this);
connect(DateED, SIGNAL(textChanged(const QString&)),
PrefKeyboard::PrefKeyboard(QPrefs * form, QWidget * parent)
-: PrefModule(_(LookAndFeel), _("Keyboard"), form, parent)
+: PrefModule(lyx::to_utf8(_(LookAndFeel)), lyx::to_utf8(_("Keyboard")), form, parent)
{
setupUi(this);
PrefLatex::PrefLatex(QPrefs * form, QWidget * parent)
-: PrefModule(_(Outputs), _("LaTeX"), form, parent)
+: PrefModule(lyx::to_utf8(_(Outputs)), lyx::to_utf8(_("LaTeX")), form, parent)
{
setupUi(this);
connect(latexEncodingED, SIGNAL(textChanged(const QString&)),
PrefScreenFonts::PrefScreenFonts(QPrefs * form, QWidget * parent)
-: PrefModule(_(LookAndFeel), _("Screen fonts"), form, parent)
+: PrefModule(lyx::to_utf8(_(LookAndFeel)), lyx::to_utf8(_("Screen fonts")), form, parent)
{
setupUi(this);
PrefColors::PrefColors(QPrefs * form, QWidget * parent)
-: PrefModule(_(LookAndFeel), _("Colors"), form, parent)
+: PrefModule(lyx::to_utf8(_(LookAndFeel)), lyx::to_utf8(_("Colors")), form, parent)
{
setupUi(this);
PrefCygwinPath::PrefCygwinPath(QWidget * parent)
-: PrefModule(_(Outputs), _("Paths"), 0, parent)
+: PrefModule(lyx::to_utf8(_(Outputs)), lyx::to_utf8(_("Paths")), 0, parent)
{
setupUi(this);
connect(pathCB, SIGNAL(toggled(bool)),
PrefDisplay::PrefDisplay(QWidget * parent)
-: PrefModule(_(LookAndFeel), _("Graphics"), 0, parent)
+: PrefModule(lyx::to_utf8(_(LookAndFeel)), lyx::to_utf8(_("Graphics")), 0, parent)
{
setupUi(this);
connect(instantPreviewCO, SIGNAL(activated(int)),
PrefPaths::PrefPaths(QPrefs * form, QWidget * parent)
-: PrefModule(string(), _("Paths"), form, parent)
+: PrefModule(string(), lyx::to_utf8(_("Paths")), form, parent)
{
setupUi(this);
connect(templateDirPB, SIGNAL(clicked()), this, SLOT(select_templatedir()));
lyxserverDirED->setText(external_path(rc.lyxpipes));
}
-// NB: the _() is OK here because it gets passed back and we toqstr() them
+// NB: the lyx::to_utf8(_() is OK here because it gets passed back and we toqstr()) them
void PrefPaths::select_templatedir()
{
- string file(form_->controller().browsedir(fromqstr(templateDirED->text()), _("Select a document templates directory")));
+ string file(form_->controller().browsedir(fromqstr(templateDirED->text()), lyx::to_utf8(_("Select a document templates directory"))));
if (!file.empty())
templateDirED->setText(toqstr(file));
}
void PrefPaths::select_tempdir()
{
- string file(form_->controller().browsedir(fromqstr(tempDirED->text()), _("Select a temporary directory")));
+ string file(form_->controller().browsedir(fromqstr(tempDirED->text()), lyx::to_utf8(_("Select a temporary directory"))));
if (!file.empty())
tempDirED->setText(toqstr(file));
}
void PrefPaths::select_backupdir()
{
- string file(form_->controller().browsedir(fromqstr(backupDirED->text()), _("Select a backups directory")));
+ string file(form_->controller().browsedir(fromqstr(backupDirED->text()), lyx::to_utf8(_("Select a backups directory"))));
if (!file.empty())
backupDirED->setText(toqstr(file));
}
void PrefPaths::select_workingdir()
{
- string file(form_->controller().browsedir(fromqstr(workingDirED->text()), _("Select a document directory")));
+ string file(form_->controller().browsedir(fromqstr(workingDirED->text()), lyx::to_utf8(_("Select a document directory"))));
if (!file.empty())
workingDirED->setText(toqstr(file));
}
void PrefPaths::select_lyxpipe()
{
- string file(form_->controller().browse(fromqstr(lyxserverDirED->text()), _("Give a filename for the LyX server pipe")));
+ string file(form_->controller().browse(fromqstr(lyxserverDirED->text()), lyx::to_utf8(_("Give a filename for the LyX server pipe"))));
if (!file.empty())
lyxserverDirED->setText(toqstr(file));
}
PrefSpellchecker::PrefSpellchecker(QPrefs * form, QWidget * parent)
-: PrefModule(_(LanguageSettings), _("Spellchecker"), form, parent)
+: PrefModule(lyx::to_utf8(_(LanguageSettings)), lyx::to_utf8(_("Spellchecker")), form, parent)
{
setupUi(this);
PrefConverters::PrefConverters(QPrefs * form, QWidget * parent)
-: PrefModule(string(), _("Converters"), form, parent)
+: PrefModule(string(), lyx::to_utf8(_("Converters")), form, parent)
{
setupUi(this);
PrefCopiers::PrefCopiers(QPrefs * form, QWidget * parent)
-: PrefModule(string(), _("Copiers"), form, parent)
+: PrefModule(string(), lyx::to_utf8(_("Copiers")), form, parent)
{
setupUi(this);
PrefFileformats::PrefFileformats(QPrefs * form, QWidget * parent)
-: PrefModule(string(), _("File formats"), form, parent)
+: PrefModule(string(), lyx::to_utf8(_("File formats")), form, parent)
{
setupUi(this);
return;
string const current_text = form_->formats().get(nr).name();
if (form_->converters().formatIsUsed(current_text)) {
- Alert::error(_("Format in use"),
- _("Cannot remove a Format used by a Converter. "
- "Remove the converter first."));
+ Alert::error(lyx::to_utf8(_("Format in use")),
+ lyx::to_utf8(_("Cannot remove a Format used by a Converter. "
+ "Remove the converter first.")));
return;
}
PrefLanguage::PrefLanguage(QWidget * parent)
-: PrefModule(string(), _("Language"), 0, parent)
+: PrefModule(string(), lyx::to_utf8(_("Language")), 0, parent)
{
setupUi(this);
PrefPrinter::PrefPrinter(QWidget * parent)
-: PrefModule(_(Outputs), _("Printer"), 0, parent)
+: PrefModule(lyx::to_utf8(_(Outputs)), lyx::to_utf8(_("Printer")), 0, parent)
{
setupUi(this);
PrefUserInterface::PrefUserInterface(QPrefs * form, QWidget * parent)
-: PrefModule(_(LookAndFeel), _("User interface"), form, parent)
+: PrefModule(lyx::to_utf8(_(LookAndFeel)), lyx::to_utf8(_("User interface")), form, parent)
{
setupUi(this);
this, SIGNAL(changed()));
connect(loadSessionCB, SIGNAL(toggled(bool)),
this, SIGNAL(changed()));
- connect(loadWindowSizeCB, SIGNAL(toggled(bool)),
+ connect(loadWindowSizeCB, SIGNAL(toggled(bool)),
this, SIGNAL(changed()));
- connect(loadWindowSizeCB, SIGNAL(toggled(bool)),
+ connect(loadWindowSizeCB, SIGNAL(toggled(bool)),
windowWidthLA, SLOT(setDisabled(bool)));
- connect(loadWindowSizeCB, SIGNAL(toggled(bool)),
+ connect(loadWindowSizeCB, SIGNAL(toggled(bool)),
windowHeightLA, SLOT(setDisabled(bool)));
- connect(loadWindowSizeCB, SIGNAL(toggled(bool)),
+ connect(loadWindowSizeCB, SIGNAL(toggled(bool)),
windowWidthSB, SLOT(setDisabled(bool)));
- connect(loadWindowSizeCB, SIGNAL(toggled(bool)),
+ connect(loadWindowSizeCB, SIGNAL(toggled(bool)),
windowHeightSB, SLOT(setDisabled(bool)));
- connect(loadWindowLocationCB, SIGNAL(toggled(bool)),
+ connect(loadWindowLocationCB, SIGNAL(toggled(bool)),
this, SIGNAL(changed()));
- connect(windowWidthSB, SIGNAL(valueChanged(int)),
+ connect(windowWidthSB, SIGNAL(valueChanged(int)),
this, SIGNAL(changed()));
- connect(windowHeightSB, SIGNAL(valueChanged(int)),
+ connect(windowHeightSB, SIGNAL(valueChanged(int)),
this, SIGNAL(changed()));
connect(cursorFollowsCB, SIGNAL(toggled(bool)),
this, SIGNAL(changed()));
PrefIdentity::PrefIdentity(QWidget * parent)
-: PrefModule(string(), _("Identity"), 0, parent)
+: PrefModule(string(), lyx::to_utf8(_("Identity")), 0, parent)
{
setupUi(this);
add(new PrefUserInterface(form_));
add(new PrefIdentity);
- prefsPS->setCurrentPanel(_("User interface"));
+ prefsPS->setCurrentPanel(lyx::to_utf8(_("User interface")));
form_->bcview().setOK(savePB);
form_->bcview().setApply(applyPB);
QPrint::QPrint(Dialog & parent)
- : base_class(parent, _("Print Document"))
+ : base_class(parent, lyx::to_utf8(_("Print Document")))
{
}
QRef::QRef(Dialog & parent)
- : base_class(parent, _("Cross-reference")),
+ : base_class(parent, lyx::to_utf8(_("Cross-reference"))),
sort_(false), at_ref_(false)
{
}
QSearch::QSearch(Dialog & parent)
- : base_class(parent, _("Find and Replace"))
+ : base_class(parent, lyx::to_utf8(_("Find and Replace")))
{
}
QSendto::QSendto(Dialog & parent)
- : base_class(parent, _("Send Document to Command"))
+ : base_class(parent, lyx::to_utf8(_("Send Document to Command")))
{
}
QShowFile::QShowFile(Dialog & parent)
- : base_class(parent, _("Show File"))
+ : base_class(parent, lyx::to_utf8(_("Show File")))
{
}
typedef QController<ControlSpellchecker, QView<QSpellcheckerDialog> > base_class;
QSpellchecker::QSpellchecker(Dialog & parent)
- : base_class(parent, _("Spellchecker"))
+ : base_class(parent, lyx::to_utf8(_("Spellchecker")))
{}
typedef QController<ControlTabular, QView<QTabularDialog> > base_class;
QTabular::QTabular(Dialog & parent)
- : base_class(parent, _("Table Settings"))
+ : base_class(parent, lyx::to_utf8(_("Table Settings")))
{
}
QTabularCreate::QTabularCreate(Dialog & parent)
- : base_class(parent, _("Insert Table"))
+ : base_class(parent, lyx::to_utf8(_("Insert Table")))
{
}
typedef QController<ControlTexinfo, QView<QTexinfoDialog> > base_class;
QTexinfo::QTexinfo(Dialog & parent)
- : base_class(parent, _("TeX Information")),
+ : base_class(parent, lyx::to_utf8(_("TeX Information"))),
warningPosted(false), activeStyle(ControlTexinfo::cls)
{
}
typedef QController<ControlThesaurus, QView<QThesaurusDialog> > base_class;
QThesaurus::QThesaurus(Dialog & parent)
- : base_class(parent, _("Thesaurus"))
+ : base_class(parent, lyx::to_utf8(_("Thesaurus")))
{
}
typedef QController<ControlVSpace, QView<QVSpaceDialog> > base_class;
QVSpace::QVSpace(Dialog & parent)
- : base_class(parent, _("Vertical Space Settings"))
+ : base_class(parent, lyx::to_utf8(_("Vertical Space Settings")))
{}
typedef QController<ControlWrap, QView<QWrapDialog> > base_class;
QWrap::QWrap(Dialog & parent)
- : base_class(parent, _("Text Wrap Settings"))
+ : base_class(parent, lyx::to_utf8(_("Text Wrap Settings")))
{
}
public:
///
Qt2BC(ButtonController const &,
- std::string const & = _("Cancel"), std::string const & = _("Close"));
+ std::string const & = lyx::to_utf8(_("Cancel")),
+ std::string const & = lyx::to_utf8(_("Close")));
private:
/// Updates the button sensitivity (enabled/disabled)
void setButtonEnabled(QPushButton *, bool enabled) const;
typedef QController< ControlCommand, QView<QURLDialog> > base_class;
UrlView::UrlView(Dialog & parent)
- : base_class(parent, _("URL"))
+ : base_class(parent, lyx::to_utf8(_("URL")))
{
}
QString const qt_(char const * str)
{
- return toqstr(_(str));
+ return toqstr(lyx::to_utf8(_(str)));
}
QString const qt_(string const & str)
{
- return toqstr(_(str));
+ return toqstr(lyx::to_utf8(_(str)));
}
if (it != begin)
ss << ", ";
if (*it == ' ')
- ss << _("space");
+ ss << lyx::to_utf8(_("space"));
else
ss << *it;
}
static int counter = 0;
if (counter == 0) {
- Alert::error(_("Invalid filename"),
- _("LyX does not provide LateX support for file names containing any of these characters:\n") +
+ Alert::error(lyx::to_utf8(_("Invalid filename")),
+ lyx::to_utf8(_("LyX does not provide LateX support for file names containing any of these characters:\n")) +
printable_list(invalid_chars));
}
++counter;
# include <locale.h>
#endif
-using std::string;
using lyx::support::setEnv;
+using lyx::docstring;
+
+using std::string;
namespace {
} // anon namespace
-string const _(string const & str)
+docstring const _(string const & str)
{
- return lyx::to_utf8(getLyXMessages().get(str));
+ return getLyXMessages().get(str);
}
#ifndef GETTEXT_H
#define GETTEXT_H
+#include "support/docstring.h"
+
#include <string>
/*
//#ifdef ENABLE_NLS
///
-std::string const _(std::string const &);
+lyx::docstring const _(std::string const &);
//#else // ENABLE_NLS
string const & format, ErrorList & errorList)
{
string const displaypath = makeDisplayPath(filename);
- lv->message(bformat(_("Importing %1$s..."), displaypath));
+ lv->message(bformat(lyx::to_utf8(_("Importing %1$s...")), displaypath));
string const lyxfile = changeExtension(filename, ".lyx");
}
}
if (loader_format.empty()) {
- Alert::error(_("Couldn't import file"),
- bformat(_("No information for importing the format %1$s."),
+ Alert::error(lyx::to_utf8(_("Couldn't import file")),
+ bformat(lyx::to_utf8(_("No information for importing the format %1$s.")),
formats.prettyName(format)));
return false;
}
}
// we are done
- lv->message(_("imported."));
+ lv->message(lyx::to_utf8(_("imported.")));
return true;
}
std::string const InsetBase::editMessage() const
{
- return _("Opened inset");
+ // FIXME UNICODE
+ return lyx::to_utf8(_("Opened inset"));
}
string const InsetBibtex::getScreenLabel(Buffer const &) const
{
- return _("BibTeX Generated Bibliography");
+ // FIXME UNICODE
+ return lyx::to_utf8(_("BibTeX Generated Bibliography"));
}
runparams.nice && db_out.find(' ') != string::npos) {
warned_about_spaces = true;
- Alert::warning(_("Export Warning!"),
- _("There are spaces in the paths to your BibTeX databases.\n"
- "BibTeX will be unable to find them."));
+ // FIXME UNICODE
+ Alert::warning(lyx::to_utf8(_("Export Warning!")),
+ lyx::to_utf8(_("There are spaces in the paths to your BibTeX databases.\n"
+ "BibTeX will be unable to find them.")));
}
static bool warned_about_bst_spaces = false;
if (!warned_about_bst_spaces && runparams.nice && contains(style, ' ')) {
warned_about_bst_spaces = true;
- Alert::warning(_("Export Warning!"),
- _("There are spaces in the path to your BibTeX style file.\n"
- "BibTeX will be unable to find it."));
+ // FIXME UNICODE
+ Alert::warning(lyx::to_utf8(_("Export Warning!")),
+ lyx::to_utf8(_("There are spaces in the path to your BibTeX style file.\n"
+ "BibTeX will be unable to find it.")));
}
if (!db_out.empty() && buffer.params().use_bibtopic){
typedef Translator<std::string, InsetBox::BoxType> BoxTranslator;
-BoxTranslator const init_boxtranslator() {
+BoxTranslator const init_boxtranslator()
+{
BoxTranslator translator("Boxed", InsetBox::Boxed);
translator.addPair("Frameless", InsetBox::Frameless);
translator.addPair("ovalbox", InsetBox::ovalbox);
}
-BoxTranslator const init_boxtranslator_loc() {
- BoxTranslator translator(_("Boxed"), InsetBox::Boxed);
- translator.addPair(_("Frameless"), InsetBox::Frameless);
- translator.addPair(_("ovalbox"), InsetBox::ovalbox);
- translator.addPair(_("Ovalbox"), InsetBox::Ovalbox);
- translator.addPair(_("Shadowbox"), InsetBox::Shadowbox);
- translator.addPair(_("Doublebox"), InsetBox::Doublebox);
+BoxTranslator const init_boxtranslator_loc()
+{
+ // FIXME UNICODE
+ BoxTranslator translator(lyx::to_utf8(_("Boxed")), InsetBox::Boxed);
+ translator.addPair(lyx::to_utf8(_("Frameless")), InsetBox::Frameless);
+ translator.addPair(lyx::to_utf8(_("ovalbox")), InsetBox::ovalbox);
+ translator.addPair(lyx::to_utf8(_("Ovalbox")), InsetBox::Ovalbox);
+ translator.addPair(lyx::to_utf8(_("Shadowbox")), InsetBox::Shadowbox);
+ translator.addPair(lyx::to_utf8(_("Doublebox")), InsetBox::Doublebox);
return translator;
}
-BoxTranslator const & boxtranslator() {
+BoxTranslator const & boxtranslator()
+{
static BoxTranslator translator = init_boxtranslator();
return translator;
}
-BoxTranslator const & boxtranslator_loc() {
+BoxTranslator const & boxtranslator_loc()
+{
static BoxTranslator translator = init_boxtranslator_loc();
return translator;
}
string const InsetBox::editMessage() const
{
- return _("Opened Box Inset");
+ return lyx::to_utf8(_("Opened Box Inset"));
}
font.decSize();
BoxType btype = boxtranslator().find(params_.type);
+
+ string label;
+ // FIXME UNICODE
+ label += lyx::to_utf8(_("Box"));
+ label += " (";
if (btype == Frameless) {
if (params_.use_parbox)
- setLabel(_("Box") + " (" + _("Parbox") + ")");
+ label += lyx::to_utf8(_("Parbox"));
else
- setLabel(_("Box") + " (" + _("Minipage") + ")");
+ label += lyx::to_utf8(_("Minipage"));
} else
- setLabel(_("Box") + " (" + boxtranslator_loc().find(btype) + ")");
+ label += boxtranslator_loc().find(btype);
+ label += ")";
+
+ setLabel(label);
font.setColor(LColor::foreground);
setBackgroundColor(LColor::background);
string const InsetBranch::editMessage() const
{
- return _("Opened Branch Inset");
+ // FIXME UNICODE
+ return lyx::to_utf8(_("Opened Branch Inset"));
}
font.decSize();
font.decSize();
- string s = _("Branch: ") + params_.branch;
+ // FIXME UNICODE
+ string s = lyx::to_utf8(_("Branch: ")) + params_.branch;
font.setColor(LColor::foreground);
if (!params_.branch.empty()) {
LColor_color c = lcolor.getFromLyXName(params_.branch);
if (c == LColor::none) {
c = LColor::error;
- s = _("Undef: ") + s;
+ // FIXME UNICODE
+ s = lyx::to_utf8(_("Undef: ")) + s;
}
setBackgroundColor(c);
} else
string const InsetCaption::editMessage() const
{
- return _("Opened Caption Inset");
+ // FIXME UNICODE
+ return lyx::to_utf8(_("Opened Caption Inset"));
}
{
// Set caption label _only_ if the cursor is in _this_ float:
if (cur.top().text() == &text_) {
- string s;
+ string s;
size_t i = cur.depth();
while (i > 0) {
--i;
string num;
if (s.empty())
s = "Senseless";
- else
+ else
num = convert<string>(counter_);
// Generate the label
- label = bformat("%1$s %2$s:", _(s), num);
+ label = bformat("%1$s %2$s:", lyx::to_utf8(_(s)), num);
}
}
mi.base.textwidth -= 2 * TEXT_TO_INSET_OFFSET;
LCursor cur = mi.base.bv->cursor();
setLabel(cur);
- docstring dlab(label.begin(), label.end());
+ docstring dlab(label.begin(), label.end());
labelwidth_ = font_metrics::width(dlab, mi.base.font);
dim.wid = labelwidth_;
Dimension textdim;
// belongs to.
LCursor cur = pi.base.bv->cursor();
setLabel(cur);
- docstring dlab(label.begin(), label.end());
+ docstring dlab(label.begin(), label.end());
labelwidth_ = font_metrics::width(dlab, pi.base.font);
pi.pain.text(x, y, dlab, pi.base.font);
InsetText::draw(pi, x + labelwidth_, y);
///
virtual bool display() const;
///
- virtual bool neverIndent() const { return true; }
+ virtual bool neverIndent() const { return true; }
///
virtual InsetBase::Code lyxCode() const;
///
virtual std::string const editMessage() const;
///
- virtual void cursorPos
+ virtual void cursorPos
(CursorSlice const & sl, bool boundary, int & x, int & y) const;
///
bool descendable() const { return true; }
string const InsetCharStyle::editMessage() const
{
- return _("Opened CharStyle Inset");
+ // FIXME UNICODE
+ return lyx::to_utf8(_("Opened CharStyle Inset"));
}
int d = 0;
string s(params_.type);
if (undefined())
- s = _("Undef: ") + s;
- docstring ds(s.begin(), s.end());
+ // FIXME UNICODE
+ s = lyx::to_utf8(_("Undef: ")) + s;
+ docstring ds(s.begin(), s.end());
font_metrics::rectText(ds, font, w, a, d);
dim.wid = max(dim.wid, w);
}
int d = 0;
string s(params_.type);
if (undefined())
- s = _("Undef: ") + s;
- docstring ds(s.begin(), s.end());
+ // FIXME UNICODE
+ s = lyx::to_utf8(_("Undef: ")) + s;
+ docstring ds(s.begin(), s.end());
font_metrics::rectText(ds, font, w, a, d);
pi.pain.rectText(x + (dim_.wid - w) / 2, y + desc + a,
ds, font, LColor::none, LColor::none);
string const InsetEnvironment::editMessage() const
{
- return _("Opened Environment Inset: ") + getInsetName();
+ // FIXME UNICODE
+ return lyx::to_utf8(_("Opened Environment Inset: ")) + getInsetName();
}
string const InsetERT::editMessage() const
{
- return _("Opened ERT Inset");
+ // FIXME UNICODE
+ return lyx::to_utf8(_("Opened ERT Inset"));
}
void InsetERT::setButtonLabel()
{
- setLabel(isOpen() ? _("ERT") : getNewLabel(_("ERT")));
+ // FIXME UNICODE
+ setLabel(isOpen() ? lyx::to_utf8(_("ERT")) : getNewLabel(lyx::to_utf8(_("ERT"))));
}
external::Template const * const ptr =
external::getTemplatePtr(params);
if (!ptr)
- return support::bformat(_("External template %1$s is not installed"),
+ // FIXME UNICODE
+ return support::bformat(lyx::to_utf8(_("External template %1$s is not installed")),
params.templatename());
return external::doSubstitution(params, buffer, ptr->guiName, false);
}
if (it == floats.end())
return type;
- return _(it->second.name());
+ // FIXME UNICODE
+ return lyx::to_utf8(_(it->second.name()));
}
} // namespace anon
InsetFloat::InsetFloat(BufferParams const & bp, string const & type)
: InsetCollapsable(bp)
{
- setLabel(_("float: ") + floatname(type, bp));
+ // FIXME UNICODE
+ setLabel(lyx::to_utf8(_("float: ")) + floatname(type, bp));
LyXFont font(LyXFont::ALL_SANE);
font.decSize();
font.decSize();
string const InsetFloat::editMessage() const
{
- return _("Opened Float Inset");
+ // FIXME UNICODE
+ return lyx::to_utf8(_("Opened Float Inset"));
}
void InsetFloat::wide(bool w, BufferParams const & bp)
{
params_.wide = w;
- string lab = _("float: ") + floatname(params_.type, bp);
+ // FIXME UNICODE
+ string lab = lyx::to_utf8(_("float: ")) + floatname(params_.type, bp);
if (params_.wide)
lab += '*';
setLabel(lab);
void InsetFloat::sideways(bool s, BufferParams const & bp)
{
params_.sideways = s;
- string lab = _("float: ") + floatname(params_.type, bp);
+ // FIXME UNICODE
+ string lab = lyx::to_utf8(_("float: ")) + floatname(params_.type, bp);
if (params_.sideways)
- lab += _(" (sideways)");
+ lab += lyx::to_utf8(_(" (sideways)"));
setLabel(lab);
}
// FIXME UNICODE
return lyx::to_utf8(buf.B_(it->second.listName()));
else
- return _("ERROR: Nonexistent float type!");
+ // FIXME UNICODE
+ return lyx::to_utf8(_("ERROR: Nonexistent float type!"));
}
<< lyx::to_utf8(buf.B_(cit->second.listName())) << "}\n";
}
} else {
+ // FIXME UNICODE
os << "%%\\listof{" << getCmdName() << "}{"
- << bformat(_("List of %1$s"), cit->second.name())
+ << bformat(lyx::to_utf8(_("List of %1$s")), cit->second.name())
<< "}\n";
}
return 1;
InsetFoot::InsetFoot(BufferParams const & bp)
: InsetFootlike(bp)
{
- setLabel(_("foot"));
+ // FIXME UNICODE
+ setLabel(lyx::to_utf8(_("foot")));
setInsetName("Foot");
}
InsetFoot::InsetFoot(InsetFoot const & in)
: InsetFootlike(in)
{
- setLabel(_("foot"));
+ // FIXME UNICODE
+ setLabel(lyx::to_utf8(_("foot")));
setInsetName("Foot");
}
string const InsetFoot::editMessage() const
{
- return _("Opened Footnote Inset");
+ // FIXME UNICODE
+ return lyx::to_utf8(_("Opened Footnote Inset"));
}
Mover const & mover = movers(formats.getFormatFromFile(file_in));
bool const success = mover.copy(file_in, file_out);
if (!success) {
+ // FIXME UNICODE
lyxerr[Debug::GRAPHICS]
- << support::bformat(_("Could not copy the file\n%1$s\n"
- "into the temporary directory."),
+ << support::bformat(lyx::to_utf8(_("Could not copy the file\n%1$s\n"
+ "into the temporary directory.")),
file_in)
<< std::endl;
}
string const orig_file = params().filename.absFilename();
string const rel_file = params().filename.relFilename(buf.filePath());
- // previewing source code, no file copying or file format conversion
+ // previewing source code, no file copying or file format conversion
if (runparams.dryrun)
return stripExtensionIfPossible(rel_file);
// Do we need to perform the conversion?
// Yes if to_file does not exist or if temp_file is newer than to_file
if (compare_timestamps(temp_file, to_file) < 0) {
+ // FIXME UNICODE
lyxerr[Debug::GRAPHICS]
- << bformat(_("No conversion of %1$s is needed after all"),
+ << bformat(lyx::to_utf8(_("No conversion of %1$s is needed after all")),
rel_file)
<< std::endl;
runparams.exportdata->addExternalFile(tex_format, to_file,
// 1. Convert file to ascii using gifscii
// 2. Read ascii output file and add it to the output stream.
// at least we send the filename
- os << '<' << bformat(_("Graphics file: %1$s"),
+ // FIXME UNICODE
+ os << '<' << bformat(lyx::to_utf8(_("Graphics file: %1$s")),
params().filename.absFilename()) << ">\n";
return 0;
}
#include <sstream>
+using lyx::docstring;
using lyx::support::addName;
using lyx::support::absolutePath;
using lyx::support::bformat;
string const InsetInclude::getScreenLabel(Buffer const &) const
{
- string temp;
+ docstring temp;
switch (type(params_)) {
- case INPUT: temp += _("Input"); break;
- case VERB: temp += _("Verbatim Input"); break;
- case VERBAST: temp += _("Verbatim Input*"); break;
- case INCLUDE: temp += _("Include"); break;
+ case INPUT:
+ temp += _("Input");
+ break;
+ case VERB:
+ temp += _("Verbatim Input");
+ break;
+ case VERBAST:
+ temp += _("Verbatim Input*");
+ break;
+ case INCLUDE:
+ temp += _("Include");
+ break;
}
- temp += ": ";
+ temp += lyx::from_ascii(": ");
if (params_.getContents().empty())
- temp += "???";
+ temp += lyx::from_ascii("???");
else
- temp += onlyFilename(params_.getContents());
+ temp += lyx::from_ascii(onlyFilename(params_.getContents()));
- return temp;
+ // FIXME UNICODE
+ return lyx::to_utf8(temp);
}
Buffer * tmp = bufferlist.getBuffer(included_file);
if (tmp->params().textclass != m_buffer->params().textclass) {
- string text = bformat(_("Included file `%1$s'\n"
+ // FIXME UNICODE
+ string text = bformat(lyx::to_utf8(_("Included file `%1$s'\n"
"has textclass `%2$s'\n"
- "while parent file has textclass `%3$s'."),
+ "while parent file has textclass `%3$s'.")),
makeDisplayPath(included_file),
tmp->params().getLyXTextClass().name(),
m_buffer->params().getLyXTextClass().name());
- Alert::warning(_("Different textclasses"), text);
+ Alert::warning(lyx::to_utf8(_("Different textclasses")), text);
//return 0;
}
if (checksum_in != checksum_out) {
if (!copy(included_file, writefile)) {
+ // FIXME UNICODE
lyxerr[Debug::LATEX]
- << bformat(_("Could not copy the file\n%1$s\n"
- "into the temporary directory."),
+ << bformat(lyx::to_utf8(_("Could not copy the file\n%1$s\n"
+ "into the temporary directory.")),
included_file)
<< endl;
return 0;
string const InsetIndex::getScreenLabel(Buffer const &) const
{
- return _("Idx");
+ // FIXME UNICODE
+ return lyx::to_utf8(_("Idx"));
}
string const InsetPrintIndex::getScreenLabel(Buffer const &) const
{
- return _("Index");
+ // FIXME UNICODE
+ return lyx::to_utf8(_("Index"));
}
InsetMarginal::InsetMarginal(BufferParams const & bp)
: InsetFootlike(bp)
{
- setLabel(_("margin"));
+ // FIXME UNICODE
+ setLabel(lyx::to_utf8(_("margin")));
setInsetName("Marginal");
}
InsetMarginal::InsetMarginal(InsetMarginal const & in)
: InsetFootlike(in)
{
- setLabel(_("margin"));
+ // FIXME UNICODE
+ setLabel(lyx::to_utf8(_("margin")));
setInsetName("Marginal");
}
string const InsetMarginal::editMessage() const
{
- return _("Opened Marginal Note Inset");
+ // FIXME UNICODE
+ return lyx::to_utf8(_("Opened Marginal Note Inset"));
}
typedef Translator<std::string, InsetNoteParams::Type> NoteTranslator;
-NoteTranslator const init_notetranslator() {
+NoteTranslator const init_notetranslator()
+{
NoteTranslator translator("Note", InsetNoteParams::Note);
translator.addPair("Comment", InsetNoteParams::Comment);
translator.addPair("Greyedout", InsetNoteParams::Greyedout);
}
-NoteTranslator const init_notetranslator_loc() {
- NoteTranslator translator(_("Note"), InsetNoteParams::Note);
- translator.addPair(_("Comment"), InsetNoteParams::Comment);
- translator.addPair(_("Greyed out"), InsetNoteParams::Greyedout);
- translator.addPair(_("Framed"), InsetNoteParams::Framed);
- translator.addPair(_("Shaded"), InsetNoteParams::Shaded);
+NoteTranslator const init_notetranslator_loc()
+{
+ // FIXME UNICODE
+ NoteTranslator translator(lyx::to_utf8(_("Note")), InsetNoteParams::Note);
+ translator.addPair(lyx::to_utf8(_("Comment")), InsetNoteParams::Comment);
+ translator.addPair(lyx::to_utf8(_("Greyed out")), InsetNoteParams::Greyedout);
+ translator.addPair(lyx::to_utf8(_("Framed")), InsetNoteParams::Framed);
+ translator.addPair(lyx::to_utf8(_("Shaded")), InsetNoteParams::Shaded);
return translator;
}
-NoteTranslator const & notetranslator() {
+NoteTranslator const & notetranslator()
+{
static NoteTranslator translator = init_notetranslator();
return translator;
}
-NoteTranslator const & notetranslator_loc() {
+NoteTranslator const & notetranslator_loc()
+{
static NoteTranslator translator = init_notetranslator_loc();
return translator;
}
string const InsetNote::editMessage() const
{
- return _("Opened Note Inset");
+ // FIXME UNICODE
+ return lyx::to_utf8(_("Opened Note Inset"));
}
if (params_.type == InsetNoteParams::Shaded) {
features.require("color");
features.require("framed");
- }
+ }
if (params_.type == InsetNoteParams::Framed)
features.require("framed");
InsetText::validate(features);
LyXFont font(LyXFont::ALL_SANE);
font.setColor(LColor::collapsable);
setLabelFont(font);
- setLabel(_("opt"));
+ // FIXME UNICODE
+ setLabel(lyx::to_utf8(_("opt")));
}
LyXFont font(LyXFont::ALL_SANE);
font.setColor(LColor::collapsable);
setLabelFont(font);
- setLabel(_("opt"));
+ // FIXME UNICODE
+ setLabel(lyx::to_utf8(_("opt")));
}
string const InsetOptArg::editMessage() const
{
- return _("Opened Optional Argument Inset");
+ // FIXME UNICODE
+ return lyx::to_utf8(_("Opened Optional Argument Inset"));
}
void InsetPagebreak::draw(PainterInfo & pi, int x, int y) const
{
- static std::string const label = _("Page Break");
+ static docstring const label = _("Page Break");
LyXFont font;
font.setColor(LColor::pagebreak);
int w = 0;
int a = 0;
int d = 0;
- docstring dlab(label.begin(), label.end());
- font_metrics::rectText(dlab, font, w, a, d);
+ font_metrics::rectText(label, font, w, a, d);
int const text_start = int(x + (dim_.wid - w) / 2);
int const text_end = text_start + w;
- pi.pain.rectText(text_start, y + d, dlab, font,
+ pi.pain.rectText(text_start, y + d, label, font,
LColor::none, LColor::none);
pi.pain.line(x, y, text_start, y,
string temp;
for (int i = 0; !types[i].latex_name.empty(); ++i) {
if (getCmdName() == types[i].latex_name) {
- temp = _(types[i].short_gui_name);
+ // FIXME UNIOCDE
+ temp = lyx::to_utf8(_(types[i].short_gui_name));
break;
}
}
tabular.setWidthOfCell(cell, dim.wid);
if (p_width.zero()) {
m.base.textwidth = dim.wid + 2 * ADD_TO_TABULAR_WIDTH;
- // FIXME there must be a way to get rid of
+ // FIXME there must be a way to get rid of
// the second metrics call
tabular.getCellInset(cell)->metrics(m, dim);
}
string const InsetTabular::editMessage() const
{
- return _("Opened table");
+ // FIXME UNICODE
+ return lyx::to_utf8(_("Opened table"));
}
case LFUN_MOUSE_PRESS:
//lyxerr << "# InsetTabular::MousePress\n" << cur.bv().cursor() << endl;
- if (cmd.button() == mouse_button::button1
+ if (cmd.button() == mouse_button::button1
|| cmd.button() == mouse_button::button3) {
cur.selection() = false;
setCursorFromCoordinates(cur, cmd.x, cmd.y);
case LyXTabular::SET_LTNEWPAGE:
status.setOnOff(tabular.getLTNewPage(sel_row_start));
break;
-
+
case LyXTabular::SET_BOOKTABS:
status.setOnOff(tabular.useBookTabs());
break;
-
+
case LyXTabular::UNSET_BOOKTABS:
status.setOnOff(!tabular.useBookTabs());
break;
int const xend = xbeg + tabular.getWidthOfColumn(cell);
row_type const row = tabular.row_of_cell(cell);
int const ybeg = o.y_ - tabular.getAscentOfRow(row) -
- tabular.getAdditionalHeight(row);
+ tabular.getAdditionalHeight(row);
int const yend = o.y_ + tabular.getDescentOfRow(row);
if (x < xbeg)
#ifdef WITH_WARNINGS
#warning Need I say it ? This is horrible.
#endif
- Alert::error(_("Error setting multicolumn"),
- _("You cannot set multicolumn vertically."));
+ // FIXME UNICODE
+ Alert::error(lyx::to_utf8(_("Error setting multicolumn")),
+ lyx::to_utf8(_("You cannot set multicolumn vertically.")));
return;
}
if (!cur.selection()) {
int const w = text_.width() + 2 * border_;
int const a = text_.ascent() + border_;
int const h = a + text_.descent() + border_;
- pi.pain.rectangle(x, y - a, (Wide() ? text_.maxwidth_ : w), h,
+ pi.pain.rectangle(x, y - a, (Wide() ? text_.maxwidth_ : w), h,
frameColor());
}
}
int const w = text_.width() + 2 * border_;
int const a = text_.ascent() + border_;
int const h = a + text_.descent() + border_;
- pi.pain.fillRectangle(x, y - a, (Wide() ? text_.maxwidth_ : w), h,
+ pi.pain.fillRectangle(x, y - a, (Wide() ? text_.maxwidth_ : w), h,
backgroundColor());
text_.drawSelection(pi, x, y);
}
string const InsetText::editMessage() const
{
- return _("Opened Text Inset");
+ // FIXME UNICODE
+ return lyx::to_utf8(_("Opened Text Inset"));
}
string const InsetTOC::getScreenLabel(Buffer const &) const
{
+ // FIXME UNICODE
if (getCmdName() == "tableofcontents")
- return _("Table of Contents");
- return _("Unknown toc list");
+ return lyx::to_utf8(_("Table of Contents"));
+ return lyx::to_utf8(_("Unknown toc list"));
}
string const InsetUrl::getScreenLabel(Buffer const &) const
{
string temp;
+ // FIXME UNICODE
if (getCmdName() == "url")
- temp = _("Url: ");
+ temp = lyx::to_utf8(_("Url: "));
else
- temp = _("HtmlUrl: ");
+ temp = lyx::to_utf8(_("HtmlUrl: "));
string url;
string const InsetVSpace::label() const
{
- static string const label = _("Vertical Space");
+ // FIXME UNICODE
+ static string const label = lyx::to_utf8(_("Vertical Space"));
return label + " (" + space_.asGUIName() + ')';
}
int w = 0;
int a = 0;
int d = 0;
- string lab = label();
- docstring dlab(lab.begin(), lab.end());
+ string lab = label();
+ docstring dlab(lab.begin(), lab.end());
font_metrics::rectText(dlab, font, w, a, d);
height = max(height, a + d);
font.setColor(LColor::added_space);
font.decSize();
font.decSize();
- string lab = label();
- docstring dlab(lab.begin(), lab.end());
+ string lab = label();
+ docstring dlab(lab.begin(), lab.end());
font_metrics::rectText(dlab, font, w, a, d);
pi.pain.rectText(x + 2 * arrow_size + 5,
{
FloatList const & floats = bp.getLyXTextClass().floats();
FloatList::const_iterator it = floats[type];
- return (it == floats.end()) ? type : _(it->second.name());
+ // FIXME UNICODE
+ return (it == floats.end()) ? type : lyx::to_utf8(_(it->second.name()));
}
} // namespace anon
InsetWrap::InsetWrap(BufferParams const & bp, string const & type)
: InsetCollapsable(bp)
{
- setLabel(_("wrap: ") + floatname(type, bp));
+ // FIXME UNICODE
+ setLabel(lyx::to_utf8(_("wrap: ")) + floatname(type, bp));
LyXFont font(LyXFont::ALL_SANE);
font.decSize();
font.decSize();
string const InsetWrap::editMessage() const
{
- return _("Opened Wrap Inset");
+ // FIXME UNICODE
+ return lyx::to_utf8(_("Opened Wrap Inset"));
}
string const statusMessage(graphics::Params const & params,
graphics::ImageStatus status)
{
+ docstring ret;
+
if (!displayGraphic(params))
- return _("Not shown.");
-
- switch (status) {
- case graphics::WaitingToLoad:
- return _("Not shown.");
- case graphics::Loading:
- return _("Loading...");
- case graphics::Converting:
- return _("Converting to loadable format...");
- case graphics::Loaded:
- return _("Loaded into memory. Generating pixmap...");
- case graphics::ScalingEtc:
- return _("Scaling etc...");
- case graphics::Ready:
- return _("Ready to display");
- case graphics::ErrorNoFile:
- return _("No file found!");
- case graphics::ErrorConverting:
- return _("Error converting to loadable format");
- case graphics::ErrorLoading:
- return _("Error loading file into memory");
- case graphics::ErrorGeneratingPixmap:
- return _("Error generating the pixmap");
- case graphics::ErrorUnknown:
- return _("No image");
+ ret = _("Not shown.");
+ else {
+ switch (status) {
+ case graphics::WaitingToLoad:
+ ret = _("Not shown.");
+ break;
+ case graphics::Loading:
+ ret = _("Loading...");
+ break;
+ case graphics::Converting:
+ ret = _("Converting to loadable format...");
+ break;
+ case graphics::Loaded:
+ ret = _("Loaded into memory. Generating pixmap...");
+ break;
+ case graphics::ScalingEtc:
+ ret = _("Scaling etc...");
+ break;
+ case graphics::Ready:
+ ret = _("Ready to display");
+ break;
+ case graphics::ErrorNoFile:
+ ret = _("No file found!");
+ break;
+ case graphics::ErrorConverting:
+ ret = _("Error converting to loadable format");
+ break;
+ case graphics::ErrorLoading:
+ ret = _("Error loading file into memory");
+ break;
+ case graphics::ErrorGeneratingPixmap:
+ ret = _("Error generating the pixmap");
+ break;
+ case graphics::ErrorUnknown:
+ ret = _("No image");
+ break;
+ }
}
- return string();
+
+ // FIXME UNICODE
+ return lyx::to_utf8(ret);
}
msgFont.setFamily(LyXFont::SANS_FAMILY);
string const justname = onlyFilename(params_.filename);
- docstring djust(justname.begin(), justname.end());
+ docstring djust(justname.begin(), justname.end());
if (!justname.empty()) {
msgFont.setSize(LyXFont::SIZE_FOOTNOTE);
font_width = font_metrics::width(djust, msgFont);
string const msg = statusMessage(params_, loader_.status());
if (!msg.empty()) {
- docstring dmsg(msg.begin(), msg.end());
+ docstring dmsg(msg.begin(), msg.end());
msgFont.setSize(LyXFont::SIZE_TINY);
font_width = std::max(font_width,
font_metrics::width(dmsg, msgFont));
string const justname = onlyFilename(params_.filename);
if (!justname.empty()) {
- docstring djust(justname.begin(), justname.end());
+ docstring djust(justname.begin(), justname.end());
msgFont.setSize(LyXFont::SIZE_FOOTNOTE);
pi.pain.text(x + InsetOld::TEXT_TO_INSET_OFFSET + 6,
y - font_metrics::maxAscent(msgFont) - 4,
// Print the message.
string const msg = statusMessage(params_, loader_.status());
if (!msg.empty()) {
- docstring dmsg(msg.begin(), msg.end());
+ docstring dmsg(msg.begin(), msg.end());
msgFont.setSize(LyXFont::SIZE_TINY);
pi.pain.text(x + InsetOld::TEXT_TO_INSET_OFFSET + 6,
y - 4, dmsg, msgFont);
graphics::PreviewLoader const & loader = getPreviewLoader(buffer);
graphics::PreviewLoader::Status const status = loader.status(snippet);
- string message;
+ docstring message;
switch (status) {
case graphics::PreviewLoader::InQueue:
case graphics::PreviewLoader::Processing:
break;
}
- return message;
+ // FIXME UNICODE
+ return lyx::to_utf8(message);
}
} // namespace anon
LyXFont font(mi.base.font);
font.setFamily(LyXFont::SANS_FAMILY);
font.setSize(LyXFont::SIZE_FOOTNOTE);
- string stat = statusMessage(mi.base.bv, snippet_);
- docstring dstat(stat.begin(), stat.end());
+ string stat = statusMessage(mi.base.bv, snippet_);
+ docstring dstat(stat.begin(), stat.end());
dim.wid = 15 + font_metrics::width(dstat, font);
}
font.setFamily(LyXFont::SANS_FAMILY);
font.setSize(LyXFont::SIZE_FOOTNOTE);
- string stat = statusMessage(pi.base.bv, snippet_);
- docstring dstat(stat.begin(), stat.end());
+ string stat = statusMessage(pi.base.bv, snippet_);
+ docstring dstat(stat.begin(), stat.end());
pi.pain.text(x + offset + 6,
y - font_metrics::maxAscent(font) - 4,
dstat, font);
// This is what happens when goto gets banned.
if (pipe(pipein) == -1) {
- error_ = _("Can't create pipe for spellchecker.");
+ error_ = lyx::to_utf8(_("Can't create pipe for spellchecker."));
return;
}
if (pipe(pipeout) == -1) {
close(pipein[0]);
close(pipein[1]);
- error_ = _("Can't create pipe for spellchecker.");
+ error_ = lyx::to_utf8(_("Can't create pipe for spellchecker."));
return;
}
close(pipein[1]);
close(pipeout[0]);
close(pipeout[1]);
- error_ = _("Can't create pipe for spellchecker.");
+ error_ = lyx::to_utf8(_("Can't create pipe for spellchecker."));
return;
}
if ((out = fdopen(pipein[1], "w")) == 0) {
- error_ = _("Can't open pipe for spellchecker.");
+ error_ = lyx::to_utf8(_("Can't open pipe for spellchecker."));
return;
}
if ((in = fdopen(pipeout[0], "r")) == 0) {
- error_ = _("Can't open pipe for spellchecker.");
+ error_ = lyx::to_utf8(_("Can't open pipe for spellchecker."));
return;
}
if ((inerr = fdopen(pipeerr[0], "r")) == 0) {
- error_ = _("Can't open pipe for spellchecker.");
+ error_ = lyx::to_utf8(_("Can't open pipe for spellchecker."));
return;
}
LaunchIspell * li = new LaunchIspell(params, lang, pipein, pipeout, pipeerr);
child_.reset(li);
if (li->start() == -1) {
- error_ = _("Could not create an ispell process.\nYou may not have "
- "the right languages installed.");
+ error_ = lyx::to_utf8(_("Could not create an ispell process.\nYou may not have "
+ "the right languages installed."));
child_.reset(0);
return;
}
error_ = buf;
} else {
// select returned error
- error_ = _("The ispell process returned an error.\nPerhaps "
- "it has been configured wrongly ?");
+ error_ = lyx::to_utf8(_("The ispell process returned an error.\nPerhaps "
+ "it has been configured wrongly ?"));
}
close(pipein[0]);
bool error = select(err_read);
if (error) {
- error_ = _("Could not communicate with the ispell spellchecker process.");
+ error_ = lyx::to_utf8(_("Could not communicate with the ispell spellchecker process."));
return UNKNOWN_WORD;
}
if (!curmap)
return buf;
- buf += _(" options: ");
+ buf += lyx::to_utf8(_(" options: "));
buf += curmap->print();
return buf;
}
string const file = makeDisplayPath(buffer->fileName(), 30);
- string text = bformat(_("The document %1$s could not be saved.\n\n"
- "Do you want to rename the document and try again?"), file);
- int const ret = Alert::prompt(_("Rename and save?"),
- text, 0, 1, _("&Rename"), _("&Cancel"));
+ string text = bformat(lyx::to_utf8(_("The document %1$s could not be saved.\n\n"
+ "Do you want to rename the document and try again?")), file);
+ int const ret = Alert::prompt(lyx::to_utf8(_("Rename and save?")),
+ text, 0, 1, lyx::to_utf8(_("&Rename")), lyx::to_utf8(_("&Cancel")));
if (ret == 0)
return writeAs(buffer);
if (filename.empty()) {
- FileDialog fileDlg(_("Choose a filename to save document as"),
+ FileDialog fileDlg(lyx::to_utf8(_("Choose a filename to save document as")),
LFUN_BUFFER_WRITE_AS,
- make_pair(string(_("Documents|#o#O")),
+ make_pair(string(lyx::to_utf8(_("Documents|#o#O"))),
string(lyxrc.document_path)),
- make_pair(string(_("Templates|#T#t")),
+ make_pair(string(lyx::to_utf8(_("Templates|#T#t"))),
string(lyxrc.template_path)));
if (!isLyXFilename(fname))
fname += ".lyx";
- FileFilterList const filter (_("LyX Documents (*.lyx)"));
+ FileFilterList const filter (lyx::to_utf8(_("LyX Documents (*.lyx)")));
FileDialog::Result result =
fileDlg.save(onlyPath(fname),
if (fs::exists(fname)) {
string const file = makeDisplayPath(fname, 30);
- string text = bformat(_("The document %1$s already exists.\n\n"
- "Do you want to over-write that document?"), file);
- int const ret = Alert::prompt(_("Over-write document?"),
- text, 0, 1, _("&Over-write"), _("&Cancel"));
+ string text = bformat(lyx::to_utf8(_("The document %1$s already exists.\n\n"
+ "Do you want to over-write that document?")), file);
+ int const ret = Alert::prompt(lyx::to_utf8(_("Over-write document?")),
+ text, 0, 1, lyx::to_utf8(_("&Over-write")), lyx::to_utf8(_("&Cancel")));
if (ret == 1)
return false;
if (!destroyDir(package().temp_dir())) {
string const msg =
- bformat(_("Unable to remove the temporary directory %1$s"),
+ bformat(lyx::to_utf8(_("Unable to remove the temporary directory %1$s")),
package().temp_dir());
- Alert::warning(_("Unable to remove temporary directory"), msg);
+ Alert::warning(lyx::to_utf8(_("Unable to remove temporary directory")), msg);
}
lyx_gui::exit(0);
int AutoSaveBuffer::start()
{
- command_ = bformat(_("Auto-saving %1$s"), fname_);
+ command_ = bformat(lyx::to_utf8(_("Auto-saving %1$s")), fname_);
return run(DontWait);
}
// but safe in the parent, so...
if (pid == -1)
// emit message signal.
- bv_.buffer()->message(_("Autosave failed!"));
+ bv_.buffer()->message(lyx::to_utf8(_("Autosave failed!")));
}
}
if (pid == 0) { // we are the child so...
}
// emit message signal.
- bv->buffer()->message(_("Autosaving current document..."));
+ bv->buffer()->message(lyx::to_utf8(_("Autosaving current document...")));
// create autosave filename
string fname = bv->buffer()->filePath();
string fname = f;
if (fname.empty()) {
- FileDialog fileDlg(_("Select file to insert"),
+ FileDialog fileDlg(lyx::to_utf8(_("Select file to insert")),
(asParagraph) ? LFUN_FILE_INSERT_ASCII_PARA : LFUN_FILE_INSERT_ASCII);
FileDialog::Result result =
if (!fs::is_readable(fname)) {
string const error = strerror(errno);
string const file = makeDisplayPath(fname, 50);
- string const text = bformat(_("Could not read the specified document\n"
- "%1$s\ndue to the error: %2$s"), file, error);
- Alert::error(_("Could not read file"), text);
+ string const text = bformat(lyx::to_utf8(_("Could not read the specified document\n"
+ "%1$s\ndue to the error: %2$s")), file, error);
+ Alert::error(lyx::to_utf8(_("Could not read file")), text);
return string();
}
if (!ifs) {
string const error = strerror(errno);
string const file = makeDisplayPath(fname, 50);
- string const text = bformat(_("Could not open the specified document\n"
- "%1$s\ndue to the error: %2$s"), file, error);
- Alert::error(_("Could not open file"), text);
+ string const text = bformat(lyx::to_utf8(_("Could not open the specified document\n"
+ "%1$s\ndue to the error: %2$s")), file, error);
+ Alert::error(lyx::to_utf8(_("Could not open file")), text);
return string();
}
void reconfigure(BufferView * bv)
{
// emit message signal.
- bv->buffer()->message(_("Running configure..."));
+ bv->buffer()->message(lyx::to_utf8(_("Running configure...")));
// Run configure in user lyx directory
Path p(package().user_support());
one.startscript(Systemcall::Wait, configure_command);
p.pop();
// emit message signal.
- bv->buffer()->message(_("Reloading configuration..."));
+ bv->buffer()->message(lyx::to_utf8(_("Reloading configuration...")));
lyxrc.read(libFileSearch(string(), "lyxrc.defaults"));
// Re-read packages.lst
LaTeXFeatures::getAvailable();
- Alert::information(_("System reconfigured"),
- _("The system has been reconfigured.\n"
- "You need to restart LyX to make use of any\n"
- "updated document class specifications."));
+ Alert::information(lyx::to_utf8(_("System reconfigured")),
+ lyx::to_utf8(_("The system has been reconfigured.\n"
+ "You need to restart LyX to make use of any\n"
+ "updated document class specifications.")));
}
void showFileError(string const & error)
{
- Alert::warning(_("Could not read configuration file"),
- bformat(_("Error while reading the configuration file\n%1$s.\n"
- "Please check your installation."), error));
+ Alert::warning(lyx::to_utf8(_("Could not read configuration file")),
+ bformat(lyx::to_utf8(_("Error while reading the configuration file\n%1$s.\n"
+ "Please check your installation.")), error));
}
{
string const configure_command = package().configure_command();
- lyxerr << _("LyX: reconfiguring user directory") << endl;
+ lyxerr << lyx::to_utf8(_("LyX: reconfiguring user directory")) << endl;
Path p(package().user_support());
Systemcall one;
one.startscript(Systemcall::Wait, configure_command);
- lyxerr << "LyX: " << _("Done!") << endl;
+ lyxerr << "LyX: " << lyx::to_utf8(_("Done!")) << endl;
}
} // namespace anon
// other than documents
for (int argi = 1; argi < argc ; ++argi) {
if (argv[argi][0] == '-') {
- lyxerr << bformat(_("Wrong command line option `%1$s'. Exiting."),
+ lyxerr << bformat(lyx::to_utf8(_("Wrong command line option `%1$s'. Exiting.")),
argv[argi]) << endl;
return EXIT_FAILURE;
}
}
// create the main window
LyXView * view = lyx_gui::create_view(width, height, posx, posy, maximize);
-
+
// load files
for_each(files.begin(), files.end(),
bind(&LyXView::loadLyXFile, view, _1, true));
void LyX::printError(ErrorItem const & ei)
{
- std::cerr << _("LyX: ") << ei.error
+ std::cerr << lyx::to_utf8(_("LyX: ")) << ei.error
<< ':' << ei.description << std::endl;
}
if (!lyxrc.path_prefix.empty())
prependEnvPath("PATH", lyxrc.path_prefix);
- // Check that user LyX directory is ok.
+ // Check that user LyX directory is ok.
if (queryUserLyXDir(package().explicit_user_support()))
reconfigureUserLyXDir();
package().temp_dir() = createLyXTmpDir(lyxrc.tempdir_path);
if (package().temp_dir().empty()) {
- Alert::error(_("Could not create temporary directory"),
- bformat(_("Could not create a temporary directory in\n"
- "%1$s. Make sure that this\n"
- "path exists and is writable and try again."),
+ Alert::error(lyx::to_utf8(_("Could not create temporary directory")),
+ bformat(lyx::to_utf8(_("Could not create a temporary directory in\n"
+ "%1$s. Make sure that this\n"
+ "path exists and is writable and try again.")),
lyxrc.tempdir_path));
// createLyXTmpDir() tries sufficiently hard to create a
// usable temp dir, so the probability to come here is
addName(package().user_support(), file);
return (! fs::exists(absfile))
- || (fs::last_write_time(configure_script)
+ || (fs::last_write_time(configure_script)
> fs::last_write_time(absfile));
}
if (fs::exists(package().user_support()) &&
fs::is_directory(package().user_support())) {
first_start = false;
-
- return needsUpdate("lyxrc.defaults")
- || needsUpdate("textclass.lst")
+
+ return needsUpdate("lyxrc.defaults")
+ || needsUpdate("textclass.lst")
|| needsUpdate("packages.lst");
}
// to create it. If the user says "no", then exit.
if (explicit_userdir &&
Alert::prompt(
- _("Missing user LyX directory"),
- bformat(_("You have specified a non-existent user "
- "LyX directory, %1$s.\n"
- "It is needed to keep your own configuration."),
+ lyx::to_utf8(_("Missing user LyX directory")),
+ bformat(lyx::to_utf8(_("You have specified a non-existent user "
+ "LyX directory, %1$s.\n"
+ "It is needed to keep your own configuration.")),
package().user_support()),
1, 0,
- _("&Create directory"),
- _("&Exit LyX"))) {
- lyxerr << _("No user LyX directory. Exiting.") << endl;
+ lyx::to_utf8(_("&Create directory")),
+ lyx::to_utf8(_("&Exit LyX")))) {
+ lyxerr << lyx::to_utf8(_("No user LyX directory. Exiting.")) << endl;
lyx_exit(EXIT_FAILURE);
}
- lyxerr << bformat(_("LyX: Creating directory %1$s"),
+ lyxerr << bformat(lyx::to_utf8(_("LyX: Creating directory %1$s")),
package().user_support())
<< endl;
if (!createDirectory(package().user_support(), 0755)) {
// Failed, so let's exit.
- lyxerr << _("Failed to create directory. Exiting.")
+ lyxerr << lyx::to_utf8(_("Failed to create directory. Exiting."))
<< endl;
lyx_exit(EXIT_FAILURE);
}
int parse_dbg(string const & arg, string const &)
{
if (arg.empty()) {
- lyxerr << _("List of supported debug flags:") << endl;
+ lyxerr << lyx::to_utf8(_("List of supported debug flags:")) << endl;
Debug::showTags(lyxerr);
exit(0);
}
- lyxerr << bformat(_("Setting debug level to %1$s"), arg) << endl;
+ lyxerr << bformat(lyx::to_utf8(_("Setting debug level to %1$s")), arg) << endl;
lyxerr.level(Debug::value(arg));
Debug::showLevel(lyxerr, lyxerr.level());
int parse_help(string const &, string const &)
{
lyxerr <<
- _("Usage: lyx [ command line switches ] [ name.lyx ... ]\n"
+ lyx::to_utf8(_("Usage: lyx [ command line switches ] [ name.lyx ... ]\n"
"Command line switches (case sensitive):\n"
"\t-help summarize LyX usage\n"
"\t-userdir dir set user directory to dir\n"
" where fmt is the import format of choice\n"
" and file.xxx is the file to be imported.\n"
"\t-version summarize version and build info\n"
- "Check the LyX man page for more details.") << endl;
+ "Check the LyX man page for more details.")) << endl;
exit(0);
return 0;
}
int parse_sysdir(string const & arg, string const &)
{
if (arg.empty()) {
- lyxerr << _("Missing directory for -sysdir switch") << endl;
+ lyxerr << lyx::to_utf8(_("Missing directory for -sysdir switch")) << endl;
exit(1);
}
cl_system_support = arg;
int parse_userdir(string const & arg, string const &)
{
if (arg.empty()) {
- lyxerr << _("Missing directory for -userdir switch") << endl;
+ lyxerr << lyx::to_utf8(_("Missing directory for -userdir switch")) << endl;
exit(1);
}
cl_user_support = arg;
int parse_execute(string const & arg, string const &)
{
if (arg.empty()) {
- lyxerr << _("Missing command string after --execute switch") << endl;
+ lyxerr << lyx::to_utf8(_("Missing command string after --execute switch")) << endl;
exit(1);
}
batch = arg;
int parse_export(string const & type, string const &)
{
if (type.empty()) {
- lyxerr << _("Missing file type [eg latex, ps...] after "
- "--export switch") << endl;
+ lyxerr << lyx::to_utf8(_("Missing file type [eg latex, ps...] after "
+ "--export switch")) << endl;
exit(1);
}
batch = "buffer-export " + type;
int parse_import(string const & type, string const & file)
{
if (type.empty()) {
- lyxerr << _("Missing file type [eg latex, ps...] after "
- "--import switch") << endl;
+ lyxerr << lyx::to_utf8(_("Missing file type [eg latex, ps...] after "
+ "--import switch")) << endl;
exit(1);
}
if (file.empty()) {
- lyxerr << _("Missing filename for --import") << endl;
+ lyxerr << lyx::to_utf8(_("Missing filename for --import")) << endl;
exit(1);
}
bool searchAllowed(BufferView * bv, string const & str)
{
if (str.empty()) {
- Alert::error(_("Search error"), _("Search string is empty"));
+ Alert::error(lyx::to_utf8(_("Search error")), lyx::to_utf8(_("Search string is empty")));
return false;
}
return bv->available();
if (!found)
// emit message signal.
- bv->message(_("String not found!"));
+ bv->message(lyx::to_utf8(_("String not found!")));
}
if (replace_count == 0) {
// emit message signal.
- buf->message(_("String not found!"));
+ buf->message(lyx::to_utf8(_("String not found!")));
} else {
if (replace_count == 1) {
// emit message signal.
- buf->message(_("String has been replaced."));
+ buf->message(lyx::to_utf8(_("String has been replaced.")));
} else {
string str = convert<string>(replace_count);
- str += _(" strings have been replaced.");
+ str += lyx::to_utf8(_(" strings have been replaced."));
// emit message signal.
buf->message(str);
}
{
ostringstream os;
if (family() != INHERIT_FAMILY)
- os << _(GUIFamilyNames[family()]) << ", ";
+ os << lyx::to_utf8(_(GUIFamilyNames[family()])) << ", ";
if (series() != INHERIT_SERIES)
- os << _(GUISeriesNames[series()]) << ", ";
+ os << lyx::to_utf8(_(GUISeriesNames[series()])) << ", ";
if (shape() != INHERIT_SHAPE)
- os << _(GUIShapeNames[shape()]) << ", ";
+ os << lyx::to_utf8(_(GUIShapeNames[shape()])) << ", ";
if (size() != INHERIT_SIZE)
- os << _(GUISizeNames[size()]) << ", ";
+ os << lyx::to_utf8(_(GUISizeNames[size()])) << ", ";
if (color() != LColor::inherit)
os << lcolor.getGUIName(color()) << ", ";
if (emph() != INHERIT)
- os << bformat(_("Emphasis %1$s, "), _(GUIMiscNames[emph()]));
+ os << bformat(lyx::to_utf8(_("Emphasis %1$s, ")),
+ lyx::to_utf8(_(GUIMiscNames[emph()])));
if (underbar() != INHERIT)
- os << bformat(_("Underline %1$s, "), _(GUIMiscNames[underbar()]));
+ os << bformat(lyx::to_utf8(_("Underline %1$s, ")),
+ lyx::to_utf8(_(GUIMiscNames[underbar()])));
if (noun() != INHERIT)
- os << bformat(_("Noun %1$s, "), _(GUIMiscNames[noun()]));
+ os << bformat(lyx::to_utf8(_("Noun %1$s, ")),
+ lyx::to_utf8(_(GUIMiscNames[noun()])));
if (bits == inherit)
- os << _("Default") << ", ";
+ os << lyx::to_utf8(_("Default")) << ", ";
if (!params || (language() != params->language))
- os << bformat(_("Language: %1$s, "), _(language()->display()));
+ os << bformat(lyx::to_utf8(_("Language: %1$s, ")),
+ lyx::to_utf8(_(language()->display())));
if (number() != OFF)
- os << bformat(_(" Number %1$s"), _(GUIMiscNames[number()]));
+ os << bformat(lyx::to_utf8(_(" Number %1$s")), lyx::to_utf8(_(GUIMiscNames[number()])));
return rtrim(os.str(), ", ");
}
FuncRequest::KEYBOARD);
} else {
lyxerr[Debug::KEY] << "Unknown, !isText() - giving up" << endl;
- owner->message(_("Unknown function."));
+ owner->message(lyx::to_utf8(_("Unknown function.")));
return;
}
}
return true;
string const file = makeDisplayPath(buf.fileName(), 30);
- string text = bformat(_("The document %1$s has unsaved "
- "changes.\n\nDo you want to save "
- "the document?"), file);
- int const ret = Alert::prompt(_("Save changed document?"),
- text, 0, 1, _("&Save"),
- _("&Cancel"));
+ string text = bformat(lyx::to_utf8(_("The document %1$s has unsaved "
+ "changes.\n\nDo you want to save "
+ "the document?")), file);
+ int const ret = Alert::prompt(lyx::to_utf8(_("Save changed document?")),
+ text, 0, 1, lyx::to_utf8(_("&Save")),
+ lyx::to_utf8(_("&Cancel")));
if (ret == 0)
bv->owner()->dispatch(FuncRequest(LFUN_BUFFER_WRITE));
void showPrintError(string const & name)
{
- string str = bformat(_("Could not print the document %1$s.\n"
- "Check that your printer is set up correctly."),
+ string str = bformat(lyx::to_utf8(_("Could not print the document %1$s.\n"
+ "Check that your printer is set up correctly.")),
makeDisplayPath(name, 50));
- Alert::error(_("Print document failed"), str);
+ Alert::error(lyx::to_utf8(_("Print document failed")), str);
}
lyx::textclass_type const tc = tc_pair.second;
if (!textclasslist[tc].load()) {
- string s = bformat(_("The document could not be converted\n"
- "into the document class %1$s."),
+ string s = bformat(lyx::to_utf8(_("The document could not be converted\n"
+ "into the document class %1$s.")),
textclasslist[tc].name());
- Alert::error(_("Could not change class"), s);
+ Alert::error(lyx::to_utf8(_("Could not change class")), s);
}
}
case LFUN_BUFFER_WRITE:
if (!owner->buffer()->isUnnamed()) {
- string const str = bformat(_("Saving document %1$s..."),
+ string const str = bformat(lyx::to_utf8(_("Saving document %1$s...")),
makeDisplayPath(owner->buffer()->fileName()));
owner->message(str);
menuWrite(owner->buffer());
- owner->message(str + _(" done."));
+ owner->message(str + lyx::to_utf8(_(" done.")));
} else
writeAs(owner->buffer());
update = false;
case LFUN_BUFFER_RELOAD: {
string const file = makeDisplayPath(view()->buffer()->fileName(), 20);
- string text = bformat(_("Any changes will be lost. Are you sure "
- "you want to revert to the saved version of the document %1$s?"), file);
- int const ret = Alert::prompt(_("Revert to saved document?"),
- text, 0, 1, _("&Revert"), _("&Cancel"));
+ string text = bformat(lyx::to_utf8(_("Any changes will be lost. Are you sure "
+ "you want to revert to the saved version of the document %1$s?")), file);
+ int const ret = Alert::prompt(lyx::to_utf8(_("Revert to saved document?")),
+ text, 0, 1, lyx::to_utf8(_("&Revert")), lyx::to_utf8(_("&Cancel")));
if (ret == 0)
view()->reload();
<< arg << "'. Bad installation?" << endl;
break;
}
- owner->message(bformat(_("Opening help file %1$s..."),
+ owner->message(bformat(lyx::to_utf8(_("Opening help file %1$s...")),
makeDisplayPath(fname)));
owner->loadLyXFile(fname, false);
break;
if (!lcolor.setColor(lyx_name, x11_name)) {
setErrorMessage(
- bformat(_("Set-color \"%1$s\" failed "
- "- color is undefined or "
- "may not be redefined"), lyx_name));
+ bformat(lyx::to_utf8(_("Set-color \"%1$s\" failed "
+ "- color is undefined or "
+ "may not be redefined")), lyx_name));
break;
}
}
if (defaults.writeFile(defaults.fileName()))
- setMessage(_("Document defaults saved in ")
+ setMessage(lyx::to_utf8(_("Document defaults saved in "))
+ makeDisplayPath(fname));
else
- setErrorMessage(_("Unable to save document defaults"));
+ setErrorMessage(lyx::to_utf8(_("Unable to save document defaults")));
break;
}
// nothing to do
break;
- owner->message(_("Converting document to new document class..."));
+ owner->message(lyx::to_utf8(_("Converting document to new document class...")));
recordUndoFullDocument(view());
buffer->params().textclass = new_class;
StableDocIterator backcur(view()->cursor());
}
}
if (!quitting)
- sendDispatchMessage(_(getMessage()), cmd);
+ sendDispatchMessage(lyx::to_utf8(_(getMessage())), cmd);
}
// The template stuff
string templname;
if (fromTemplate) {
- FileDialog fileDlg(_("Select template file"),
+ FileDialog fileDlg(lyx::to_utf8(_("Select template file")),
LFUN_SELECT_FILE_SYNC,
- make_pair(string(_("Documents|#o#O")),
+ make_pair(string(lyx::to_utf8(_("Documents|#o#O"))),
string(lyxrc.document_path)),
- make_pair(string(_("Templates|#T#t")),
+ make_pair(string(lyx::to_utf8(_("Templates|#T#t"))),
string(lyxrc.template_path)));
FileDialog::Result result =
fileDlg.open(lyxrc.template_path,
- FileFilterList(_("LyX Documents (*.lyx)")),
+ FileFilterList(lyx::to_utf8(_("LyX Documents (*.lyx)"))),
string());
if (result.first == FileDialog::Later)
string filename;
if (fname.empty()) {
- FileDialog fileDlg(_("Select document to open"),
+ FileDialog fileDlg(lyx::to_utf8(_("Select document to open")),
LFUN_FILE_OPEN,
- make_pair(string(_("Documents|#o#O")),
+ make_pair(string(lyx::to_utf8(_("Documents|#o#O"))),
string(lyxrc.document_path)),
- make_pair(string(_("Examples|#E#e")),
+ make_pair(string(lyx::to_utf8(_("Examples|#E#e"))),
string(addPath(package().system_support(), "examples"))));
FileDialog::Result result =
fileDlg.open(initpath,
- FileFilterList(_("LyX Documents (*.lyx)")),
+ FileFilterList(lyx::to_utf8(_("LyX Documents (*.lyx)"))),
string());
if (result.first == FileDialog::Later)
// check selected filename
if (filename.empty()) {
- owner->message(_("Canceled."));
+ owner->message(lyx::to_utf8(_("Canceled.")));
return;
}
} else
return;
}
- owner->message(bformat(_("Opening document %1$s..."), disp_fn));
+ owner->message(bformat(lyx::to_utf8(_("Opening document %1$s...")), disp_fn));
string str2;
if (owner->loadLyXFile(filename)) {
- str2 = bformat(_("Document %1$s opened."), disp_fn);
+ str2 = bformat(lyx::to_utf8(_("Document %1$s opened.")), disp_fn);
} else {
- str2 = bformat(_("Could not open document %1$s"), disp_fn);
+ str2 = bformat(lyx::to_utf8(_("Could not open document %1$s")), disp_fn);
}
owner->message(str2);
}
initpath = trypath;
}
- string const text = bformat(_("Select %1$s file to import"),
+ string const text = bformat(lyx::to_utf8(_("Select %1$s file to import")),
formats.prettyName(format));
FileDialog fileDlg(text,
LFUN_BUFFER_IMPORT,
- make_pair(string(_("Documents|#o#O")),
+ make_pair(string(lyx::to_utf8(_("Documents|#o#O"))),
string(lyxrc.document_path)),
- make_pair(string(_("Examples|#E#e")),
+ make_pair(string(lyx::to_utf8(_("Examples|#E#e"))),
string(addPath(package().system_support(), "examples"))));
string const filter = formats.prettyName(format)
// check selected filename
if (filename.empty())
- owner->message(_("Canceled."));
+ owner->message(lyx::to_utf8(_("Canceled.")));
}
if (filename.empty())
// Check if the document already is open
if (lyx_gui::use_gui && bufferlist.exists(lyxfile)) {
if (!bufferlist.close(bufferlist.getBuffer(lyxfile), true)) {
- owner->message(_("Canceled."));
+ owner->message(lyx::to_utf8(_("Canceled.")));
return;
}
}
if (fs::exists(lyxfile) && filename != lyxfile) {
string const file = makeDisplayPath(lyxfile, 30);
- string text = bformat(_("The document %1$s already exists.\n\n"
- "Do you want to over-write that document?"), file);
- int const ret = Alert::prompt(_("Over-write document?"),
- text, 0, 1, _("&Over-write"), _("&Cancel"));
+ string text = bformat(lyx::to_utf8(_("The document %1$s already exists.\n\n"
+ "Do you want to over-write that document?")), file);
+ int const ret = Alert::prompt(lyx::to_utf8(_("Over-write document?")),
+ text, 0, 1, lyx::to_utf8(_("&Over-write")), lyx::to_utf8(_("&Cancel")));
if (ret == 1) {
- owner->message(_("Canceled."));
+ owner->message(lyx::to_utf8(_("Canceled.")));
return;
}
}
return keyseq.printOptions();
if (!view()->available())
- return _("Welcome to LyX!");
+ return lyx::to_utf8(_("Welcome to LyX!"));
return view()->cursor().currentState();
}
namespace os = lyx::support::os;
+using lyx::docstring;
using lyx::support::ascii_lowercase;
using lyx::support::bformat;
using lyx::support::expandPath;
(tokenPos(flags, ',', "document") >= 0);
if (!flags.empty() && flags != "document")
lyxerr << "Ignoring flags other than "
- "`document' in `" << flags
+ "`document' in `" << flags
<< "' for format `" << format << "'."
<< endl;
if (prettyname.empty()) {
string const LyXRC::getDescription(LyXRCTags tag)
{
- string str;
+ docstring str;
switch (tag) {
case RC_ACCEPT_COMPOUND:
break;
case RC_NUMLASTFILES:
- str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."), maxlastfiles);
+ str = lyx::from_utf8(bformat(lyx::to_utf8(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu.")), maxlastfiles));
break;
case RC_PATH_PREFIX:
break;
case RC_PRINTPAPERDIMENSIONFLAG:
- str = _("Option to specify the dimensions of the print paper.");
+ str = _("Option to specify the dimensions of the print paper.");
break;
case RC_PRINTPAPERFLAG:
break;
case RC_VIEWDVI_PAPEROPTION:
- str = _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
+ _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
break;
case RC_VIEWER:
break;
}
- return str;
+ return lyx::to_utf8(str);
}
// The global instance
// there must be a file to save
if (!isFileReadable(filename)) {
- Alert::error(_("Document not saved"),
- _("You must save the document "
- "before it can be registered."));
+ Alert::error(lyx::to_utf8(_("Document not saved")),
+ lyx::to_utf8(_("You must save the document "
+ "before it can be registered.")));
return;
}
lyxerr[Debug::LYXVC] << "LyXVC: registrer" << endl;
pair<bool, string> tmp =
- Alert::askForText(_("LyX VC: Initial description"),
- _("(no initial description)"));
+ Alert::askForText(lyx::to_utf8(_("LyX VC: Initial description")),
+ lyx::to_utf8(_("(no initial description)")));
if (!tmp.first || tmp.second.empty()) {
// should we insist on checking tmp.second.empty()?
lyxerr[Debug::LYXVC] << "LyXVC: user cancelled" << endl;
{
lyxerr[Debug::LYXVC] << "LyXVC: checkIn" << endl;
- pair<bool, string> tmp = Alert::askForText(_("LyX VC: Log Message"));
+ pair<bool, string> tmp = Alert::askForText(lyx::to_utf8(_("LyX VC: Log Message")));
if (tmp.first) {
if (tmp.second.empty()) {
- tmp.second = _("(no log message)");
+ tmp.second = lyx::to_utf8(_("(no log message)"));
}
vcs->checkIn(tmp.second);
} else {
lyxerr[Debug::LYXVC] << "LyXVC: revert" << endl;
string const file = makeDisplayPath(owner_->fileName(), 20);
- string text = bformat(_("Reverting to the stored version of the "
+ string text = bformat(lyx::to_utf8(_("Reverting to the stored version of the "
"document %1$s will lose all current changes.\n\n"
- "Do you want to revert to the saved version?"), file);
- int const ret = Alert::prompt(_("Revert to stored version of document?"),
- text, 0, 1, _("&Revert"), _("&Cancel"));
+ "Do you want to revert to the saved version?")), file);
+ int const ret = Alert::prompt(lyx::to_utf8(_("Revert to stored version of document?")),
+ text, 0, 1, lyx::to_utf8(_("&Revert")), lyx::to_utf8(_("&Cancel")));
if (ret == 0)
vcs->revert();
}
case LFUN_PASTE: {
- cur.message(_("Paste"));
+ // FIXME UNICODE
+ cur.message(lyx::to_utf8(_("Paste")));
lyx::cap::replaceSelection(cur);
istringstream is(lyx::to_utf8(cmd.argument()));
int n = 0;
for (row_type row = 0; row < nrows(); ++row) {
int const yy = y + rowinfo_[row].offset_;
FontSetChanger dummy(pi.base, "mathrm");
- string const nl = nicelabel(row);
- docstring const dnl(nl.begin(), nl.end());
+ string const nl = nicelabel(row);
+ docstring const dnl(nl.begin(), nl.end());
pi.draw(xx, yy, dnl);
}
}
else
for (row_type row = 0; row < nrows(); ++row)
numbered(row, !old);
- cur.message(old ? _("No number") : _("Number"));
+ // FIXME UNICODE
+ cur.message(old ? lyx::to_utf8(_("No number")) : lyx::to_utf8(_("Number")));
}
break;
recordUndoInset(cur);
row_type r = (type_ == hullMultline) ? nrows() - 1 : cur.row();
bool old = numbered(r);
- cur.message(old ? _("No number") : _("Number"));
+ // FIXME UNICODE
+ cur.message(old ? lyx::to_utf8(_("No number")) : lyx::to_utf8(_("Number")));
numbered(r, !old);
}
break;
string const MathHullInset::editMessage() const
{
- return _("Math editor mode");
+ // FIXME UNICODE
+ return lyx::to_utf8(_("Math editor mode"));
}
docstring MathMacroTemplate::prefix() const
{
- // FIXME: delete the conversion when bformat() will return a docstring.
- return lyx::from_utf8(bformat(_(" Macro: %1$s: "), name_));
+ // FIXME UNICODE
+ // delete the conversion when bformat() will return a docstring.
+ // delete the conversion when bformat() takes a docstring arg.
+ return lyx::from_utf8(bformat(lyx::to_utf8(_(" Macro: %1$s: ")), name_));
}
case LFUN_PASTE: {
recordUndo(cur);
- cur.message(_("Paste"));
+ // FIXME UNICODE
+ cur.message(lyx::to_utf8(_("Paste")));
replaceSelection(cur);
size_t n = 0;
istringstream is(lyx::to_utf8(cmd.argument()));
case LFUN_CUT:
recordUndo(cur);
cutSelection(cur, true, true);
- cur.message(_("Cut"));
+ // FIXME UNICODE
+ cur.message(lyx::to_utf8(_("Cut")));
// Prevent stale position >= size crash
// Probably not necessary anymore, see eraseSelection (gb 2005-10-09)
cur.normalize();
case LFUN_COPY:
copySelection(cur);
- cur.message(_("Copy"));
+ // FIXME UNICODE
+ cur.message(lyx::to_utf8(_("Copy")));
break;
case LFUN_MOUSE_PRESS:
MathScriptInset * inset = cur.nextAtom().nucleus()->asScriptInset();
// special handling of {}-bases
// is this always correct?
- if (inset->nuc().size() == 1
+ if (inset->nuc().size() == 1
&& inset->nuc().back()->asBraceInset())
inset->nuc() = inset->nuc().back()->asNestInset()->cell(0);
-
+
cur.push(*inset);
cur.idx() = 1;
cur.pos() = 0;
string str;
for (int i = 0; !types[i].latex_name.empty(); ++i)
if (commandname() == types[i].latex_name) {
- str = _(types[i].short_gui_name);
+ // FIXME UNICODE
+ str = lyx::to_utf8(_(types[i].short_gui_name));
break;
}
str += asString(cell(0));
ofs.open(fname.c_str());
if (!ofs) {
string const file = makeDisplayPath(fname, 50);
- string text = bformat(_("Could not open the specified "
- "document\n%1$s."), file);
- Alert::error(_("Could not open file"), text);
+ string text = bformat(lyx::to_utf8(_("Could not open the specified "
+ "document\n%1$s.")), file);
+ Alert::error(lyx::to_utf8(_("Could not open file")), text);
return false;
}
return true;
case 6: // Abstract
if (runparams.linelen > 0) {
- os << _("Abstract") << "\n\n";
+ os << lyx::to_utf8(_("Abstract")) << "\n\n";
currlinelen = 0;
} else {
- string const abst = _("Abstract: ");
+ string const abst = lyx::to_utf8(_("Abstract: "));
os << abst;
currlinelen += abst.length();
}
case 7: // Bibliography
if (!ref_printed) {
if (runparams.linelen > 0) {
- os << _("References") << "\n\n";
+ os << lyx::to_utf8(_("References")) << "\n\n";
currlinelen = 0;
} else {
- string const refs = _("References: ");
+ string const refs = lyx::to_utf8(_("References: "));
os << refs;
currlinelen += refs.length();
}
if (!params().labelWidthString().empty())
return params().labelWidthString();
else
- return _("Senseless with this layout!");
+ return lyx::to_utf8(_("Senseless with this layout!"));
}
pb_font.setColor(LColor::appendix);
pb_font.decSize();
- string const label = _("Appendix");
+ string const label = lyx::to_utf8(_("Appendix"));
int w = 0;
int a = 0;
int d = 0;
FileFilterList::FileFilterList(string const & qt_style_filter)
{
+ // FIXME UNICODE
string const filter = qt_style_filter
+ (qt_style_filter.empty() ? string() : ";;")
- + _("All files (*)");
+ + lyx::to_utf8(_("All files (*)"));
// Split data such as "TeX documents (*.tex);;LyX Documents (*.lyx)"
// into individual filters.
string const configure_script = addName(system_support(), "configure.py");
configure_command_ = os::python() + ' ' + quoteName(configure_script)
- + with_version_suffix();
+ + with_version_suffix();
lyxerr[Debug::INIT]
<< "<package>\n"
{
string const abs_binary = get_binary_path(exe);
if (abs_binary.empty()) {
- lyxerr << bformat(_("Unable to determine the path to the "
- "LyX binary from the command line %1$s"),
+ // FIXME UNICODE
+ lyxerr << bformat(lyx::to_utf8(_("Unable to determine the path to the "
+ "LyX binary from the command line %1$s")),
exe)
<< std::endl;
bail_out();
searched_dirs_str += *it;
}
- lyxerr << bformat(_("Unable to determine the system directory "
- "having searched\n"
- "\t%1$s\n"
- "Use the '-sysdir' command line parameter or "
- "set the environment variable LYX_DIR_14x to "
- "the LyX system directory containing the file "
- "`chkconfig.ltx'."),
+ // FIXME UNICODE
+ lyxerr << bformat(lyx::to_utf8(_("Unable to determine the system directory "
+ "having searched\n"
+ "\t%1$s\n"
+ "Use the '-sysdir' command line parameter or "
+ "set the environment variable LYX_DIR_14x to "
+ "the LyX system directory containing the file "
+ "`chkconfig.ltx'.")),
searched_dirs_str)
<< std::endl;
{
string const abs_path = fileSearch(dir, file);
if (abs_path.empty()) {
- lyxerr << bformat(_("Invalid %1$s switch.\n"
- "Directory %2$s does not contain %3$s."),
+ // FIXME UNICODE
+ lyxerr << bformat(lyx::to_utf8(_("Invalid %1$s switch.\n"
+ "Directory %2$s does not contain %3$s.")),
command_line_switch, dir, file)
<< std::endl;
}
{
string const abs_path = fileSearch(dir, file);
if (abs_path.empty()) {
- lyxerr << bformat(_("Invalid %1$s environment variable.\n"
- "Directory %2$s does not contain %3$s."),
+ // FIXME UNICODE
+ lyxerr << bformat(lyx::to_utf8(_("Invalid %1$s environment variable.\n"
+ "Directory %2$s does not contain %3$s.")),
env_var, dir, file)
<< std::endl;
}
// search mechanism in po/Makefile.in.in will register
// package.C.in as a file containing strings that need
// translation.
+ // FIXME UNICODE
string const fmt =
- _("Invalid %1$s environment variable.\n%2$s is not a directory.");
+ lyx::to_utf8(_("Invalid %1$s environment variable.\n%2$s is not a directory."));
lyxerr << bformat(fmt, env_var, dir)
<< std::endl;
bool hasLayout = tclass.hasLayout(layoutname);
if (!hasLayout) {
- errorList.push_back(ErrorItem(_("Unknown layout"),
- bformat(_("Layout '%1$s' does not exist in textclass '%2$s'\nTrying to use the default instead.\n"),
+ errorList.push_back(ErrorItem(lyx::to_utf8(_("Unknown layout")),
+ bformat(lyx::to_utf8(_("Layout '%1$s' does not exist in textclass '%2$s'\nTrying to use the default instead.\n")),
layoutname, tclass.name()), par.id(), 0, par.size()));
layoutname = tclass.defaultLayoutName();
}
else {
lex.eatLine();
string line = lex.getString();
- errorList.push_back(ErrorItem(_("Unknown Inset"), line,
+ errorList.push_back(ErrorItem(lyx::to_utf8(_("Unknown Inset")), line,
par.id(), 0, par.size()));
}
} else if (token == "\\family") {
lyx::time_type ct;
is >> aid >> ct;
if (aid >= bp.author_map.size()) {
- errorList.push_back(ErrorItem(_("Change tracking error"),
- bformat(_("Unknown author index for insertion: %1$d\n"), aid),
+ errorList.push_back(ErrorItem(lyx::to_utf8(_("Change tracking error")),
+ bformat(lyx::to_utf8(_("Unknown author index for insertion: %1$d\n")), aid),
par.id(), 0, par.size()));
change = Change(Change::UNCHANGED);
lyx::time_type ct;
is >> aid >> ct;
if (aid >= bp.author_map.size()) {
- errorList.push_back(ErrorItem(_("Change tracking error"),
- bformat(_("Unknown author index for deletion: %1$d\n"), aid),
+ errorList.push_back(ErrorItem(lyx::to_utf8(_("Change tracking error")),
+ bformat(lyx::to_utf8(_("Unknown author index for deletion: %1$d\n")), aid),
par.id(), 0, par.size()));
change = Change(Change::UNCHANGED);
change = Change(Change::DELETED, bp.author_map[aid], ct);
} else {
lex.eatLine();
- errorList.push_back(ErrorItem(_("Unknown token"),
- bformat(_("Unknown token: %1$s %2$s\n"), token, lex.getString()),
+ errorList.push_back(ErrorItem(lyx::to_utf8(_("Unknown token")),
+ bformat(lyx::to_utf8(_("Unknown token: %1$s %2$s\n")), token, lex.getString()),
par.id(), 0, par.size()));
}
}
if (isMainText())
l_margin += changebarMargin();
- string leftm = tclass.leftmargin();
- docstring dleft(leftm.begin(), leftm.end());
+ string leftm = tclass.leftmargin();
+ docstring dleft(leftm.begin(), leftm.end());
l_margin += font_metrics::signedWidth(dleft, params.getFont());
if (par.getDepth() != 0) {
LyXFont const labelfont = getLabelFont(par);
switch (layout->margintype) {
case MARGIN_DYNAMIC:
- if (!layout->leftmargin.empty()) {
- string leftm = layout->leftmargin;
- docstring dleft(leftm.begin(), leftm.end());
- l_margin += font_metrics::signedWidth(dleft,
- params.getFont());
- }
- if (!par.getLabelstring().empty()) {
- string labin = layout->labelindent;
- docstring dlabin(labin.begin(), labin.end());
+ if (!layout->leftmargin.empty()) {
+ string leftm = layout->leftmargin;
+ docstring dleft(leftm.begin(), leftm.end());
+ l_margin += font_metrics::signedWidth(dleft,
+ params.getFont());
+ }
+ if (!par.getLabelstring().empty()) {
+ string labin = layout->labelindent;
+ docstring dlabin(labin.begin(), labin.end());
l_margin += font_metrics::signedWidth(dlabin,
labelfont);
- string labstr = par.getLabelstring();
- docstring dlabstr(labstr.begin(), labstr.end());
+ string labstr = par.getLabelstring();
+ docstring dlabstr(labstr.begin(), labstr.end());
l_margin += font_metrics::width(dlabstr,
labelfont);
- string labsep = layout->labelsep;
- docstring dlabsep(labsep.begin(), labsep.end());
+ string labsep = layout->labelsep;
+ docstring dlabsep(labsep.begin(), labsep.end());
l_margin += font_metrics::width(dlabsep, labelfont);
}
break;
case MARGIN_MANUAL: {
- string labin = layout->labelindent;
- docstring dlabin(labin.begin(), labin.end());
+ string labin = layout->labelindent;
+ docstring dlabin(labin.begin(), labin.end());
l_margin += font_metrics::signedWidth(dlabin, labelfont);
// The width of an empty par, even with manual label, should be 0
if (!par.empty() && pos >= par.beginOfBody()) {
if (!par.getLabelWidthString().empty()) {
- string labstr = par.getLabelWidthString();
- docstring dlabstr(labstr.begin(), labstr.end());
+ string labstr = par.getLabelWidthString();
+ docstring dlabstr(labstr.begin(), labstr.end());
l_margin += font_metrics::width(dlabstr,
labelfont);
- string labsep = layout->labelsep;
- docstring dlabsep(labsep.begin(), labsep.end());
+ string labsep = layout->labelsep;
+ docstring dlabsep(labsep.begin(), labsep.end());
l_margin += font_metrics::width(dlabsep, labelfont);
}
}
break;
- }
-
+ }
+
case MARGIN_STATIC: {
- string leftm = layout->leftmargin;
- docstring dleft(leftm.begin(), leftm.end());
+ string leftm = layout->leftmargin;
+ docstring dleft(leftm.begin(), leftm.end());
l_margin += font_metrics::signedWidth(dleft, params.getFont()) * 4
/ (par.getDepth() + 4);
break;
- }
+ }
case MARGIN_FIRST_DYNAMIC:
if (layout->labeltype == LABEL_MANUAL) {
if (pos >= par.beginOfBody()) {
- string leftm = layout->leftmargin;
- docstring dleft(leftm.begin(), leftm.end());
+ string leftm = layout->leftmargin;
+ docstring dleft(leftm.begin(), leftm.end());
l_margin += font_metrics::signedWidth(dleft,
labelfont);
} else {
- string labin = layout->labelindent;
- docstring dlabin(labin.begin(), labin.end());
+ string labin = layout->labelindent;
+ docstring dlabin(labin.begin(), labin.end());
l_margin += font_metrics::signedWidth(dlabin,
labelfont);
}
|| (layout->labeltype == LABEL_STATIC
&& layout->latextype == LATEX_ENVIRONMENT
&& !isFirstInSequence(pit, pars_))) {
- string leftm = layout->leftmargin;
- docstring dleft(leftm.begin(), leftm.end());
+ string leftm = layout->leftmargin;
+ docstring dleft(leftm.begin(), leftm.end());
l_margin += font_metrics::signedWidth(dleft,
labelfont);
} else if (layout->labeltype != LABEL_TOP_ENVIRONMENT
&& layout->labeltype != LABEL_BIBLIO
&& layout->labeltype !=
LABEL_CENTERED_TOP_ENVIRONMENT) {
- string labin = layout->labelindent;
- docstring dlabin(labin.begin(), labin.end());
+ string labin = layout->labelindent;
+ docstring dlabin(labin.begin(), labin.end());
l_margin += font_metrics::signedWidth(dlabin,
labelfont);
- string labsep = layout->labelsep;
- docstring dlabsep(labsep.begin(), labsep.end());
+ string labsep = layout->labelsep;
+ docstring dlabsep(labsep.begin(), labsep.end());
l_margin += font_metrics::width(dlabsep, labelfont);
- string labstr = par.getLabelstring();
- docstring dlabstr(labstr.begin(), labstr.end());
+ string labstr = par.getLabelstring();
+ docstring dlabstr(labstr.begin(), labstr.end());
l_margin += font_metrics::width(dlabstr, labelfont);
}
break;
|| bv()->buffer()->params().paragraph_separation ==
BufferParams::PARSEP_INDENT))
{
- docstring din(parindent.begin(), parindent.end());
+ docstring din(parindent.begin(), parindent.end());
l_margin += font_metrics::signedWidth(din, params.getFont());
}
BufferParams const & params = bv()->buffer()->params();
LyXTextClass const & tclass = params.getLyXTextClass();
- string trmarg = tclass.rightmargin();
- docstring dtrmarg(trmarg.begin(), trmarg.end());
- string lrmarg = par.layout()->rightmargin;
- docstring dlrmarg(lrmarg.begin(), lrmarg.end());
+ string trmarg = tclass.rightmargin();
+ docstring dtrmarg(trmarg.begin(), trmarg.end());
+ string lrmarg = par.layout()->rightmargin;
+ docstring dlrmarg(lrmarg.begin(), lrmarg.end());
int const r_margin =
::rightMargin()
+ font_metrics::signedWidth(dtrmarg,
// add the auto-hfill from label end to the body
if (body_pos && i == body_pos) {
- string lsep = layout->labelsep;
- docstring dlsep(lsep.begin(), lsep.end());
+ string lsep = layout->labelsep;
+ docstring dlsep(lsep.begin(), lsep.end());
int add = font_metrics::width(dlsep, getLabelFont(par));
if (par.isLineSeparator(i - 1))
add -= singleWidth(par, i - 1);
Paragraph const & par = pars_[pit];
string const & labelsep = par.layout()->labelsep;
- docstring dlsep(labelsep.begin(), labelsep.end());
+ docstring dlsep(labelsep.begin(), labelsep.end());
int w = leftMargin(pit, row.pos());
pos_type const body_pos = par.beginOfBody();
if (label.empty())
return 0;
- docstring dlab(label.begin(), label.end());
+ docstring dlab(label.begin(), label.end());
return max(0, font_metrics::width(dlab, getLabelFont(par)) - w);
}
if (cur.pos() == 0) {
static bool sent_space_message = false;
if (!sent_space_message) {
- cur.message(_("You cannot insert a space at the "
- "beginning of a paragraph. Please read the Tutorial."));
+ cur.message(lyx::to_utf8(_("You cannot insert a space at the "
+ "beginning of a paragraph. Please read the Tutorial.")));
sent_space_message = true;
}
return;
&& par.lookupChange(cur.pos() - 1) != Change::DELETED) {
static bool sent_space_message = false;
if (!sent_space_message) {
- cur.message(_("You cannot type two spaces this way. "
- "Please read the Tutorial."));
+ cur.message(lyx::to_utf8(_("You cannot type two spaces this way. "
+ "Please read the Tutorial.")));
sent_space_message = true;
}
return;
if (body_pos > 0
&& (body_pos > end || !par.isLineSeparator(body_pos - 1)))
{
- string lsep = layout->labelsep;
- docstring dlsep(lsep.begin(), lsep.end());
+ string lsep = layout->labelsep;
+ docstring dlsep(lsep.begin(), lsep.end());
result.x += font_metrics::width(dlsep, getLabelFont(par));
if (body_pos <= end)
result.x += result.label_hfill;
}
} else
needsUpdate = dissolveInset(cur);
-
+
return needsUpdate;
}
bool LyXText::dissolveInset(LCursor & cur) {
BOOST_ASSERT(this == cur.text());
- if (isMainText() || cur.inset().nargs() != 1)
+ if (isMainText() || cur.inset().nargs() != 1)
return false;
recordUndoInset(cur);
lyx::pos_type spos = cur.pos();
lyx::pit_type spit = cur.pit();
ParagraphList plist;
- if (cur.lastpit() != 0 || cur.lastpos() != 0)
+ if (cur.lastpit() != 0 || cur.lastpos() != 0)
plist = paragraphs();
cur.popLeft();
// store cursor offset
cur.paragraph().erase(cur.pos());
if (!plist.empty()) {
Buffer & b = cur.buffer();
- pasteParagraphList(cur, plist, b.params().textclass,
+ pasteParagraphList(cur, plist, b.params().textclass,
b.errorList("Paste"));
// restore position
cur.pit() = std::min(cur.lastpit(), spit);
for (pos_type vpos = row_pos; vpos < cursor_vpos; ++vpos) {
pos_type pos = bidi.vis2log(vpos);
if (body_pos > 0 && pos == body_pos - 1) {
- string lsep = par.layout()->labelsep;
- docstring dlsep(lsep.begin(), lsep.end());
+ string lsep = par.layout()->labelsep;
+ docstring dlsep(lsep.begin(), lsep.end());
x += m.label_hfill
+ font_metrics::width(dlsep,
getLabelFont(par));
if (show_change) {
Change change = par.lookupChange(cur.pos());
Author const & a = buf.params().authors().get(change.author);
- os << _("Change: ") << a.name();
+ os << lyx::to_utf8(_("Change: ")) << a.name();
if (!a.email().empty())
os << " (" << a.email() << ")";
if (change.changetime)
- os << _(" at ") << ctime(&change.changetime);
+ os << lyx::to_utf8(_(" at ")) << ctime(&change.changetime);
os << " : ";
}
LyXFont font = real_current_font;
font.reduce(buf.params().getFont());
- // avoid _(...) re-entrance problem
+ // avoid lyx::to_utf8(_(...)) re-entrance problem
string const s = font.stateText(&buf.params());
- os << bformat(_("Font: %1$s"), s);
+ os << bformat(lyx::to_utf8(_("Font: %1$s")), s);
- // os << bformat(_("Font: %1$s"), font.stateText(&buf.params));
+ // os << bformat(lyx::to_utf8(_("Font: %1$s")), font.stateText(&buf.params));
// The paragraph depth
int depth = cur.paragraph().getDepth();
if (depth > 0)
- os << bformat(_(", Depth: %1$d"), depth);
+ os << bformat(lyx::to_utf8(_(", Depth: %1$d")), depth);
// The paragraph spacing, but only if different from
// buffer spacing.
Spacing const & spacing = par.params().spacing();
if (!spacing.isDefault()) {
- os << _(", Spacing: ");
+ os << lyx::to_utf8(_(", Spacing: "));
switch (spacing.getSpace()) {
case Spacing::Single:
- os << _("Single");
+ os << lyx::to_utf8(_("Single"));
break;
case Spacing::Onehalf:
- os << _("OneHalf");
+ os << lyx::to_utf8(_("OneHalf"));
break;
case Spacing::Double:
- os << _("Double");
+ os << lyx::to_utf8(_("Double"));
break;
case Spacing::Other:
- os << _("Other (") << spacing.getValueAsString() << ')';
+ os << lyx::to_utf8(_("Other (")) << spacing.getValueAsString() << ')';
break;
case Spacing::Default:
// should never happen, do nothing
}
#ifdef DEVEL_VERSION
- os << _(", Inset: ") << &cur.inset();
- os << _(", Paragraph: ") << cur.pit();
- os << _(", Id: ") << par.id();
- os << _(", Position: ") << cur.pos();
- os << _(", Boundary: ") << cur.boundary();
+ os << lyx::to_utf8(_(", Inset: ")) << &cur.inset();
+ os << lyx::to_utf8(_(", Paragraph: ")) << cur.pit();
+ os << lyx::to_utf8(_(", Id: ")) << par.id();
+ os << lyx::to_utf8(_(", Position: ")) << cur.pos();
+ os << lyx::to_utf8(_(", Boundary: ")) << cur.boundary();
// Row & row = cur.textRow();
// os << bformat(_(", Row b:%1$d e:%2$d"), row.pos(), row.endpos());
#endif
// If the mask is completely neutral, tell user
if (font == LyXFont(LyXFont::ALL_IGNORE)) {
// Could only happen with user style
- cur.message(_("No font change defined. "
- "Use Character under the Layout menu to define font change."));
+ cur.message(lyx::to_utf8(_("No font change defined. "
+ "Use Character under the Layout menu to define font change.")));
return;
}
selectWord(tmpcur, lyx::PREVIOUS_WORD);
if (!tmpcur.selection())
- cur.message(_("Nothing to index!"));
+ cur.message(lyx::to_utf8(_("Nothing to index!")));
else if (tmpcur.selBegin().pit() != tmpcur.selEnd().pit())
- cur.message(_("Cannot index more than one paragraph!"));
+ cur.message(lyx::to_utf8(_("Cannot index more than one paragraph!")));
else
idxstring = tmpcur.selectionAsString(false);
}
c = bidi.vis2log(vc);
last_tmpx = tmpx;
if (body_pos > 0 && c == body_pos - 1) {
- string lsep = layout->labelsep;
- docstring dlsep(lsep.begin(), lsep.end());
+ string lsep = layout->labelsep;
+ docstring dlsep(lsep.begin(), lsep.end());
tmpx += r.label_hfill +
font_metrics::width(dlsep, getLabelFont(par));
if (par.isLineSeparator(body_pos - 1))
} else if (tmp == "default") {
new_spacing = Spacing::Default;
} else {
- lyxerr << _("Unknown spacing argument: ")
+ lyxerr << lyx::to_utf8(_("Unknown spacing argument: "))
<< lyx::to_utf8(cmd.argument()) << endl;
}
if (cur_spacing != new_spacing || cur_value != new_value)
break;
case LFUN_PASTE:
- cur.message(_("Paste"));
+ cur.message(lyx::to_utf8(_("Paste")));
lyx::cap::replaceSelection(cur);
if (isStrUnsignedInt(lyx::to_utf8(cmd.argument())))
pasteSelection(cur, bv->buffer()->errorList("Paste"),
case LFUN_CUT:
cutSelection(cur, true, true);
- cur.message(_("Cut"));
+ cur.message(lyx::to_utf8(_("Cut")));
break;
case LFUN_COPY:
copySelection(cur);
- cur.message(_("Copy"));
+ cur.message(lyx::to_utf8(_("Copy")));
break;
case LFUN_SERVER_GET_XY:
// function list/array with information about what
// functions needs arguments and their type.
if (cmd.argument().empty()) {
- cur.errorMessage(_("LyX function 'layout' needs an argument."));
+ cur.errorMessage(lyx::to_utf8(_("LyX function 'layout' needs an argument.")));
break;
}
case LFUN_FONT_FREE_APPLY:
toggleAndShow(cur, this, freefont, toggleall);
- cur.message(_("Character set"));
+ cur.message(lyx::to_utf8(_("Character set")));
break;
// Set the freefont using the contents of \param data dispatched from
freefont = font;
toggleall = toggle;
toggleAndShow(cur, this, freefont, toggleall);
- cur.message(_("Character set"));
+ cur.message(lyx::to_utf8(_("Character set")));
}
break;
}
params.align(),
params.labelWidthString(),
params.noindent());
- cur.message(_("Paragraph layout set"));
+ cur.message(lyx::to_utf8(_("Paragraph layout set")));
break;
}
string result;
switch (kind_) {
case DEFSKIP:
- result = _("Default skip");
+ result = lyx::to_utf8(_("Default skip"));
break;
case SMALLSKIP:
- result = _("Small skip");
+ result = lyx::to_utf8(_("Small skip"));
break;
case MEDSKIP:
- result = _("Medium skip");
+ result = lyx::to_utf8(_("Medium skip"));
break;
case BIGSKIP:
- result = _("Big skip");
+ result = lyx::to_utf8(_("Big skip"));
break;
case VFILL:
- result = _("Vertical fill");
+ result = lyx::to_utf8(_("Vertical fill"));
break;
case LENGTH:
result = len_.asString();
break;
}
if (keep_)
- result += ", " + _("protected");
+ result += ", " + lyx::to_utf8(_("protected"));
return result;
}