- OutputParams rp(&buffer().params().encoding());
- odocstringstream ods;
- InsetText::plaintext(ods, rp);
- docstring content_tip = ods.str();
- // shorten it if necessary
- if (content_tip.size() > 200)
- content_tip = content_tip.substr(0, 200) + "...";
- if (params_.type == InsetPhantomParams::Phantom)
- return from_ascii("Phantom: ") + content_tip;
- if (params_.type == InsetPhantomParams::HPhantom)
- return from_ascii("HPhantom: ") + content_tip;
- if (params_.type == InsetPhantomParams::VPhantom)
- return from_ascii("VPhantom: ") + content_tip;
+ docstring const res = phantomtranslator_loc().find(params_.type);
+ return toolTipText(res + from_ascii(": "));