I18n: internationalise some messages that were missing gettext calls.

pull/339/head
whitequark 2018-07-19 21:51:17 +00:00
parent fb138f496a
commit c37cddfc7f
1 changed files with 27 additions and 24 deletions

View File

@ -615,8 +615,9 @@ void SolveSpaceUI::MenuFile(Command id) {
} else if(importFile.HasExtension("dwg")) { } else if(importFile.HasExtension("dwg")) {
ImportDwg(importFile); ImportDwg(importFile);
} else { } else {
Error("Can't identify file type from file extension of " Error(_("Can't identify file type from file extension of "
"filename '%s'; try .dxf or .dwg.", importFile.raw.c_str()); "filename '%s'; try .dxf or .dwg."), importFile.raw.c_str());
break;
} }
SS.GenerateAll(SolveSpaceUI::Generate::UNTIL_ACTIVE); SS.GenerateAll(SolveSpaceUI::Generate::UNTIL_ACTIVE);
@ -758,15 +759,16 @@ void SolveSpaceUI::MenuAnalyze(Command id) {
vol += integral; vol += integral;
} }
std::string msg = ssprintf("The volume of the solid model is:\n\n"" %.3f %s^3", std::string msg = ssprintf(_("The volume of the solid model is:\n\n"
" %.3f %s^3"),
vol / pow(SS.MmPerUnit(), 3), vol / pow(SS.MmPerUnit(), 3),
SS.UnitName()); SS.UnitName());
if(SS.viewUnits == Unit::MM) { if(SS.viewUnits == Unit::MM) {
msg += ssprintf("\n %.2f mL", vol/(10*10*10)); msg += ssprintf("\n %.2f mL", vol/(10*10*10));
} }
msg += "\n\nCurved surfaces have been approximated as triangles.\n" msg += _("\n\nCurved surfaces have been approximated as triangles.\n"
"This introduces error, typically of around 1%."; "This introduces error, typically of around 1%.");
Message("%s", msg.c_str()); Message("%s", msg.c_str());
break; break;
} }
@ -787,10 +789,10 @@ void SolveSpaceUI::MenuAnalyze(Command id) {
sp.FixContourDirections(); sp.FixContourDirections();
double area = sp.SignedArea(); double area = sp.SignedArea();
double scale = SS.MmPerUnit(); double scale = SS.MmPerUnit();
Message("The area of the region sketched in this group is:\n\n" Message(_("The area of the region sketched in this group is:\n\n"
" %.3f %s^2\n\n" " %.3f %s^2\n\n"
"Curves have been approximated as piecewise linear.\n" "Curves have been approximated as piecewise linear.\n"
"This introduces error, typically of around 1%%.", "This introduces error, typically of around 1%%."),
area / (scale*scale), area / (scale*scale),
SS.UnitName()); SS.UnitName());
sel.Clear(); sel.Clear();
@ -810,10 +812,10 @@ void SolveSpaceUI::MenuAnalyze(Command id) {
} }
double scale = SS.MmPerUnit(); double scale = SS.MmPerUnit();
Message("The total length of the selected entities is:\n\n" Message(_("The total length of the selected entities is:\n\n"
" %.3f %s\n\n" " %.3f %s\n\n"
"Curves have been approximated as piecewise linear.\n" "Curves have been approximated as piecewise linear.\n"
"This introduces error, typically of around 1%%.", "This introduces error, typically of around 1%%."),
perimeter / scale, perimeter / scale,
SS.UnitName()); SS.UnitName());
} else { } else {
@ -856,7 +858,7 @@ void SolveSpaceUI::MenuAnalyze(Command id) {
} }
fclose(f); fclose(f);
} else { } else {
Error("Couldn't write to '%s'", dialog->GetFilename().raw.c_str()); Error(_("Couldn't write to '%s'"), dialog->GetFilename().raw.c_str());
} }
} }
// Clear the trace, and stop tracing // Clear the trace, and stop tracing
@ -886,20 +888,21 @@ void SolveSpaceUI::ShowNakedEdges(bool reportOnlyWhenNotOkay) {
SS.GW.Invalidate(); SS.GW.Invalidate();
const char *intersMsg = inters ? const char *intersMsg = inters ?
"The mesh is self-intersecting (NOT okay, invalid)." : _("The mesh is self-intersecting (NOT okay, invalid).") :
"The mesh is not self-intersecting (okay, valid)."; _("The mesh is not self-intersecting (okay, valid).");
const char *leaksMsg = leaks ? const char *leaksMsg = leaks ?
"The mesh has naked edges (NOT okay, invalid)." : _("The mesh has naked edges (NOT okay, invalid).") :
"The mesh is watertight (okay, valid)."; _("The mesh is watertight (okay, valid).");
std::string cntMsg = ssprintf("\n\nThe model contains %d triangles, from " std::string cntMsg = ssprintf(
"%d surfaces.", g->displayMesh.l.n, g->runningShell.surface.n); _("\n\nThe model contains %d triangles, from %d surfaces."),
g->displayMesh.l.n, g->runningShell.surface.n);
if(SS.nakedEdges.l.n == 0) { if(SS.nakedEdges.l.n == 0) {
Message("%s\n\n%s\n\nZero problematic edges, good.%s", Message(_("%s\n\n%s\n\nZero problematic edges, good.%s"),
intersMsg, leaksMsg, cntMsg.c_str()); intersMsg, leaksMsg, cntMsg.c_str());
} else { } else {
Error("%s\n\n%s\n\n%d problematic edges, bad.%s", Error(_("%s\n\n%s\n\n%d problematic edges, bad.%s"),
intersMsg, leaksMsg, SS.nakedEdges.l.n, cntMsg.c_str()); intersMsg, leaksMsg, SS.nakedEdges.l.n, cntMsg.c_str());
} }
} }
@ -911,7 +914,7 @@ void SolveSpaceUI::MenuHelp(Command id) {
break; break;
case Command::ABOUT: case Command::ABOUT:
Message( Message(_(
"This is SolveSpace version " PACKAGE_VERSION ".\n" "This is SolveSpace version " PACKAGE_VERSION ".\n"
"\n" "\n"
"For more information, see http://solvespace.com/\n" "For more information, see http://solvespace.com/\n"
@ -924,7 +927,7 @@ void SolveSpaceUI::MenuHelp(Command id) {
"law. For details, visit http://gnu.org/licenses/\n" "law. For details, visit http://gnu.org/licenses/\n"
"\n" "\n"
"© 2008-2016 Jonathan Westhues and other authors.\n" "© 2008-2016 Jonathan Westhues and other authors.\n"
); ));
break; break;
default: ssassert(false, "Unexpected menu ID"); default: ssassert(false, "Unexpected menu ID");