From f3ffb040c1770a00deb2f84c8cd6fb96919f92ed Mon Sep 17 00:00:00 2001 From: Sergey Alyoshin Date: Wed, 30 Jan 2013 23:46:04 +0400 Subject: [PATCH] Add strings to localization --- src/action.c | 330 ++++++++++++++++++++------------------- src/buffer.c | 20 +-- src/hid/common/actions.c | 2 +- src/hid/gtk/gtkhid-main.c | 6 +- src/hid/gtk/gui-config.c | 27 ++-- src/hid/gtk/gui-dialog.c | 8 +- src/hid/gtk/gui-drc-window.c | 8 +- src/hid/gtk/gui-output-events.c | 8 +- src/hid/gtk/gui-top-window.c | 26 +-- src/hid/lpr/lpr.c | 10 +- src/misc.c | 59 +++---- src/parse_y.y | 25 +-- src/report.c | 141 ++++++++--------- src/toporouter.c | 10 +- src/vendor.c | 85 +++++----- 15 files changed, 391 insertions(+), 374 deletions(-) diff --git a/src/action.c b/src/action.c index 1d6d8f9..1932141 100644 --- a/src/action.c +++ b/src/action.c @@ -1752,9 +1752,9 @@ NotifyMode (void) /* --------------------------------------------------------------------------- */ -static const char atomic_syntax[] = "Atomic(Save|Restore|Close|Block)"; +static const char atomic_syntax[] = N_("Atomic(Save|Restore|Close|Block)"); -static const char atomic_help[] = "Save or restore the undo serial number."; +static const char atomic_help[] = N_("Save or restore the undo serial number."); /* %start-doc actions Atomic @@ -1817,9 +1817,9 @@ ActionAtomic (int argc, char **argv, Coord x, Coord y) /* -------------------------------------------------------------------------- */ -static const char drc_syntax[] = "DRC()"; +static const char drc_syntax[] = N_("DRC()"); -static const char drc_help[] = "Invoke the DRC check."; +static const char drc_help[] = N_("Invoke the DRC check."); /* %start-doc actions DRC @@ -1858,10 +1858,10 @@ ActionDRCheck (int argc, char **argv, Coord x, Coord y) /* -------------------------------------------------------------------------- */ -static const char dumplibrary_syntax[] = "DumpLibrary()"; +static const char dumplibrary_syntax[] = N_("DumpLibrary()"); static const char dumplibrary_help[] = - "Display the entire contents of the libraries."; + N_("Display the entire contents of the libraries."); /* %start-doc actions DumpLibrary @@ -1912,10 +1912,10 @@ ActionDumpLibrary (int argc, char **argv, Coord x, Coord y) /* -------------------------------------------------------------------------- */ -static const char flip_syntax[] = "Flip(Object|Selected|SelectedElements)"; +static const char flip_syntax[] = N_("Flip(Object|Selected|SelectedElements)"); static const char flip_help[] = - "Flip an element to the opposite side of the board."; + N_("Flip an element to the opposite side of the board."); /* %start-doc actions Flip @@ -1966,9 +1966,9 @@ ActionFlip (int argc, char **argv, Coord x, Coord y) /* -------------------------------------------------------------------------- */ -static const char message_syntax[] = "Message(message)"; +static const char message_syntax[] = N_("Message(message)"); -static const char message_help[] = "Writes a message to the log window."; +static const char message_help[] = N_("Writes a message to the log window."); /* %start-doc actions Message @@ -2003,13 +2003,13 @@ static const char setthermal_syntax[] = "SetThermal(Object|SelectedPins|SelectedVias|Selected, Style)"; static const char setthermal_help[] = - "Set the thermal (on the current layer) of pins or vias to the given style.\n" + N_("Set the thermal (on the current layer) of pins or vias to the given style.\n" "Style = 0 means no thermal.\n" "Style = 1 has diagonal fingers with sharp edges.\n" "Style = 2 has horizontal and vertical fingers with sharp edges.\n" "Style = 3 is a solid connection to the plane." "Style = 4 has diagonal fingers with rounded edges.\n" - "Style = 5 has horizontal and vertical fingers with rounded edges.\n"; + "Style = 5 has horizontal and vertical fingers with rounded edges.\n"); /* %start-doc actions SetThermal @@ -2108,10 +2108,11 @@ EventMoveCrosshair (int ev_x, int ev_y) /* --------------------------------------------------------------------------- */ static const char setvalue_syntax[] = - "SetValue(Grid|Line|LineSize|Text|TextScale|ViaDrillingHole|Via|ViaSize, delta)"; + N_("SetValue(Grid|Line|LineSize|Text|TextScale|ViaDrillingHole|Via|ViaSize, " + "delta)"); static const char setvalue_help[] = - "Change various board-wide values and sizes."; + N_("Change various board-wide values and sizes."); /* %start-doc actions SetValue @@ -2217,9 +2218,9 @@ ActionSetValue (int argc, char **argv, Coord x, Coord y) /* --------------------------------------------------------------------------- */ -static const char quit_syntax[] = "Quit()"; +static const char quit_syntax[] = N_("Quit()"); -static const char quit_help[] = "Quits the application after confirming."; +static const char quit_help[] = N_("Quits the application after confirming."); /* %start-doc actions Quit @@ -2245,10 +2246,10 @@ ActionQuit (int argc, char **argv, Coord x, Coord y) /* --------------------------------------------------------------------------- */ static const char connection_syntax[] = - "Connection(Find|ResetLinesAndPolygons|ResetPinsAndVias|Reset)"; + N_("Connection(Find|ResetLinesAndPolygons|ResetPinsAndVias|Reset)"); static const char connection_help[] = - "Searches connections of the object at the cursor position."; + N_("Searches connections of the object at the cursor position."); /* %start-doc actions Connection @@ -2322,9 +2323,9 @@ ActionConnection (int argc, char **argv, Coord x, Coord y) /* --------------------------------------------------------------------------- */ static const char disperseelements_syntax[] = - "DisperseElements(All|Selected)"; + N_("DisperseElements(All|Selected)"); -static const char disperseelements_help[] = "Disperses elements."; +static const char disperseelements_help[] = N_("Disperses elements."); /* %start-doc actions DisperseElements @@ -2447,7 +2448,7 @@ ActionDisperseElements (int argc, char **argv, Coord x, Coord y) /* --------------------------------------------------------------------------- */ static const char display_syntax[] = - "Display(NameOnPCB|Description|Value)\n" + N_("Display(NameOnPCB|Description|Value)\n" "Display(Grid|Redraw)\n" "Display(CycleClip|CycleCrosshair|Toggle45Degree|ToggleStartDirection)\n" "Display(ToggleGrid|ToggleRubberBandMode|ToggleUniqueNames)\n" @@ -2455,9 +2456,9 @@ static const char display_syntax[] = "Display(ToggleThindraw|ToggleThindrawPoly|ToggleOrthoMove|ToggleLocalRef)\n" "Display(ToggleCheckPlanes|ToggleShowDRC|ToggleAutoDRC)\n" "Display(ToggleLiveRoute|LockNames|OnlyNames)\n" - "Display(Pinout|PinOrPadName)"; + "Display(Pinout|PinOrPadName)"); -static const char display_help[] = "Several display-related actions."; +static const char display_help[] = N_("Several display-related actions."); /* %start-doc actions Display @@ -2930,12 +2931,12 @@ ActionDisplay (int argc, char **argv, Coord childX, Coord childY) /* --------------------------------------------------------------------------- */ static const char mode_syntax[] = - "Mode(Arc|Arrow|Copy|InsertPoint|Line|Lock|Move|None|PasteBuffer)\n" + N_("Mode(Arc|Arrow|Copy|InsertPoint|Line|Lock|Move|None|PasteBuffer)\n" "Mode(Polygon|Rectangle|Remove|Rotate|Text|Thermal|Via)\n" "Mode(Notify|Release|Cancel|Stroke)\n" - "Mode(Save|Restore)"; + "Mode(Save|Restore)"); -static const char mode_help[] = "Change or use the tool mode."; +static const char mode_help[] = N_("Change or use the tool mode."); /* %start-doc actions Mode @@ -3203,9 +3204,9 @@ ActionMode (int argc, char **argv, Coord x, Coord y) /* --------------------------------------------------------------------------- */ -static const char removeselected_syntax[] = "RemoveSelected()"; +static const char removeselected_syntax[] = N_("RemoveSelected()"); -static const char removeselected_help[] = "Removes any selected objects."; +static const char removeselected_help[] = N_("Removes any selected objects."); /* %start-doc actions RemoveSelected @@ -3221,12 +3222,12 @@ ActionRemoveSelected (int argc, char **argv, Coord x, Coord y) /* --------------------------------------------------------------------------- */ -static const char renumber_syntax[] = "Renumber()\n" - "Renumber(filename)"; +static const char renumber_syntax[] = N_("Renumber()\n" + "Renumber(filename)"); static const char renumber_help[] = - "Renumber all elements. The changes will be recorded to filename\n" - "for use in backannotating these changes to the schematic."; + N_("Renumber all elements. The changes will be recorded to filename\n" + "for use in backannotating these changes to the schematic."); /* %start-doc actions Renumber @@ -3415,7 +3416,7 @@ ActionRenumber (int argc, char **argv, Coord x, Coord y) cnt_list = (struct _cnt_list *)realloc (cnt_list, cnt_list_sz); if (cnt_list == NULL) { - fprintf (stderr, "realloc failed() in %s\n", __FUNCTION__); + fprintf (stderr, _("realloc failed() in %s\n"), __FUNCTION__); exit (1); } /* zero out the memory that we added */ @@ -3577,10 +3578,10 @@ ActionRenumber (int argc, char **argv, Coord x, Coord y) /* --------------------------------------------------------------------------- */ -static const char ripup_syntax[] = "RipUp(All|Selected|Element)"; +static const char ripup_syntax[] = N_("RipUp(All|Selected|Element)"); static const char ripup_help[] = - "Ripup auto-routed tracks, or convert an element to parts."; + N_("Ripup auto-routed tracks, or convert an element to parts."); /* %start-doc actions RipUp @@ -3706,9 +3707,10 @@ ActionRipUp (int argc, char **argv, Coord x, Coord y) /* --------------------------------------------------------------------------- */ -static const char addrats_syntax[] = "AddRats(AllRats|SelectedRats|Close)"; +static const char addrats_syntax[] = N_("AddRats(AllRats|SelectedRats|Close)"); -static const char addrats_help[] = "Add one or more rat lines to the board."; +static const char addrats_help[] = + N_("Add one or more rat lines to the board."); /* %start-doc actions AddRats @@ -3785,10 +3787,10 @@ ActionAddRats (int argc, char **argv, Coord x, Coord y) /* --------------------------------------------------------------------------- */ static const char delete_syntax[] = - "Delete(Object|Selected)\n" - "Delete(AllRats|SelectedRats)"; + N_("Delete(Object|Selected)\n" + "Delete(AllRats|SelectedRats)"); -static const char delete_help[] = "Delete stuff."; +static const char delete_help[] = N_("Delete stuff."); /* %start-doc actions Delete @@ -3836,9 +3838,9 @@ ActionDelete (int argc, char **argv, Coord x, Coord y) /* --------------------------------------------------------------------------- */ static const char deleterats_syntax[] = - "DeleteRats(AllRats|Selected|SelectedRats)"; + N_("DeleteRats(AllRats|Selected|SelectedRats)"); -static const char deleterats_help[] = "Delete rat lines."; +static const char deleterats_help[] = N_("Delete rat lines."); /* %start-doc actions DeleteRats @@ -3870,9 +3872,9 @@ ActionDeleteRats (int argc, char **argv, Coord x, Coord y) /* --------------------------------------------------------------------------- */ -static const char autoplace_syntax[] = "AutoPlaceSelected()"; +static const char autoplace_syntax[] = N_("AutoPlaceSelected()"); -static const char autoplace_help[] = "Auto-place selected components."; +static const char autoplace_help[] = N_("Auto-place selected components."); /* %start-doc actions AutoPlaceSelected @@ -3896,9 +3898,9 @@ ActionAutoPlaceSelected (int argc, char **argv, Coord x, Coord y) /* --------------------------------------------------------------------------- */ -static const char autoroute_syntax[] = "AutoRoute(AllRats|SelectedRats)"; +static const char autoroute_syntax[] = N_("AutoRoute(AllRats|SelectedRats)"); -static const char autoroute_help[] = "Auto-route some or all rat lines."; +static const char autoroute_help[] = N_("Auto-route some or all rat lines."); /* %start-doc actions AutoRoute @@ -3949,10 +3951,10 @@ ActionAutoRoute (int argc, char **argv, Coord x, Coord y) /* --------------------------------------------------------------------------- */ static const char markcrosshair_syntax[] = - "MarkCrosshair()\n" - "MarkCrosshair(Center)"; + N_("MarkCrosshair()\n" + "MarkCrosshair(Center)"); -static const char markcrosshair_help[] = "Set/Reset the Crosshair mark."; +static const char markcrosshair_help[] = N_("Set/Reset the Crosshair mark."); /* %start-doc actions MarkCrosshair @@ -4004,13 +4006,13 @@ ActionMarkCrosshair (int argc, char **argv, Coord x, Coord y) /* --------------------------------------------------------------------------- */ static const char changesize_syntax[] = - "ChangeSize(Object, delta)\n" + N_("ChangeSize(Object, delta)\n" "ChangeSize(SelectedObjects|Selected, delta)\n" "ChangeSize(SelectedLines|SelectedPins|SelectedVias, delta)\n" "ChangeSize(SelectedPads|SelectedTexts|SelectedNames, delta)\n" - "ChangeSize(SelectedElements, delta)"; + "ChangeSize(SelectedElements, delta)"); -static const char changesize_help[] = "Changes the size of objects."; +static const char changesize_help[] = N_("Changes the size of objects."); /* %start-doc actions ChangeSize @@ -4107,11 +4109,11 @@ ActionChangeSize (int argc, char **argv, Coord x, Coord y) /* --------------------------------------------------------------------------- */ static const char changedrillsize_syntax[] = - "ChangeDrillSize(Object, delta)\n" - "ChangeDrillSize(SelectedPins|SelectedVias|Selected|SelectedObjects, delta)"; + N_("ChangeDrillSize(Object, delta)\n" + "ChangeDrillSize(SelectedPins|SelectedVias|Selected|SelectedObjects, delta)"); static const char changedrillsize_help[] = - "Changes the drilling hole size of objects."; + N_("Changes the drilling hole size of objects."); /* %start-doc actions ChangeDrillSize @@ -4168,13 +4170,13 @@ ActionChange2ndSize (int argc, char **argv, Coord x, Coord y) /* --------------------------------------------------------------------------- */ static const char changeclearsize_syntax[] = - "ChangeClearSize(Object, delta)\n" + N_("ChangeClearSize(Object, delta)\n" "ChangeClearSize(SelectedPins|SelectedPads|SelectedVias, delta)\n" "ChangeClearSize(SelectedLines|SelectedArcs, delta\n" - "ChangeClearSize(Selected|SelectedObjects, delta)"; + "ChangeClearSize(Selected|SelectedObjects, delta)"); static const char changeclearsize_help[] = - "Changes the clearance size of objects."; + N_("Changes the clearance size of objects."); /* %start-doc actions ChangeClearSize @@ -4248,11 +4250,11 @@ ActionChangeClearSize (int argc, char **argv, Coord x, Coord y) /* --------------------------------------------------------------------------- */ static const char minmaskgap_syntax[] = - "MinMaskGap(delta)\n" - "MinMaskGap(Selected, delta)"; + N_("MinMaskGap(delta)\n" + "MinMaskGap(Selected, delta)"); static const char minmaskgap_help[] = - "Ensures the mask is a minimum distance from pins and pads."; + N_("Ensures the mask is a minimum distance from pins and pads."); /* %start-doc actions MinMaskGap @@ -4332,11 +4334,11 @@ ActionMinMaskGap (int argc, char **argv, Coord x, Coord y) /* --------------------------------------------------------------------------- */ static const char mincleargap_syntax[] = - "MinClearGap(delta)\n" - "MinClearGap(Selected, delta)"; + N_("MinClearGap(delta)\n" + "MinClearGap(Selected, delta)"); static const char mincleargap_help[] = - "Ensures that polygons are a minimum distance from objects."; + N_("Ensures that polygons are a minimum distance from objects."); /* %start-doc actions MinClearGap @@ -4438,10 +4440,10 @@ ActionMinClearGap (int argc, char **argv, Coord x, Coord y) /* --------------------------------------------------------------------------- */ static const char changepinname_syntax[] = - "ChangePinName(ElementName,PinNumber,PinName)"; + N_("ChangePinName(ElementName,PinNumber,PinName)"); static const char changepinname_help[] = - "Sets the name of a specific pin on a specific element."; + N_("Sets the name of a specific pin on a specific element."); /* %start-doc actions ChangePinName @@ -4531,10 +4533,10 @@ ActionChangePinName (int argc, char **argv, Coord x, Coord y) /* --------------------------------------------------------------------------- */ static const char changename_syntax[] = - "ChangeName(Object)\n" - "ChangeName(Layout|Layer)"; + N_("ChangeName(Object)\n" + "ChangeName(Layout|Layer)"); -static const char changename_help[] = "Sets the name of objects."; +static const char changename_help[] = N_("Sets the name of objects."); /* %start-doc actions ChangeName @@ -4629,10 +4631,10 @@ ActionChangeName (int argc, char **argv, Coord x, Coord y) /* --------------------------------------------------------------------------- */ -static const char morphpolygon_syntax[] = "MorphPolygon(Object|Selected)"; +static const char morphpolygon_syntax[] = N_("MorphPolygon(Object|Selected)"); static const char morphpolygon_help[] = - "Converts dead polygon islands into separate polygons."; + N_("Converts dead polygon islands into separate polygons."); /* %start-doc actions MorphPolygon @@ -4686,10 +4688,10 @@ ActionMorphPolygon (int argc, char **argv, Coord x, Coord y) /* --------------------------------------------------------------------------- */ static const char togglehidename_syntax[] = - "ToggleHideName(Object|SelectedElements)"; + N_("ToggleHideName(Object|SelectedElements)"); static const char togglehidename_help[] = - "Toggles the visibility of element names."; + N_("Toggles the visibility of element names."); /* %start-doc actions ToggleHideName @@ -4758,10 +4760,10 @@ ActionToggleHideName (int argc, char **argv, Coord x, Coord y) /* --------------------------------------------------------------------------- */ static const char changejoin_syntax[] = - "ChangeJoin(ToggleObject|SelectedLines|SelectedArcs|Selected)"; + N_("ChangeJoin(ToggleObject|SelectedLines|SelectedArcs|Selected)"); static const char changejoin_help[] = - "Changes the join (clearance through polygons) of objects."; + N_("Changes the join (clearance through polygons) of objects."); /* %start-doc actions ChangeJoin @@ -4819,12 +4821,12 @@ ActionChangeJoin (int argc, char **argv, Coord x, Coord y) /* --------------------------------------------------------------------------- */ static const char changesquare_syntax[] = - "ChangeSquare(ToggleObject)\n" + N_("ChangeSquare(ToggleObject)\n" "ChangeSquare(SelectedElements|SelectedPins)\n" - "ChangeSquare(Selected|SelectedObjects)"; + "ChangeSquare(Selected|SelectedObjects)"); static const char changesquare_help[] = - "Changes the square flag of pins and pads."; + N_("Changes the square flag of pins and pads."); /* %start-doc actions ChangeSquare @@ -4880,9 +4882,9 @@ ActionChangeSquare (int argc, char **argv, Coord x, Coord y) /* --------------------------------------------------------------------------- */ static const char setsquare_syntax[] = - "SetSquare(ToggleObject|SelectedElements|SelectedPins)"; + N_("SetSquare(ToggleObject|SelectedElements|SelectedPins)"); -static const char setsquare_help[] = "sets the square-flag of objects."; +static const char setsquare_help[] = N_("sets the square-flag of objects."); /* %start-doc actions SetSquare @@ -4938,10 +4940,10 @@ ActionSetSquare (int argc, char **argv, Coord x, Coord y) /* --------------------------------------------------------------------------- */ static const char clearsquare_syntax[] = - "ClearSquare(ToggleObject|SelectedElements|SelectedPins)"; + N_("ClearSquare(ToggleObject|SelectedElements|SelectedPins)"); static const char clearsquare_help[] = - "Clears the square-flag of pins and pads."; + N_("Clears the square-flag of pins and pads."); /* %start-doc actions ClearSquare @@ -4997,11 +4999,11 @@ ActionClearSquare (int argc, char **argv, Coord x, Coord y) /* --------------------------------------------------------------------------- */ static const char changeoctagon_syntax[] = - "ChangeOctagon(Object|ToggleObject|SelectedObjects|Selected)\n" - "ChangeOctagon(SelectedElements|SelectedPins|SelectedVias)"; + N_("ChangeOctagon(Object|ToggleObject|SelectedObjects|Selected)\n" + "ChangeOctagon(SelectedElements|SelectedPins|SelectedVias)"); static const char changeoctagon_help[] = - "Changes the octagon-flag of pins and vias."; + N_("Changes the octagon-flag of pins and vias."); /* %start-doc actions ChangeOctagon @@ -5060,9 +5062,9 @@ ActionChangeOctagon (int argc, char **argv, Coord x, Coord y) /* --------------------------------------------------------------------------- */ static const char setoctagon_syntax[] = - "SetOctagon(Object|ToggleObject|SelectedElements|Selected)"; + N_("SetOctagon(Object|ToggleObject|SelectedElements|Selected)"); -static const char setoctagon_help[] = "Sets the octagon-flag of objects."; +static const char setoctagon_help[] = N_("Sets the octagon-flag of objects."); /* %start-doc actions SetOctagon @@ -5121,11 +5123,11 @@ ActionSetOctagon (int argc, char **argv, Coord x, Coord y) /* --------------------------------------------------------------------------- */ static const char clearoctagon_syntax[] = - "ClearOctagon(ToggleObject|Object|SelectedObjects|Selected)\n" - "ClearOctagon(SelectedElements|SelectedPins|SelectedVias)"; + N_("ClearOctagon(ToggleObject|Object|SelectedObjects|Selected)\n" + "ClearOctagon(SelectedElements|SelectedPins|SelectedVias)"); static const char clearoctagon_help[] = - "Clears the octagon-flag of pins and vias."; + N_("Clears the octagon-flag of pins and vias."); /* %start-doc actions ClearOctagon @@ -5184,9 +5186,9 @@ ActionClearOctagon (int argc, char **argv, Coord x, Coord y) /* --------------------------------------------------------------------------- */ static const char changehold_syntax[] = - "ChangeHole(ToggleObject|Object|SelectedVias|Selected)"; + N_("ChangeHole(ToggleObject|Object|SelectedVias|Selected)"); -static const char changehold_help[] = "Changes the hole flag of objects."; +static const char changehold_help[] = N_("Changes the hole flag of objects."); /* %start-doc actions ChangeHole @@ -5230,9 +5232,10 @@ ActionChangeHole (int argc, char **argv, Coord x, Coord y) /* --------------------------------------------------------------------------- */ static const char changepaste_syntax[] = - "ChangePaste(ToggleObject|Object|SelectedPads|Selected)"; + N_("ChangePaste(ToggleObject|Object|SelectedPads|Selected)"); -static const char changepaste_help[] = "Changes the no paste flag of objects."; +static const char changepaste_help[] = + N_("Changes the no paste flag of objects."); /* %start-doc actions ChangePaste @@ -5278,15 +5281,15 @@ ActionChangePaste (int argc, char **argv, Coord x, Coord y) /* --------------------------------------------------------------------------- */ static const char select_syntax[] = - "Select(Object|ToggleObject)\n" + N_("Select(Object|ToggleObject)\n" "Select(All|Block|Connection)\n" "Select(ElementByName|ObjectByName|PadByName|PinByName)\n" "Select(ElementByName|ObjectByName|PadByName|PinByName, Name)\n" "Select(TextByName|ViaByName|NetByName)\n" "Select(TextByName|ViaByName|NetByName, Name)\n" - "Select(Convert)"; + "Select(Convert)"); -static const char select_help[] = "Toggles or sets the selection."; +static const char select_help[] = N_("Toggles or sets the selection."); /* %start-doc actions Select @@ -5486,14 +5489,14 @@ FlagHaveRegex (int parm) /* --------------------------------------------------------------------------- */ static const char unselect_syntax[] = - "Unselect(All|Block|Connection)\n" + N_("Unselect(All|Block|Connection)\n" "Unselect(ElementByName|ObjectByName|PadByName|PinByName)\n" "Unselect(ElementByName|ObjectByName|PadByName|PinByName, Name)\n" "Unselect(TextByName|ViaByName)\n" - "Unselect(TextByName|ViaByName, Name)\n"; + "Unselect(TextByName|ViaByName, Name)\n"); static const char unselect_help[] = - "Unselects the object at the pointer location or the specified objects."; + N_("Unselects the object at the pointer location or the specified objects."); /* %start-doc actions Unselect @@ -5646,11 +5649,11 @@ ActionUnselect (int argc, char **argv, Coord x, Coord y) /* --------------------------------------------------------------------------- */ static const char saveto_syntax[] = - "SaveTo(Layout|LayoutAs,filename)\n" + N_("SaveTo(Layout|LayoutAs,filename)\n" "SaveTo(AllConnections|AllUnusedPins|ElementConnections,filename)\n" - "SaveTo(PasteBuffer,filename)"; + "SaveTo(PasteBuffer,filename)"); -static const char saveto_help[] = "Saves data to a file."; +static const char saveto_help[] = N_("Saves data to a file."); /* %start-doc actions SaveTo @@ -5769,10 +5772,10 @@ ActionSaveTo (int argc, char **argv, Coord x, Coord y) /* --------------------------------------------------------------------------- */ static const char savesettings_syntax[] = - "SaveSettings()\n" - "SaveSettings(local)"; + N_("SaveSettings()\n" + "SaveSettings(local)"); -static const char savesettings_help[] = "Saves settings."; +static const char savesettings_help[] = N_("Saves settings."); /* %start-doc actions SaveSettings @@ -5793,9 +5796,9 @@ ActionSaveSettings (int argc, char **argv, Coord x, Coord y) /* --------------------------------------------------------------------------- */ static const char loadfrom_syntax[] = - "LoadFrom(Layout|LayoutToBuffer|ElementToBuffer|Netlist|Revert,filename)"; + N_("LoadFrom(Layout|LayoutToBuffer|ElementToBuffer|Netlist|Revert,filename)"); -static const char loadfrom_help[] = "Load layout data from a file."; +static const char loadfrom_help[] = N_("Load layout data from a file."); /* %start-doc actions LoadFrom @@ -5884,9 +5887,9 @@ ActionLoadFrom (int argc, char **argv, Coord x, Coord y) /* --------------------------------------------------------------------------- */ -static const char new_syntax[] = "New([name])"; +static const char new_syntax[] = N_("New([name])"); -static const char new_help[] = "Starts a new layout."; +static const char new_help[] = N_("Starts a new layout."); /* %start-doc actions New @@ -5950,13 +5953,13 @@ ActionBell (char *volume) /* --------------------------------------------------------------------------- */ static const char pastebuffer_syntax[] = - "PasteBuffer(AddSelected|Clear|1..MAX_BUFFER)\n" + N_("PasteBuffer(AddSelected|Clear|1..MAX_BUFFER)\n" "PasteBuffer(Rotate, 1..3)\n" "PasteBuffer(Convert|Save|Restore|Mirror)\n" - "PasteBuffer(ToLayout, X, Y, units)"; + "PasteBuffer(ToLayout, X, Y, units)"); static const char pastebuffer_help[] = - "Various operations on the paste buffer."; + N_("Various operations on the paste buffer."); /* %start-doc actions PasteBuffer @@ -6154,10 +6157,10 @@ ActionPasteBuffer (int argc, char **argv, Coord x, Coord y) /* --------------------------------------------------------------------------- */ -static const char undo_syntax[] = "Undo()\n" - "Undo(ClearList)"; +static const char undo_syntax[] = N_("Undo()\n" + "Undo(ClearList)"); -static const char undo_help[] = "Undo recent changes."; +static const char undo_help[] = N_("Undo recent changes."); /* %start-doc actions Undo @@ -6333,9 +6336,9 @@ ActionUndo (int argc, char **argv, Coord x, Coord y) /* --------------------------------------------------------------------------- */ -static const char redo_syntax[] = "Redo()"; +static const char redo_syntax[] = N_("Redo()"); -static const char redo_help[] = "Redo recent \"undo\" operations."; +static const char redo_help[] = N_("Redo recent \"undo\" operations."); /* %start-doc actions Redo @@ -6381,9 +6384,9 @@ ActionRedo (int argc, char **argv, Coord x, Coord y) /* --------------------------------------------------------------------------- */ -static const char polygon_syntax[] = "Polygon(Close|PreviousPoint)"; +static const char polygon_syntax[] = N_("Polygon(Close|PreviousPoint)"); -static const char polygon_help[] = "Some polygon related stuff."; +static const char polygon_help[] = N_("Some polygon related stuff."); /* %start-doc actions Polygon @@ -6429,10 +6432,10 @@ ActionPolygon (int argc, char **argv, Coord x, Coord y) /* --------------------------------------------------------------------------- */ -static const char routestyle_syntax[] = "RouteStyle(1|2|3|4)"; +static const char routestyle_syntax[] = N_("RouteStyle(1|2|3|4)"); static const char routestyle_help[] = - "Copies the indicated routing style into the current sizes."; + N_("Copies the indicated routing style into the current sizes."); /* %start-doc actions RouteStyle @@ -6464,9 +6467,10 @@ ActionRouteStyle (int argc, char **argv, Coord x, Coord y) /* --------------------------------------------------------------------------- */ -static const char moveobject_syntax[] = "MoveObject(X,Y,dim)"; +static const char moveobject_syntax[] = N_("MoveObject(X,Y,dim)"); -static const char moveobject_help[] = "Moves the object under the crosshair."; +static const char moveobject_help[] = + N_("Moves the object under the crosshair."); /* %start-doc actions MoveObject @@ -6515,10 +6519,10 @@ ActionMoveObject (int argc, char **argv, Coord x, Coord y) /* --------------------------------------------------------------------------- */ static const char movetocurrentlayer_syntax[] = - "MoveToCurrentLayer(Object|SelectedObjects)"; + N_("MoveToCurrentLayer(Object|SelectedObjects)"); static const char movetocurrentlayer_help[] = - "Moves objects to the current layer."; + N_("Moves objects to the current layer."); /* %start-doc actions MoveToCurrentLayer @@ -6561,10 +6565,10 @@ ActionMoveToCurrentLayer (int argc, char **argv, Coord x, Coord y) } -static const char setsame_syntax[] = "SetSame()"; +static const char setsame_syntax[] = N_("SetSame()"); static const char setsame_help[] = - "Sets current layer and sizes to match indicated item."; + N_("Sets current layer and sizes to match indicated item."); /* %start-doc actions SetSame @@ -6637,13 +6641,13 @@ ActionSetSame (int argc, char **argv, Coord x, Coord y) /* --------------------------------------------------------------------------- */ static const char setflag_syntax[] = - "SetFlag(Object|Selected|SelectedObjects, flag)\n" + N_("SetFlag(Object|Selected|SelectedObjects, flag)\n" "SetFlag(SelectedLines|SelectedPins|SelectedVias, flag)\n" "SetFlag(SelectedPads|SelectedTexts|SelectedNames, flag)\n" "SetFlag(SelectedElements, flag)\n" - "flag = square | octagon | thermal | join"; + "flag = square | octagon | thermal | join"); -static const char setflag_help[] = "Sets flags on objects."; +static const char setflag_help[] = N_("Sets flags on objects."); /* %start-doc actions SetFlag @@ -6668,13 +6672,13 @@ ActionSetFlag (int argc, char **argv, Coord x, Coord y) /* --------------------------------------------------------------------------- */ static const char clrflag_syntax[] = - "ClrFlag(Object|Selected|SelectedObjects, flag)\n" + N_("ClrFlag(Object|Selected|SelectedObjects, flag)\n" "ClrFlag(SelectedLines|SelectedPins|SelectedVias, flag)\n" "ClrFlag(SelectedPads|SelectedTexts|SelectedNames, flag)\n" "ClrFlag(SelectedElements, flag)\n" - "flag = square | octagon | thermal | join"; + "flag = square | octagon | thermal | join"); -static const char clrflag_help[] = "Clears flags on objects."; +static const char clrflag_help[] = N_("Clears flags on objects."); /* %start-doc actions ClrFlag @@ -6699,14 +6703,14 @@ ActionClrFlag (int argc, char **argv, Coord x, Coord y) /* --------------------------------------------------------------------------- */ static const char changeflag_syntax[] = - "ChangeFlag(Object|Selected|SelectedObjects, flag, value)\n" + N_("ChangeFlag(Object|Selected|SelectedObjects, flag, value)\n" "ChangeFlag(SelectedLines|SelectedPins|SelectedVias, flag, value)\n" "ChangeFlag(SelectedPads|SelectedTexts|SelectedNames, flag, value)\n" "ChangeFlag(SelectedElements, flag, value)\n" "flag = square | octagon | thermal | join\n" - "value = 0 | 1"; + "value = 0 | 1"); -static const char changeflag_help[] = "Sets or clears flags on objects."; +static const char changeflag_help[] = N_("Sets or clears flags on objects."); /* %start-doc actions ChangeFlag @@ -6822,9 +6826,9 @@ ChangeFlag (char *what, char *flag_name, int value, char *cmd_name) /* --------------------------------------------------------------------------- */ -static const char executefile_syntax[] = "ExecuteFile(filename)"; +static const char executefile_syntax[] = N_("ExecuteFile(filename)"); -static const char executefile_help[] = "Run actions from the given file."; +static const char executefile_help[] = N_("Run actions from the given file."); /* %start-doc actions ExecuteFile @@ -6948,9 +6952,11 @@ delete_attr (AttributeListType *list, AttributeType *attr) } /* ---------------------------------------------------------------- */ -static const char elementlist_syntax[] = "ElementList(Start|Done|Need,,,)"; +static const char elementlist_syntax[] = + N_("ElementList(Start|Done|Need,,,)"); -static const char elementlist_help[] = "Adds the given element if it doesn't already exist."; +static const char elementlist_help[] = + N_("Adds the given element if it doesn't already exist."); /* %start-doc actions elementlist @@ -7028,8 +7034,8 @@ ActionElementList (int argc, char **argv, Coord x, Coord y) } END_LOOP; if (number_of_footprints_not_found > 0) - gui->confirm_dialog ("Not all requested footprints were found.\n" - "See the message log for details", + gui->confirm_dialog (_("Not all requested footprints were found.\n" + "See the message log for details"), "Ok", NULL); return 0; } @@ -7164,9 +7170,11 @@ ActionElementList (int argc, char **argv, Coord x, Coord y) } /* ---------------------------------------------------------------- */ -static const char elementsetattr_syntax[] = "ElementSetAttr(refdes,name[,value])"; +static const char elementsetattr_syntax[] = + N_("ElementSetAttr(refdes,name[,value])"); -static const char elementsetattr_help[] = "Sets or clears an element-specific attribute."; +static const char elementsetattr_help[] = + N_("Sets or clears an element-specific attribute."); /* %start-doc actions elementsetattr @@ -7228,9 +7236,9 @@ ActionElementSetAttr (int argc, char **argv, Coord x, Coord y) } /* ---------------------------------------------------------------- */ -static const char execcommand_syntax[] = "ExecCommand(command)"; +static const char execcommand_syntax[] = N_("ExecCommand(command)"); -static const char execcommand_help[] = "Runs a command."; +static const char execcommand_help[] = N_("Runs a command."); /* %start-doc actions execcommand @@ -7463,12 +7471,12 @@ tempfile_unlink (char * name) /* ---------------------------------------------------------------- */ static const char import_syntax[] = - "Import()\n" + N_("Import()\n" "Import([gnetlist|make[,source,source,...]])\n" "Import(setnewpoint[,(mark|center|X,Y)])\n" - "Import(setdisperse,D,units)\n"; + "Import(setdisperse,D,units)\n"); -static const char import_help[] = "Import schematics."; +static const char import_help[] = N_("Import schematics."); /* %start-doc actions Import @@ -7874,12 +7882,12 @@ ActionImport (int argc, char **argv, Coord x, Coord y) /* ------------------------------------------------------------ */ static const char attributes_syntax[] = -"Attributes(Layout|Layer|Element)\n" -"Attributes(Layer,layername)"; + N_("Attributes(Layout|Layer|Element)\n" + "Attributes(Layer,layername)"); static const char attributes_help[] = -"Let the user edit the attributes of the layout, current or given\n" -"layer, or selected element."; + N_("Let the user edit the attributes of the layout, current or given\n" + "layer, or selected element."); /* %start-doc actions Attributes @@ -7909,7 +7917,7 @@ ActionAttributes (int argc, char **argv, Coord x, Coord y) { case F_Layout: { - gui->edit_attributes("Layout Attributes", &(PCB->Attributes)); + gui->edit_attributes(_("Layout Attributes"), &(PCB->Attributes)); return 0; } @@ -7932,8 +7940,9 @@ ActionAttributes (int argc, char **argv, Coord x, Coord y) return 1; } } - buf = (char *) malloc (strlen (layer->Name) + strlen ("Layer X Attributes")); - sprintf (buf, "Layer %s Attributes", layer->Name); + buf = (char *) malloc (strlen (layer->Name) + + strlen (_("Layer %s Attributes"))); + sprintf (buf, _("Layer %s Attributes"), layer->Name); gui->edit_attributes(buf, &(layer->Attributes)); free (buf); return 0; @@ -7974,12 +7983,13 @@ ActionAttributes (int argc, char **argv, Coord x, Coord y) if (NAMEONPCB_NAME(e)) { - buf = (char *) malloc (strlen (NAMEONPCB_NAME(e)) + strlen ("Element X Attributes")); - sprintf(buf, "Element %s Attributes", NAMEONPCB_NAME(e)); + buf = (char *) malloc (strlen (NAMEONPCB_NAME(e)) + + strlen (_("Element %s Attributes"))); + sprintf(buf, _("Element %s Attributes"), NAMEONPCB_NAME(e)); } else { - buf = strdup ("Unnamed Element Attributes"); + buf = strdup (_("Unnamed Element Attributes")); } gui->edit_attributes(buf, &(e->Attributes)); free (buf); diff --git a/src/buffer.c b/src/buffer.c index d5cb7c8..068643e 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -714,7 +714,7 @@ LoadFootprintByName (BufferType *Buffer, char *Footprint) } if (!fpe) { - Message("Unable to load footprint %s\n", Footprint); + Message(_("Unable to load footprint %s\n"), Footprint); return 1; } @@ -775,9 +775,11 @@ LoadFootprintByName (BufferType *Buffer, char *Footprint) } -static const char loadfootprint_syntax[] = "LoadFootprint(filename[,refdes,value])"; +static const char loadfootprint_syntax[] = + N_("LoadFootprint(filename[,refdes,value])"); -static const char loadfootprint_help[] = "Loads a single footprint by name."; +static const char loadfootprint_help[] = + N_("Loads a single footprint by name."); /* %start-doc actions LoadFootprint @@ -803,12 +805,12 @@ LoadFootprint (int argc, char **argv, Coord x, Coord y) if (PASTEBUFFER->Data->ElementN == 0) { - Message("Footprint %s contains no elements", name); + Message(_("Footprint %s contains no elements"), name); return 1; } if (PASTEBUFFER->Data->ElementN > 1) { - Message("Footprint %s contains multiple elements", name); + Message(_("Footprint %s contains multiple elements"), name); return 1; } @@ -1345,12 +1347,12 @@ FreeRotateBuffer (BufferType *Buffer, Angle angle) /* -------------------------------------------------------------------------- */ static const char freerotatebuffer_syntax[] = - "FreeRotateBuffer([Angle])"; + N_("FreeRotateBuffer([Angle])"); static const char freerotatebuffer_help[] = - "Rotates the current paste buffer contents by the specified angle. The\n" + N_("Rotates the current paste buffer contents by the specified angle. The\n" "angle is given in degrees. If no angle is given, the user is prompted\n" - "for one.\n"; + "for one.\n"); /* %start-doc actions FreeRotateBuffer @@ -1365,7 +1367,7 @@ ActionFreeRotateBuffer(int argc, char **argv, Coord x, Coord y) char *angle_s; if (argc < 1) - angle_s = gui->prompt_for ("Enter Rotation (degrees, CCW):", "0"); + angle_s = gui->prompt_for (_("Enter Rotation (degrees, CCW):"), "0"); else angle_s = argv[0]; diff --git a/src/hid/common/actions.c b/src/hid/common/actions.c index abd86ae..78595d7 100644 --- a/src/hid/common/actions.c +++ b/src/hid/common/actions.c @@ -220,7 +220,7 @@ hid_actionv (const char *name, int argc, char **argv) if (!a) { int i; - Message ("no action %s(", name); + Message (_("no action %s("), name); for (i = 0; i < argc; i++) Message ("%s%s", i ? ", " : "", argv[i]); Message (")\n"); diff --git a/src/hid/gtk/gtkhid-main.c b/src/hid/gtk/gtkhid-main.c index 8e39be4..b24b9f7 100644 --- a/src/hid/gtk/gtkhid-main.c +++ b/src/hid/gtk/gtkhid-main.c @@ -884,7 +884,7 @@ ghid_attributes_need_rows (int new_max) while (attr_max_rows < new_max) { /* add [attr_max_rows] */ - attr_row[attr_max_rows].del = gtk_button_new_with_label ("del"); + attr_row[attr_max_rows].del = gtk_button_new_with_label (_("del")); gtk_table_attach (GTK_TABLE (attr_table), attr_row[attr_max_rows].del, 0, 1, attr_max_rows, attr_max_rows+1, @@ -990,8 +990,8 @@ ghid_attributes (char *owner, AttributeListType *attrs) GTK_WINDOW (ghid_port.top_window), GTK_DIALOG_MODAL, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, - "Revert", GA_RESPONSE_REVERT, - "New", GA_RESPONSE_NEW, + _("Revert"), GA_RESPONSE_REVERT, + _("New"), GA_RESPONSE_NEW, GTK_STOCK_OK, GTK_RESPONSE_OK, NULL); attr_table = gtk_table_new (attrs->Number, 3, 0); diff --git a/src/hid/gtk/gui-config.c b/src/hid/gtk/gui-config.c index 2f2e3fb..7bf20bd 100644 --- a/src/hid/gtk/gui-config.c +++ b/src/hid/gtk/gui-config.c @@ -1234,27 +1234,24 @@ static void config_library_tab_create (GtkWidget * tab_vbox) { GtkWidget *vbox, *label, *entry; + GString *string; gtk_container_set_border_width (GTK_CONTAINER (tab_vbox), 6); vbox = ghid_category_vbox (tab_vbox, _("Element Directories"), 4, 2, TRUE, TRUE); - label = gtk_label_new (""); - gtk_label_set_use_markup (GTK_LABEL (label), TRUE); - gtk_label_set_markup (GTK_LABEL (label), - _ - ("Enter a \"" - PCB_PATH_DELIMETER - "\" separated list of custom top level\n" - "element directories. For example:\n" - "\t~/gaf/pcb-elements" - PCB_PATH_DELIMETER - "packages" - PCB_PATH_DELIMETER - "/usr/local/pcb-elements\n" + string = g_string_new (""); + g_string_printf (string, _("Enter a \"%s\" " + "separated list of custom top level\n" + "element directories. For example:\n%s\n" "Elements should be organized into subdirectories below each\n" "top level directory. Restart program for changes to take effect." - "")); - + ""), PCB_PATH_DELIMETER, + "\t~/gaf/pcb-elements" PCB_PATH_DELIMETER + "packages" PCB_PATH_DELIMETER "/usr/local/pcb-elements\n"); + label = gtk_label_new (""); + gtk_label_set_use_markup (GTK_LABEL (label), TRUE); + gtk_label_set_markup (GTK_LABEL (label), string->str); + g_string_free (string, TRUE); gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); entry = gtk_entry_new (); library_newlib_entry = entry; diff --git a/src/hid/gtk/gui-dialog.c b/src/hid/gtk/gui-dialog.c index e3b93ce..56e0d25 100644 --- a/src/hid/gtk/gui-dialog.c +++ b/src/hid/gtk/gui-dialog.c @@ -51,7 +51,7 @@ ghid_dialog_input (const char * prompt, const char * initial) gboolean response; GHidPort *out = &ghid_port; - dialog = gtk_dialog_new_with_buttons ("PCB User Input", + dialog = gtk_dialog_new_with_buttons (_("PCB User Input"), GTK_WINDOW (out->top_window), GTK_DIALOG_MODAL, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, @@ -65,7 +65,7 @@ ghid_dialog_input (const char * prompt, const char * initial) gtk_label_set_use_markup (GTK_LABEL (label), TRUE); gtk_label_set_markup (GTK_LABEL (label), - prompt ? prompt : "Enter something"); + prompt ? prompt : _("Enter something")); entry = gtk_entry_new (); if (initial) @@ -115,13 +115,13 @@ ghid_dialog_confirm_all (gchar * all_message) gint response; GHidPort *out = &ghid_port; - dialog = gtk_dialog_new_with_buttons ("Confirm", + dialog = gtk_dialog_new_with_buttons (_("Confirm"), GTK_WINDOW (out->top_window), (GtkDialogFlags)(GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OK, GTK_RESPONSE_OK, - "Sequence OK", + _("Sequence OK"), GUI_DIALOG_RESPONSE_ALL, NULL); content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); diff --git a/src/hid/gtk/gui-drc-window.c b/src/hid/gtk/gui-drc-window.c index ab929bd..981624c 100644 --- a/src/hid/gtk/gui-drc-window.c +++ b/src/hid/gtk/gui-drc-window.c @@ -533,13 +533,13 @@ ghid_violation_renderer_set_property (GObject * object, guint property_id, if (renderer->violation->have_measured) { - markup = pcb_g_strdup_printf ("%m+%s (%$mS)\n" + markup = pcb_g_strdup_printf (_("%m+%s (%$mS)\n" " \n" "" "%s\n" " \n" "Required: %$mS" - "", + ""), Settings.grid_unit->allow, renderer->violation->title, renderer->violation->measured_value, @@ -548,13 +548,13 @@ ghid_violation_renderer_set_property (GObject * object, guint property_id, } else { - markup = pcb_g_strdup_printf ("%m+%s\n" + markup = pcb_g_strdup_printf (_("%m+%s\n" " \n" "" "%s\n" " \n" "Required: %$mS" - "", + ""), Settings.grid_unit->allow, renderer->violation->title, renderer->violation->explanation, diff --git a/src/hid/gtk/gui-output-events.c b/src/hid/gtk/gui-output-events.c index 2ca39de..2efb291 100644 --- a/src/hid/gtk/gui-output-events.c +++ b/src/hid/gtk/gui-output-events.c @@ -445,12 +445,12 @@ describe_location (Coord X, Coord Y) } END_LOOP; - description = g_strdup_printf ("Element name: %s\n" + description = g_strdup_printf (_("Element name: %s\n" "Pinname : %s\n" - "Netname : %s", + "Netname : %s"), elename, - (pinname != NULL) ? pinname : "--", - (netname != NULL) ? netname : "--"); + (pinname != NULL) ? pinname : _("--"), + (netname != NULL) ? netname : _("--")); g_free (netname); diff --git a/src/hid/gtk/gui-top-window.c b/src/hid/gtk/gui-top-window.c index 4df86e8..69fe7da 100644 --- a/src/hid/gtk/gui-top-window.c +++ b/src/hid/gtk/gui-top-window.c @@ -1664,7 +1664,7 @@ Listen for actions on stdin. @end ftable %end-doc */ - {"listen", "Listen for actions on stdin", + {"listen", N_("Listen for actions on stdin"), HID_Boolean, 0, 0, {0, 0, 0}, 0, &stdin_listen}, #define HA_listen 0 @@ -1677,7 +1677,7 @@ automatically scaled to fit the canvas. @end ftable %end-doc */ - {"bg-image", "Background Image", + {"bg-image", N_("Background Image"), HID_String, 0, 0, {0, 0, 0}, 0, &bg_image_file}, #define HA_bg_image 1 @@ -1688,7 +1688,7 @@ Location of the @file{gpcb-menu.res} file which defines the menu for the GTK+ GU @end ftable %end-doc */ -{"pcb-menu", "Location of gpcb-menu.res file", +{"pcb-menu", N_("Location of gpcb-menu.res file"), HID_String, 0, 0, {0, PCBLIBDIR "/gpcb-menu.res", 0}, 0, &pcbmenu_path} #define HA_pcbmenu 2 }; @@ -1848,12 +1848,12 @@ LayersChanged (int argc, char **argv, Coord x, Coord y) } static const char toggleview_syntax[] = -"ToggleView(1..MAXLAYER)\n" -"ToggleView(layername)\n" -"ToggleView(Silk|Rats|Pins|Vias|Mask|BackSide)"; + N_("ToggleView(1..MAXLAYER)\n" + "ToggleView(layername)\n" + "ToggleView(Silk|Rats|Pins|Vias|Mask|BackSide)"); static const char toggleview_help[] = -"Toggle the visibility of the specified layer or layer group."; + N_("Toggle the visibility of the specified layer or layer group."); /* %start-doc actions ToggleView @@ -1922,10 +1922,10 @@ ToggleView (int argc, char **argv, Coord x, Coord y) } static const char selectlayer_syntax[] = -"SelectLayer(1..MAXLAYER|Silk|Rats)"; + N_("SelectLayer(1..MAXLAYER|Silk|Rats)"); static const char selectlayer_help[] = -"Select which layer is the current layer."; + N_("Select which layer is the current layer."); /* %start-doc actions SelectLayer @@ -2164,10 +2164,10 @@ ghid_load_menus (void) /* ------------------------------------------------------------ */ static const char adjuststyle_syntax[] = -"AdjustStyle()\n"; + N_("AdjustStyle()\n"); static const char adjuststyle_help[] = -"Open the window which allows editing of the route styles."; + N_("Open the window which allows editing of the route styles."); /* %start-doc actions AdjustStyle @@ -2189,10 +2189,10 @@ AdjustStyle(int argc, char **argv, Coord x, Coord y) /* ------------------------------------------------------------ */ static const char editlayergroups_syntax[] = -"EditLayerGroups()\n"; + N_("EditLayerGroups()\n"); static const char editlayergroups_help[] = -"Open the preferences window which allows editing of the layer groups."; + N_("Open the preferences window which allows editing of the layer groups."); /* %start-doc actions EditLayerGroups diff --git a/src/hid/lpr/lpr.c b/src/hid/lpr/lpr.c index a03b19c..1b2f4fc 100644 --- a/src/hid/lpr/lpr.c +++ b/src/hid/lpr/lpr.c @@ -22,7 +22,9 @@ #include #endif -#define CRASH fprintf(stderr, "HID error: pcb called unimplemented PS function %s.\n", __FUNCTION__); abort() +#define CRASH fprintf(stderr, \ + _("HID error: pcb called unimplemented PS function %s.\n"), \ + __FUNCTION__); abort() static HID_Attribute base_lpr_options[] = { @@ -36,7 +38,7 @@ PDF output with a virtual PDF printer. Example: @* @noindent In addition, all @ref{Postscript Export} options are valid. %end-doc */ - {"lprcommand", "Command to use for printing", + {"lprcommand", N_("Command to use for printing"), HID_String, 0, 0, {0, 0, 0}, 0, 0}, #define HA_lprcommand 0 }; @@ -92,7 +94,7 @@ lpr_do_export (HID_Attr_Val * options) filename = options[HA_lprcommand].str_value; - printf ("LPR: open %s\n", filename); + printf (_("LPR: open %s\n"), filename); f = popen (filename, "w"); if (!f) { @@ -131,7 +133,7 @@ hid_lpr_init () lpr_hid.struct_size = sizeof (HID); lpr_hid.name = "lpr"; - lpr_hid.description = "Postscript print"; + lpr_hid.description = N_("Postscript print"); lpr_hid.printer = 1; lpr_hid.poly_before = 1; diff --git a/src/misc.c b/src/misc.c index 5c43754..064c3e4 100644 --- a/src/misc.c +++ b/src/misc.c @@ -1371,14 +1371,15 @@ LayerStringToLayerStack (char *s) } if (!found) { - fprintf(stderr, "Warning: layer \"%s\" not known\n", args[i]); + fprintf(stderr, _("Warning: layer \"%s\" not known\n"), args[i]); if (!listed_layers) { - fprintf (stderr, "Named layers in this board are:\n"); + fprintf (stderr, _("Named layers in this board are:\n")); listed_layers = 1; for (lno=0; lno < max_copper_layer; lno ++) fprintf(stderr, "\t%s\n", PCB->Data->Layer[lno].Name); - fprintf(stderr, "Also: component, solder, rats, invisible, pins, vias, elements or silk, mask, solderside.\n"); + fprintf(stderr, _("Also: component, solder, rats, invisible, " + "pins, vias, elements or silk, mask, solderside.\n")); } } } @@ -1457,7 +1458,7 @@ GetObjectBoundingBox (int Type, void *Ptr1, void *Ptr2, void *Ptr3) case LINEPOINT_TYPE: return (BoxType *)Ptr3; default: - Message ("Request for bounding box of unsupported type %d\n", Type); + Message (_("Request for bounding box of unsupported type %d\n"), Type); return (BoxType *)Ptr2; } } @@ -2188,32 +2189,34 @@ GetInfoString (void) if (first_time) { first_time = 0; - DSAddString (&info, "This is PCB, an interactive\n"); - DSAddString (&info, "printed circuit board editor\n"); - DSAddString (&info, "version "); - DSAddString (&info, VERSION); - DSAddString (&info, "\n\n"); - DSAddString (&info, "Compiled on " __DATE__ " at " __TIME__); - DSAddString (&info, "\n\n" "by harry eaton\n\n"); DSAddString (&info, - "Copyright (C) Thomas Nau 1994, 1995, 1996, 1997\n"); - DSAddString (&info, "Copyright (C) harry eaton 1998-2007\n"); - DSAddString (&info, "Copyright (C) C. Scott Ananian 2001\n"); + _("This is PCB, an interactive\n" + "printed circuit board editor\n" + "version ")); DSAddString (&info, - "Copyright (C) DJ Delorie 2003, 2004, 2005, 2006, 2007, 2008\n"); + VERSION "\n\n" + "Compiled on " __DATE__ " at " __TIME__ "\n\n" + "by harry eaton\n\n" + "Copyright (C) Thomas Nau 1994, 1995, 1996, 1997\n" + "Copyright (C) harry eaton 1998-2007\n" + "Copyright (C) C. Scott Ananian 2001\n" + "Copyright (C) DJ Delorie 2003, 2004, 2005, 2006, 2007, 2008\n" + "Copyright (C) Dan McMahill 2003, 2004, 2005, 2006, 2007, 2008\n\n"); DSAddString (&info, - "Copyright (C) Dan McMahill 2003, 2004, 2005, 2006, 2007, 2008\n\n"); - DSAddString (&info, "It is licensed under the terms of the GNU\n"); - DSAddString (&info, "General Public License version 2\n"); - DSAddString (&info, "See the LICENSE file for more information\n\n"); - DSAddString (&info, "For more information see:\n\n"); - DSAddString (&info, "PCB homepage: http://pcb.geda-project.org\n"); - DSAddString (&info, "gEDA homepage: http://www.geda-project.org\n"); - DSAddString (&info, "gEDA Wiki: http://wiki.geda-project.org\n"); - - DSAddString (&info, "----- Compile Time Options -----\n"); + _("It is licensed under the terms of the GNU\n" + "General Public License version 2\n" + "See the LICENSE file for more information\n\n" + "For more information see:\n")); + DSAddString (&info, _("PCB homepage: ")); + DSAddString (&info, "http://pcb.geda-project.org\n"); + DSAddString (&info, _("gEDA homepage: ")); + DSAddString (&info, "http://www.geda-project.org\n"); + DSAddString (&info, _("gEDA Wiki: ")); + DSAddString (&info, "http://wiki.geda-project.org\n"); + + DSAddString (&info, _("\n----- Compile Time Options -----\n")); hids = hid_enumerate (); - DSAddString (&info, "GUI:\n"); + DSAddString (&info, _("GUI:\n")); for (i = 0; hids[i]; i++) { if (hids[i]->gui) @@ -2226,7 +2229,7 @@ GetInfoString (void) } } - DSAddString (&info, "Exporters:\n"); + DSAddString (&info, _("Exporters:\n")); for (i = 0; hids[i]; i++) { if (hids[i]->exporter) @@ -2239,7 +2242,7 @@ GetInfoString (void) } } - DSAddString (&info, "Printers:\n"); + DSAddString (&info, _("Printers:\n")); for (i = 0; hids[i]; i++) { if (hids[i]->printer) diff --git a/src/parse_y.y b/src/parse_y.y index fdd6392..6cd4c7b 100644 --- a/src/parse_y.y +++ b/src/parse_y.y @@ -166,7 +166,7 @@ parsepcb if (!yyPCB) { - Message("illegal fileformat\n"); + Message(_("illegal fileformat\n")); YYABORT; } for (i = 0; i < MAX_LAYER + 2; i++) @@ -198,7 +198,7 @@ parsepcb CreateNewPCBPost (yyPCB, 0); if (ParseGroupString(layer_group_string, &yyPCB->LayerGroups, yyData->LayerN)) { - Message("illegal layer-group string\n"); + Message(_("illegal layer-group string\n")); YYABORT; } /* initialize the polygon clipping now since @@ -232,7 +232,7 @@ parsedata if (!yyData || !yyFont) { - Message("illegal fileformat\n"); + Message(_("illegal fileformat\n")); YYABORT; } for (i = 0; i < MAX_LAYER + 2; i++) @@ -255,7 +255,7 @@ parsefont if (!yyFont) { - Message("illegal fileformat\n"); + Message(_("illegal fileformat\n")); YYABORT; } yyFont->Valid = false; @@ -654,7 +654,7 @@ pcbstyles { if (ParseRouteString($3, &yyPCB->RouteStyle[0], "mil")) { - Message("illegal route-style string\n"); + Message(_("illegal route-style string\n")); YYABORT; } } @@ -662,7 +662,7 @@ pcbstyles { if (ParseRouteString($3, &yyPCB->RouteStyle[0], "cmil")) { - Message("illegal route-style string\n"); + Message(_("illegal route-style string\n")); YYABORT; } } @@ -1145,9 +1145,10 @@ polygon_format if (bad_contour_found) { - Message("WARNING parsing file '%s'\n" + Message(_("WARNING parsing file '%s'\n" " line: %i\n" - " description: 'ignored polygon (< 3 points in a contour)'\n", + " description: 'ignored polygon " + "(< 3 points in a contour)'\n"), yyfilename, yylineno); DestroyObject(yyData, POLYGON_TYPE, Layer, Polygon, Polygon); } @@ -1945,9 +1946,9 @@ measure */ int yyerror(const char * s) { - Message("ERROR parsing file '%s'\n" + Message(_("ERROR parsing file '%s'\n" " line: %i\n" - " description: '%s'\n", + " description: '%s'\n"), yyfilename, yylineno, s); return(0); } @@ -1961,12 +1962,12 @@ static int check_file_version (int ver) { if ( ver > PCB_FILE_VERSION ) { - Message ("ERROR: The file you are attempting to load is in a format\n" + Message (_("ERROR: The file you are attempting to load is in a format\n" "which is too new for this version of pcb. To load this file\n" "you need a version of pcb which is >= %d. If you are\n" "using a version built from git source, the source date\n" "must be >= %d. This copy of pcb can only read files\n" - "up to file version %d.\n", ver, ver, PCB_FILE_VERSION); + "up to file version %d.\n"), ver, ver, PCB_FILE_VERSION); return 1; } diff --git a/src/report.c b/src/report.c index baa458d..b1da5ea 100644 --- a/src/report.c +++ b/src/report.c @@ -91,8 +91,8 @@ ReportDrills (int argc, char **argv, Coord x, Coord y) | And even that probably isn't going to work in all cases. */ sprintf (stringlist, - "There are %d different drill sizes used in this layout, %d holes total\n\n" - "Drill Diam. (%s)\t# of Pins\t# of Vias\t# of Elements\t# Unplated\n", + _("There are %d different drill sizes used in this layout, %d holes total\n\n" + "Drill Diam. (%s)\t# of Pins\t# of Vias\t# of Elements\t# Unplated\n"), AllDrills->DrillN, total_drills, Settings.grid_unit->suffix); thestring = stringlist; while (*thestring != '\0') @@ -111,17 +111,17 @@ ReportDrills (int argc, char **argv, Coord x, Coord y) } FreeDrillInfo (AllDrills); /* create dialog box */ - gui->report_dialog ("Drill Report", stringlist); + gui->report_dialog (_("Drill Report"), stringlist); free (stringlist); return 0; } -static const char reportdialog_syntax[] = "ReportDialog()"; +static const char reportdialog_syntax[] = N_("ReportDialog()"); static const char reportdialog_help[] = - "Report on the object under the crosshair"; + N_("Report on the object under the crosshair"); /* %start-doc actions ReportDialog @@ -155,22 +155,22 @@ ReportDialog (int argc, char **argv, Coord x, Coord y) #endif via = (PinType *) ptr2; if (TEST_FLAG (HOLEFLAG, via)) - pcb_sprintf (&report[0], "%m+VIA ID# %ld; Flags:%s\n" + pcb_sprintf (&report[0], _("%m+VIA ID# %ld; Flags:%s\n" "(X,Y) = %$mD.\n" "It is a pure hole of diameter %$mS.\n" "Name = \"%s\"." - "%s", USER_UNITMASK, via->ID, flags_to_string (via->Flags, VIA_TYPE), + "%s"), USER_UNITMASK, via->ID, flags_to_string (via->Flags, VIA_TYPE), via->X, via->Y, via->DrillingHole, EMPTY (via->Name), - TEST_FLAG (LOCKFLAG, via) ? "It is LOCKED.\n" : ""); + TEST_FLAG (LOCKFLAG, via) ? _("It is LOCKED.\n") : ""); else - pcb_sprintf (&report[0], "%m+VIA ID# %ld; Flags:%s\n" + pcb_sprintf (&report[0], _("%m+VIA ID# %ld; Flags:%s\n" "(X,Y) = %$mD.\n" "Copper width = %$mS. Drill width = %$mS.\n" "Clearance width in polygons = %$mS.\n" "Annulus = %$mS.\n" "Solder mask hole = %$mS (gap = %$mS).\n" "Name = \"%s\"." - "%s", USER_UNITMASK, via->ID, flags_to_string (via->Flags, VIA_TYPE), + "%s"), USER_UNITMASK, via->ID, flags_to_string (via->Flags, VIA_TYPE), via->X, via->Y, via->Thickness, via->DrillingHole, @@ -179,7 +179,7 @@ ReportDialog (int argc, char **argv, Coord x, Coord y) via->Mask, (via->Mask - via->Thickness) / 2, EMPTY (via->Name), TEST_FLAG (LOCKFLAG, via) ? - "It is LOCKED.\n" : ""); + _("It is LOCKED.\n") : ""); break; } case PIN_TYPE: @@ -203,24 +203,24 @@ ReportDialog (int argc, char **argv, Coord x, Coord y) } END_LOOP; if (TEST_FLAG (HOLEFLAG, Pin)) - pcb_sprintf (&report[0], "%m+PIN ID# %ld; Flags:%s\n" + pcb_sprintf (&report[0], _("%m+PIN ID# %ld; Flags:%s\n" "(X,Y) = %$mD.\n" "It is a mounting hole. Drill width = %$mS.\n" "It is owned by element %$mS.\n" - "%s", USER_UNITMASK, Pin->ID, flags_to_string (Pin->Flags, PIN_TYPE), + "%s"), USER_UNITMASK, Pin->ID, flags_to_string (Pin->Flags, PIN_TYPE), Pin->X, Pin->Y, Pin->DrillingHole, EMPTY (element->Name[1].TextString), - TEST_FLAG (LOCKFLAG, Pin) ? "It is LOCKED.\n" : ""); + TEST_FLAG (LOCKFLAG, Pin) ? _("It is LOCKED.\n") : ""); else pcb_sprintf (&report[0], - "%m+PIN ID# %ld; Flags:%s\n" "(X,Y) = %$mD.\n" + _("%m+PIN ID# %ld; Flags:%s\n" "(X,Y) = %$mD.\n" "Copper width = %$mS. Drill width = %$mS.\n" "Clearance width to Polygon = %$mS.\n" "Annulus = %$mS.\n" "Solder mask hole = %$mS (gap = %$mS).\n" "Name = \"%s\".\n" "It is owned by element %s\n as pin number %s.\n" - "%s", USER_UNITMASK, + "%s"), USER_UNITMASK, Pin->ID, flags_to_string (Pin->Flags, PIN_TYPE), Pin->X, Pin->Y, Pin->Thickness, Pin->DrillingHole, @@ -230,7 +230,7 @@ ReportDialog (int argc, char **argv, Coord x, Coord y) (Pin->Mask - Pin->Thickness) / 2, EMPTY (Pin->Name), EMPTY (element->Name[1].TextString), EMPTY (Pin->Number), - TEST_FLAG (LOCKFLAG, Pin) ? "It is LOCKED.\n" : ""); + TEST_FLAG (LOCKFLAG, Pin) ? _("It is LOCKED.\n") : ""); break; } case LINE_TYPE: @@ -245,20 +245,20 @@ ReportDialog (int argc, char **argv, Coord x, Coord y) } #endif line = (LineType *) ptr2; - pcb_sprintf (&report[0], "%m+LINE ID# %ld; Flags:%s\n" + pcb_sprintf (&report[0], _("%m+LINE ID# %ld; Flags:%s\n" "FirstPoint(X,Y) = %$mD, ID = %ld.\n" "SecondPoint(X,Y) = %$mD, ID = %ld.\n" "Width = %$mS.\nClearance width in polygons = %$mS.\n" "It is on layer %d\n" "and has name \"%s\".\n" - "%s", USER_UNITMASK, + "%s"), USER_UNITMASK, line->ID, flags_to_string (line->Flags, LINE_TYPE), line->Point1.X, line->Point1.Y, line->Point1.ID, line->Point2.X, line->Point2.Y, line->Point2.ID, line->Thickness, line->Clearance / 2, GetLayerNumber (PCB->Data, (LayerType *) ptr1), UNKNOWN (line->Number), - TEST_FLAG (LOCKFLAG, line) ? "It is LOCKED.\n" : ""); + TEST_FLAG (LOCKFLAG, line) ? _("It is LOCKED.\n") : ""); break; } case RATLINE_TYPE: @@ -272,11 +272,11 @@ ReportDialog (int argc, char **argv, Coord x, Coord y) } #endif line = (RatType *) ptr2; - pcb_sprintf (&report[0], "%m+RAT-LINE ID# %ld; Flags:%s\n" + pcb_sprintf (&report[0], _("%m+RAT-LINE ID# %ld; Flags:%s\n" "FirstPoint(X,Y) = %$mD; ID = %ld; " "connects to layer group %d.\n" "SecondPoint(X,Y) = %$mD; ID = %ld; " - "connects to layer group %d.\n", + "connects to layer group %d.\n"), USER_UNITMASK, line->ID, flags_to_string (line->Flags, LINE_TYPE), line->Point1.X, line->Point1.Y, line->Point1.ID, line->group1, @@ -299,7 +299,7 @@ ReportDialog (int argc, char **argv, Coord x, Coord y) Arc = (ArcType *) ptr2; box = GetArcEnds (Arc); - pcb_sprintf (&report[0], "%m+ARC ID# %ld; Flags:%s\n" + pcb_sprintf (&report[0], _("%m+ARC ID# %ld; Flags:%s\n" "CenterPoint(X,Y) = %$mD.\n" "Radius = %$mS, Thickness = %$mS.\n" "Clearance width in polygons = %$mS.\n" @@ -307,7 +307,7 @@ ReportDialog (int argc, char **argv, Coord x, Coord y) "Bounding Box is %$mD, %$mD.\n" "That makes the end points at %$mD and %$mD.\n" "It is on layer %d.\n" - "%s", USER_UNITMASK, Arc->ID, flags_to_string (Arc->Flags, ARC_TYPE), + "%s"), USER_UNITMASK, Arc->ID, flags_to_string (Arc->Flags, ARC_TYPE), Arc->X, Arc->Y, Arc->Width, Arc->Thickness, Arc->Clearance / 2, Arc->StartAngle, Arc->Delta, @@ -316,7 +316,7 @@ ReportDialog (int argc, char **argv, Coord x, Coord y) box->X1, box->Y1, box->X2, box->Y2, GetLayerNumber (PCB->Data, (LayerType *) ptr1), - TEST_FLAG (LOCKFLAG, Arc) ? "It is LOCKED.\n" : ""); + TEST_FLAG (LOCKFLAG, Arc) ? _("It is LOCKED.\n") : ""); break; } case POLYGON_TYPE: @@ -332,19 +332,19 @@ ReportDialog (int argc, char **argv, Coord x, Coord y) #endif Polygon = (PolygonType *) ptr2; - pcb_sprintf (&report[0], "%m+POLYGON ID# %ld; Flags:%s\n" + pcb_sprintf (&report[0], _("%m+POLYGON ID# %ld; Flags:%s\n" "Its bounding box is %$mD %$mD.\n" "It has %d points and could store %d more\n" " without using more memory.\n" "It has %d holes and resides on layer %d.\n" - "%s", USER_UNITMASK, Polygon->ID, + "%s"), USER_UNITMASK, Polygon->ID, flags_to_string (Polygon->Flags, POLYGON_TYPE), Polygon->BoundingBox.X1, Polygon->BoundingBox.Y1, Polygon->BoundingBox.X2, Polygon->BoundingBox.Y2, Polygon->PointN, Polygon->PointMax - Polygon->PointN, Polygon->HoleIndexN, GetLayerNumber (PCB->Data, (LayerType *) ptr1), - TEST_FLAG (LOCKFLAG, Polygon) ? "It is LOCKED.\n" : ""); + TEST_FLAG (LOCKFLAG, Polygon) ? _("It is LOCKED.\n") : ""); break; } case PAD_TYPE: @@ -371,7 +371,7 @@ ReportDialog (int argc, char **argv, Coord x, Coord y) } END_LOOP; len = Distance (Pad->Point1.X, Pad->Point1.Y, Pad->Point2.X, Pad->Point2.Y); - pcb_sprintf (&report[0], "%m+PAD ID# %ld; Flags:%s\n" + pcb_sprintf (&report[0], _("%m+PAD ID# %ld; Flags:%s\n" "FirstPoint(X,Y) = %$mD; ID = %ld.\n" "SecondPoint(X,Y) = %$mD; ID = %ld.\n" "Width = %$mS. Length = %$mS.\n" @@ -381,7 +381,7 @@ ReportDialog (int argc, char **argv, Coord x, Coord y) "It is owned by SMD element %s\n" " as pin number %s and is on the %s\n" "side of the board.\n" - "%s", USER_UNITMASK, Pad->ID, + "%s"), USER_UNITMASK, Pad->ID, flags_to_string (Pad->Flags, PAD_TYPE), Pad->Point1.X, Pad->Point1.Y, Pad->Point1.ID, Pad->Point2.X, Pad->Point2.Y, Pad->Point2.ID, @@ -393,8 +393,8 @@ ReportDialog (int argc, char **argv, Coord x, Coord y) EMPTY (element->Name[1].TextString), EMPTY (Pad->Number), TEST_FLAG (ONSOLDERFLAG, - Pad) ? "solder (bottom)" : "component", - TEST_FLAG (LOCKFLAG, Pad) ? "It is LOCKED.\n" : ""); + Pad) ? _("solder (bottom)") : _("component"), + TEST_FLAG (LOCKFLAG, Pad) ? _("It is LOCKED.\n") : ""); break; } case ELEMENT_TYPE: @@ -408,7 +408,7 @@ ReportDialog (int argc, char **argv, Coord x, Coord y) } #endif element = (ElementType *) ptr2; - pcb_sprintf (&report[0], "%m+ELEMENT ID# %ld; Flags:%s\n" + pcb_sprintf (&report[0], _("%m+ELEMENT ID# %ld; Flags:%s\n" "BoundingBox %$mD %$mD.\n" "Descriptive Name \"%s\".\n" "Name on board \"%s\".\n" @@ -416,7 +416,7 @@ ReportDialog (int argc, char **argv, Coord x, Coord y) "It is %$mS tall and is located at (X,Y) = %$mD %s.\n" "Mark located at point (X,Y) = %$mD.\n" "It is on the %s side of the board.\n" - "%s", USER_UNITMASK, + "%s"), USER_UNITMASK, element->ID, flags_to_string (element->Flags, ELEMENT_TYPE), element->BoundingBox.X1, element->BoundingBox.Y1, element->BoundingBox.X2, element->BoundingBox.Y2, @@ -425,10 +425,10 @@ ReportDialog (int argc, char **argv, Coord x, Coord y) EMPTY (element->Name[2].TextString), SCALE_TEXT (FONT_CAPHEIGHT, element->Name[1].Scale), element->Name[1].X, element->Name[1].Y, - TEST_FLAG (HIDENAMEFLAG, element) ? ",\n but it's hidden" : "", + TEST_FLAG (HIDENAMEFLAG, element) ? _(",\n but it's hidden") : "", element->MarkX, element->MarkY, - TEST_FLAG (ONSOLDERFLAG, element) ? "solder (bottom)" : "component", - TEST_FLAG (LOCKFLAG, element) ? "It is LOCKED.\n" : ""); + TEST_FLAG (ONSOLDERFLAG, element) ? _("solder (bottom)") : _("component"), + TEST_FLAG (LOCKFLAG, element) ? _("It is LOCKED.\n") : ""); break; } case TEXT_TYPE: @@ -454,33 +454,33 @@ ReportDialog (int argc, char **argv, Coord x, Coord y) text = (TextType *) ptr2; if (type == TEXT_TYPE) - sprintf (laynum, "It is on layer %d.", + sprintf (laynum, _("It is on layer %d."), GetLayerNumber (PCB->Data, (LayerType *) ptr1)); - pcb_sprintf (&report[0], "%m+TEXT ID# %ld; Flags:%s\n" + pcb_sprintf (&report[0], _("%m+TEXT ID# %ld; Flags:%s\n" "Located at (X,Y) = %$mD.\n" "Characters are %$mS tall.\n" "Value is \"%s\".\n" "Direction is %d.\n" "The bounding box is %$mD %$mD.\n" "%s\n" - "%s", USER_UNITMASK, text->ID, flags_to_string (text->Flags, TEXT_TYPE), + "%s"), USER_UNITMASK, text->ID, flags_to_string (text->Flags, TEXT_TYPE), text->X, text->Y, SCALE_TEXT (FONT_CAPHEIGHT, text->Scale), text->TextString, text->Direction, text->BoundingBox.X1, text->BoundingBox.Y1, text->BoundingBox.X2, text->BoundingBox.Y2, - (type == TEXT_TYPE) ? laynum : "It is an element name.", - TEST_FLAG (LOCKFLAG, text) ? "It is LOCKED.\n" : ""); + (type == TEXT_TYPE) ? laynum : _("It is an element name."), + TEST_FLAG (LOCKFLAG, text) ? _("It is LOCKED.\n") : ""); break; } case LINEPOINT_TYPE: case POLYGONPOINT_TYPE: { PointType *point = (PointType *) ptr2; - pcb_sprintf (&report[0], "%m+POINT ID# %ld.\n" + pcb_sprintf (&report[0], _("%m+POINT ID# %ld.\n" "Located at (X,Y) = %$mD.\n" - "It belongs to a %s on layer %d.\n", USER_UNITMASK, point->ID, + "It belongs to a %s on layer %d.\n"), USER_UNITMASK, point->ID, point->X, point->Y, - (type == LINEPOINT_TYPE) ? "line" : "polygon", + (type == LINEPOINT_TYPE) ? _("line") : _("polygon"), GetLayerNumber (PCB->Data, (LayerType *) ptr1)); break; } @@ -489,7 +489,7 @@ ReportDialog (int argc, char **argv, Coord x, Coord y) break; default: - sprintf (&report[0], "Unknown\n"); + sprintf (&report[0], _("Unknown\n")); break; } @@ -499,7 +499,7 @@ ReportDialog (int argc, char **argv, Coord x, Coord y) return 1; } /* create dialog box */ - gui->report_dialog ("Report", &report[0]); + gui->report_dialog (_("Report"), &report[0]); return 0; } @@ -512,14 +512,14 @@ ReportFoundPins (int argc, char **argv, Coord x, Coord y) int col = 0; DSClearString (&list); - DSAddString (&list, "The following pins/pads are FOUND:\n"); + DSAddString (&list, _("The following pins/pads are FOUND:\n")); ELEMENT_LOOP (PCB->Data); { PIN_LOOP (element); { if (TEST_FLAG (FOUNDFLAG, pin)) { - sprintf (temp, "%s-%s,%c", + sprintf (temp, _("%s-%s,%c"), NAMEONPCB_NAME (element), pin->Number, ((col++ % (COLUMNS + 1)) == COLUMNS) ? '\n' : ' '); @@ -531,7 +531,7 @@ ReportFoundPins (int argc, char **argv, Coord x, Coord y) { if (TEST_FLAG (FOUNDFLAG, pad)) { - sprintf (temp, "%s-%s,%c", + sprintf (temp, _("%s-%s,%c"), NAMEONPCB_NAME (element), pad->Number, ((col++ % (COLUMNS + 1)) == COLUMNS) ? '\n' : ' '); DSAddString (&list, temp); @@ -541,7 +541,7 @@ ReportFoundPins (int argc, char **argv, Coord x, Coord y) } END_LOOP; - gui->report_dialog ("Report", list.Data); + gui->report_dialog (_("Report"), list.Data); return 0; } @@ -671,8 +671,8 @@ ReportAllNetLengths (int argc, char **argv, Coord x, Coord y) /* Reset connectors for the next lookup */ ClearFlagOnAllObjects (false, FOUNDFLAG); - pcb_sprintf(buf, "%$m*", units_name, length); - gui->log("Net %s length %s\n", netname, buf); + pcb_sprintf(buf, _("%$m*"), units_name, length); + gui->log(_("Net %s length %s\n"), netname, buf); } } @@ -688,7 +688,7 @@ ReportNetLength (int argc, char **argv, Coord x, Coord y) char *netname = 0; int found = 0; - gui->get_coords ("Click on a connection", &x, &y); + gui->get_coords (_("Click on a connection"), &x, &y); /* Reset all connection flags and save an undo-state to get back * to the state the board was in when we started this function. @@ -707,7 +707,7 @@ ReportNetLength (int argc, char **argv, Coord x, Coord y) { ClearFlagOnAllObjects (false, FOUNDFLAG); Undo (true); - gui->log ("No net under cursor.\n"); + gui->log (_("No net under cursor.\n")); return 1; } @@ -724,7 +724,7 @@ ReportNetLength (int argc, char **argv, Coord x, Coord y) if (ename && pname) { - n = Concat (ename, "-", pname, NULL); + n = Concat (ename, _("-"), pname, NULL); for (ni = 0; ni < PCB->NetlistLib.MenuN; ni++) for (nei = 0; nei < PCB->NetlistLib.Menu[ni].EntryN; nei++) { @@ -749,7 +749,7 @@ ReportNetLength (int argc, char **argv, Coord x, Coord y) if (ename && pname) { - n = Concat (ename, "-", pname, NULL); + n = Concat (ename, _("-"), pname, NULL); for (ni = 0; ni < PCB->NetlistLib.MenuN; ni++) for (nei = 0; nei < PCB->NetlistLib.Menu[ni].EntryN; nei++) { @@ -772,11 +772,11 @@ got_net_name: { char buf[50]; - pcb_sprintf(buf, "%$m*", Settings.grid_unit->suffix, length); + pcb_sprintf(buf, _("%$m*"), Settings.grid_unit->suffix, length); if (netname) - gui->log ("Net \"%s\" length: %s\n", netname, buf); + gui->log (_("Net \"%s\" length: %s\n"), netname, buf); else - gui->log ("Net length: %s\n", buf); + gui->log (_("Net length: %s\n"), buf); } return 0; @@ -887,7 +887,7 @@ ReportNetLengthByName (char *tofind, int x, int y) if (!net_found) { - gui->log ("No net named %s\n", tofind); + gui->log (_("No net named %s\n"), tofind); return 1; } @@ -916,20 +916,20 @@ ReportNetLengthByName (char *tofind, int x, int y) if (!found) { if (net_found) - gui->log ("Net found, but no lines or arcs were flagged.\n"); + gui->log (_("Net found, but no lines or arcs were flagged.\n")); else - gui->log ("Net not found.\n"); + gui->log (_("Net not found.\n")); return 1; } { char buf[50]; - pcb_sprintf(buf, "%$m*", Settings.grid_unit->suffix, length); + pcb_sprintf(buf, _("%$m*"), Settings.grid_unit->suffix, length); if (netname) - gui->log ("Net \"%s\" length: %s\n", netname, buf); + gui->log (_("Net \"%s\" length: %s\n"), netname, buf); else - gui->log ("Net length: %s\n", buf); + gui->log (_("Net length: %s\n"), buf); } return 0; @@ -940,9 +940,10 @@ ReportNetLengthByName (char *tofind, int x, int y) * syntax: */ -static const char report_syntax[] = "Report(Object|DrillReport|FoundPins|NetLength|AllNetLengths|[,name])"; +static const char report_syntax[] = + N_("Report(Object|DrillReport|FoundPins|NetLength|AllNetLengths|[,name])"); -static const char report_help[] = "Produce various report."; +static const char report_help[] = N_("Produce various report."); /* %start-doc actions Report @@ -980,7 +981,7 @@ Report (int argc, char **argv, Coord x, Coord y) AUSAGE (report); else if (strcasecmp (argv[0], "Object") == 0) { - gui->get_coords ("Click on an object", &x, &y); + gui->get_coords (_("Click on an object"), &x, &y); return ReportDialog (argc - 1, argv + 1, x, y); } else if (strcasecmp (argv[0], "DrillReport") == 0) @@ -1001,7 +1002,7 @@ Report (int argc, char **argv, Coord x, Coord y) } HID_Action report_action_list[] = { - {"ReportObject", "Click on an object", ReportDialog, + {"ReportObject", N_("Click on an object"), ReportDialog, reportdialog_help, reportdialog_syntax} , {"Report", 0, Report, diff --git a/src/toporouter.c b/src/toporouter.c index 75ce82b..33c8e84 100644 --- a/src/toporouter.c +++ b/src/toporouter.c @@ -6506,7 +6506,7 @@ toporouter_export(toporouter_t *r) * PCB is built with Coord as a 32-bit integer. */ Message (_("Wiring cost: %f inches\n"), COORD_TO_INCH (r->wiring_score)); - printf ("Wiring cost: %f inches\n", COORD_TO_INCH (r->wiring_score)); + printf (_("Wiring cost: %f inches\n"), COORD_TO_INCH (r->wiring_score)); g_list_free(oproutes); @@ -7487,7 +7487,7 @@ hybrid_router(toporouter_t *r) failcount = rubix_router(r, failcount); Message(_("RUBIX router: %d nets remaining\n"), failcount); - printf("RUBIX router: %d nets remaining\n", failcount); + printf(_("RUBIX router: %d nets remaining\n"), failcount); r->flags |= TOPOROUTER_FLAG_GOFAR; @@ -7747,8 +7747,10 @@ escape (int argc, char **argv, Coord x, Coord y) } static HID_Action toporouter_action_list[] = { - {"Escape", "Select a set of pads", escape, "Pad escape", "Escape()"}, - {"Toporouter", "Select net(s)", toporouter, "Topological autorouter", "Toporouter()"} + {"Escape", N_("Select a set of pads"), escape, + N_("Pad escape"), N_("Escape()")}, + {"Toporouter", N_("Select net(s)"), toporouter, + N_("Topological autorouter"), N_("Toporouter()")} }; REGISTER_ACTIONS (toporouter_action_list) diff --git a/src/vendor.c b/src/vendor.c index 4585a77..9391404 100644 --- a/src/vendor.c +++ b/src/vendor.c @@ -101,10 +101,10 @@ static int rounding_method = ROUND_UP; /* ************************************************************ */ -static const char apply_vendor_syntax[] = "ApplyVendor()"; +static const char apply_vendor_syntax[] = N_("ApplyVendor()"); static const char apply_vendor_help[] = - "Applies the currently loaded vendor drill table to the current design."; + N_("Applies the currently loaded vendor drill table to the current design."); /* %start-doc actions ApplyVendor @cindex vendor map @@ -125,10 +125,10 @@ ActionApplyVendor (int argc, char **argv, Coord x, Coord y) /* ************************************************************ */ -static const char toggle_vendor_syntax[] = "ToggleVendor()"; +static const char toggle_vendor_syntax[] = N_("ToggleVendor()"); static const char toggle_vendor_help[] = - "Toggles the state of automatic drill size mapping."; + N_("Toggles the state of automatic drill size mapping."); /* %start-doc actions ToggleVendor @@ -156,10 +156,10 @@ ActionToggleVendor (int argc, char **argv, Coord x, Coord y) /* ************************************************************ */ -static const char enable_vendor_syntax[] = "EnableVendor()"; +static const char enable_vendor_syntax[] = N_("EnableVendor()"); static const char enable_vendor_help[] = - "Enables automatic drill size mapping."; + N_("Enables automatic drill size mapping."); /* %start-doc actions EnableVendor @@ -184,10 +184,10 @@ ActionEnableVendor (int argc, char **argv, Coord x, Coord y) /* ************************************************************ */ -static const char disable_vendor_syntax[] = "DisableVendor()"; +static const char disable_vendor_syntax[] = N_("DisableVendor()"); static const char disable_vendor_help[] = - "Disables automatic drill size mapping."; + N_("Disables automatic drill size mapping."); /* %start-doc actions DisableVendor @@ -210,10 +210,10 @@ ActionDisableVendor (int argc, char **argv, Coord x, Coord y) /* ************************************************************ */ -static const char unload_vendor_syntax[] = "UnloadVendor()"; +static const char unload_vendor_syntax[] = N_("UnloadVendor()"); static const char unload_vendor_help[] = - "Unloads the current vendor drill mapping table."; + N_("Unloads the current vendor drill mapping table."); /* %start-doc actions UnloadVendor @@ -242,10 +242,10 @@ ActionUnloadVendor (int argc, char **argv, Coord x, Coord y) /* ************************************************************ */ -static const char load_vendor_syntax[] = "LoadVendorFrom(filename)"; +static const char load_vendor_syntax[] = N_("LoadVendorFrom(filename)"); static const char load_vendor_help[] = - "Loads the specified vendor resource file."; + N_("Loads the specified vendor resource file."); /* %start-doc actions LoadVendorFrom @@ -339,7 +339,7 @@ ActionLoadVendorFrom (int argc, char **argv, Coord x, Coord y) } else { - Message ("\"%s\" is not a supported units. Defaulting to inch\n", + Message (_("\"%s\" is not a supported units. Defaulting to inch\n"), sval); sf = INCH_TO_COORD(1); } @@ -369,8 +369,8 @@ ActionLoadVendorFrom (int argc, char **argv, Coord x, Coord y) } else { - Message (_ - ("\"%s\" is not a valid rounding type. Defaulting to up\n"), + Message (_("\"%s\" is not a valid rounding type. " + "Defaulting to up\n"), sval); rounding_method = ROUND_UP; } @@ -491,11 +491,11 @@ apply_vendor_map (void) changed++; else { - Message (_ - ("Via at %.2f, %.2f not changed. Possible reasons:\n" - "\t- pad size too small\n" - "\t- new size would be too large or too small\n"), - 0.01 * via->X, 0.01 * via->Y); + Message (_("Via at %.2f, %.2f not changed. " + "Possible reasons:\n" + "\t- pad size too small\n" + "\t- new size would be too large or too small\n"), + 0.01 * via->X, 0.01 * via->Y); } } else @@ -531,11 +531,11 @@ apply_vendor_map (void) changed++; else { - Message (_ - ("Pin %s (%s) at %.2f, %.2f (element %s, %s, %s) not changed.\n" - "\tPossible reasons:\n" - "\t- pad size too small\n" - "\t- new size would be too large or too small\n"), + Message (_("Pin %s (%s) at %.2f, %.2f " + "(element %s, %s, %s) not changed.\n" + "\tPossible reasons:\n" + "\t- pad size too small\n" + "\t- new size would be too large or too small\n"), UNKNOWN (pin->Number), UNKNOWN (pin->Name), 0.01 * pin->X, 0.01 * pin->Y, UNKNOWN (NAMEONPCB_NAME (element)), @@ -545,8 +545,7 @@ apply_vendor_map (void) } else { - Message (_ - ("Locked pin at %-6.2f, %-6.2f not changed.\n"), + Message (_("Locked pin at %-6.2f, %-6.2f not changed.\n"), 0.01 * pin->X, 0.01 * pin->Y); } } @@ -578,8 +577,8 @@ apply_vendor_map (void) changed++; PCB->RouteStyle[i].Hole = vendorDrillMap (PCB->RouteStyle[i].Hole); - Message (_ - ("Adjusted %s routing style via hole size to be %6.2f mils\n"), + Message (_("Adjusted %s routing style via hole size to be " + "%6.2f mils\n"), PCB->RouteStyle[i].Name, 0.01 * PCB->RouteStyle[i].Hole); if (PCB->RouteStyle[i].Diameter < @@ -587,8 +586,8 @@ apply_vendor_map (void) { PCB->RouteStyle[i].Diameter = PCB->RouteStyle[i].Hole + MIN_PINORVIACOPPER; - Message (_ - ("Increased %s routing style via diameter to %6.2f mils\n"), + Message (_("Increased %s routing style via diameter to " + "%6.2f mils\n"), PCB->RouteStyle[i].Name, 0.01 * PCB->RouteStyle[i].Diameter); } @@ -696,7 +695,7 @@ add_to_drills (char *sval) if ((vendor_drills = (int *)realloc (vendor_drills, n_vendor_drills * sizeof (int))) == NULL) { - fprintf (stderr, "realloc() failed to allocate %ld bytes\n", + fprintf (stderr, _("realloc() failed to allocate %ld bytes\n"), (unsigned long) n_vendor_drills * sizeof (int)); return; } @@ -758,7 +757,7 @@ process_skips (Resource * res) sval = res->v[i].subres->v[0].value; if (sval == NULL) { - Message ("Error: null skip value\n"); + Message (_("Error: null skip value\n")); } else { @@ -794,7 +793,7 @@ process_skips (Resource * res) (*cnt) * sizeof (char *))) == NULL) { - fprintf (stderr, "realloc() failed\n"); + fprintf (stderr, _("realloc() failed\n")); exit (-1); } (*lst)[*cnt - 1] = strdup (sval); @@ -826,8 +825,8 @@ vendorIsElementMappable (ElementType *element) 0) || rematch (ignore_refdes[i], UNKNOWN (NAMEONPCB_NAME (element)))) { - Message (_ - ("Vendor mapping skipped because refdes = %s matches %s\n"), + Message (_("Vendor mapping skipped because " + "refdes = %s matches %s\n"), UNKNOWN (NAMEONPCB_NAME (element)), ignore_refdes[i]); noskip = 0; } @@ -838,8 +837,8 @@ vendorIsElementMappable (ElementType *element) if ((NSTRCMP (UNKNOWN (VALUE_NAME (element)), ignore_value[i]) == 0) || rematch (ignore_value[i], UNKNOWN (VALUE_NAME (element)))) { - Message (_ - ("Vendor mapping skipped because value = %s matches %s\n"), + Message (_("Vendor mapping skipped because " + "value = %s matches %s\n"), UNKNOWN (VALUE_NAME (element)), ignore_value[i]); noskip = 0; } @@ -853,8 +852,8 @@ vendorIsElementMappable (ElementType *element) || rematch (ignore_descr[i], UNKNOWN (DESCRIPTION_NAME (element)))) { - Message (_ - ("Vendor mapping skipped because descr = %s matches %s\n"), + Message (_("Vendor mapping skipped because " + "descr = %s matches %s\n"), UNKNOWN (DESCRIPTION_NAME (element)), ignore_descr[i]); noskip = 0; } @@ -894,7 +893,7 @@ rematch (const char *re, const char *s) char errorstring[128]; regerror (result, &compiled, errorstring, sizeof (errorstring)); - Message ("regexp error: %s\n", errorstring); + Message (_("regexp error: %s\n"), errorstring); regfree (&compiled); return (false); } @@ -914,7 +913,7 @@ rematch (const char *re, const char *s) /* compile the regular expression */ if ((rslt = re_comp (re)) != NULL) { - Message ("re_comp error: %s\n", rslt); + Message (_("re_comp error: %s\n"), rslt); return (false); } @@ -931,7 +930,7 @@ rematch (const char *re, const char *s) break; default: - Message ("re_exec error\n"); + Message (_("re_exec error\n")); break; } -- 1.7.10.4