Changeset 29009
- Timestamp:
- 2014-04-29T20:07:53+12:00 (10 years ago)
- Location:
- main/trunk/gli
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/gli/classes/dictionary.properties
r28626 r29009 940 940 #********************** 941 941 # 942 #***** FormatConversionDialog ***** 943 FormatConversionDialog.Title:Convert Greenstone 2 format statements to Greenstone 3 944 FormatConversionDialog.Reconvert:Reconvert 945 FormatConversionDialog.XHTML_Tidy:XHTML Tidy 946 FormatConversionDialog.XHTML_Tidy_Tooltip:Will run HTML Tidy over the Greenstone3 format statement to try to fix up obvious XHTML errors. 947 FormatConversionDialog.Next:Next 948 FormatConversionDialog.Accept_All:Accept All 949 FormatConversionDialog.GS2_Text_Tooltip:Greenstone2 format statement 950 FormatConversionDialog.GS3_Text_Tooltip:Greenstone3 format statement, must be XML to be active in Greenstone. 951 FormatConversionDialog.Tidy_Failed:Tidy failed. 952 FormatConversionDialog.Tidy_Done:Tidy done. 953 FormatConversionDialog.XML_Still_Invalid:XML is still invalid. 954 FormatConversionDialog.Error_GS3_Format:Error in GS3 format statement. 955 FormatConversionDialog.Invalid_XML:Invalid XML. 956 FormatConversionDialog.Invalid_XML_Warning_Title:Cancel or Continue? 957 FormatConversionDialog.Cancel_Or_Continue_Next:Either press Cancel to go back and re-edit the XML.\nOr press OK to store the current XML as-is, albeit inactive, and continue on to the next statement.\nYou can later use the Format tab to revisit this format statement if you want to update its syntax. 958 FormatConversionDialog.Cancel_Or_Accept_All:One or more GS3 format statements contains invalid XML.\nEither press Cancel to correct the XML.\nOr press OK to store the GS3 format statements as-is, albeit inactive.\nYou can later use the Format tab to revisit the format statements if you want to update their syntax. 959 960 #********************** 961 # 942 962 #***** Options Pane inside CreatePane ***** 943 963 OptionsPane.Cancelled: - cancelled -
main/trunk/gli/src/org/greenstone/gatherer/gui/FormatConversionDialog.java
r29006 r29009 68 68 69 69 // widgets 70 final String WARNING_TITLE = Dictionary.get("General.Warning") 71 + ": " + Dictionary.get("FormatConversionDialog.Invalid_XML") 72 + " " + Dictionary.get("FormatConversionDialog.Invalid_XML_Warning_Title"); 73 70 74 private static final Border EMPTYBORDER = new EmptyBorder(5, 5, 5, 5); 71 75 private JLabel section_label = null; … … 92 96 this.setComponentOrientation(Dictionary.getOrientation()); 93 97 setSize(SIZE); 94 setTitle(Dictionary.get( "FormatConversionDialog.Title"));98 setTitle(Dictionary.get(Dictionary.get("FormatConversionDialog.Title"))); 95 99 setDefaultCloseOperation(DISPOSE_ON_CLOSE); 96 100 … … 98 102 JPanel midbutton_panel = new JPanel(); // FlowLayout by default in a JPanel 99 103 midbutton_panel.setComponentOrientation(Dictionary.getOrientation()); 100 JButton reconvert_button = new JButton( "Reconvert");104 JButton reconvert_button = new JButton(Dictionary.get("FormatConversionDialog.Reconvert")); 101 105 midbutton_panel.add(reconvert_button); 102 106 reconvert_button.addActionListener(new ReconvertListener()); 103 107 reconvert_button.setAlignmentY(Component.CENTER_ALIGNMENT); 104 108 105 section_label = new JLabel("Section Label Goes Here"); 109 section_label = new JLabel("Section Label Goes Here"); // title will be replaced, don't need to translate 106 110 section_label.setBorder(EMPTYBORDER); 107 111 section_label.setComponentOrientation(Dictionary.getOrientation()); … … 109 113 JPanel button1_panel = new JPanel(); 110 114 button1_panel.setComponentOrientation(Dictionary.getOrientation()); 111 undo_button = new JButton( "Undo");115 undo_button = new JButton(Dictionary.get("General.Undo")); 112 116 undo_button.addActionListener(new UndoListener()); 113 117 undo_button.setEnabled(false); 114 118 115 redo_button = new JButton( "Redo");119 redo_button = new JButton(Dictionary.get("General.Redo")); 116 120 redo_button.addActionListener(new RedoListener()); 117 121 redo_button.setEnabled(false); 118 122 119 xmltidy_button = new JButton("XHTML Tidy"); 123 xmltidy_button = new JButton(Dictionary.get("FormatConversionDialog.XHTML_Tidy")); 124 xmltidy_button.setToolTipText(Dictionary.get("FormatConversionDialog.XHTML_Tidy_Tooltip")); 120 125 xmltidy_button.addActionListener(new XMLTidyButtonListener()); 121 126 … … 126 131 JPanel button_panel = new JPanel(new FlowLayout()); 127 132 button_panel.setComponentOrientation(Dictionary.getOrientation()); 128 count_label = new JLabel("<count>"); 129 cancel_button = new JButton( "Cancel");130 next_button = new JButton( "Next");131 accept_all_button = new JButton( "Accept All");133 count_label = new JLabel("<count>"); // placeholder text for numbers, no need to translate 134 cancel_button = new JButton(Dictionary.get("General.Cancel")); 135 next_button = new JButton(Dictionary.get("FormatConversionDialog.Next")); 136 accept_all_button = new JButton(Dictionary.get("FormatConversionDialog.Accept_All")); 132 137 cancel_button.addActionListener(new CancelButtonListener()); 133 138 next_button.addActionListener(new NextButtonListener()); … … 152 157 initTextArea(gs2_textarea); 153 158 initTextArea(gs3_textarea); 159 gs2_textarea.setToolTipText(Dictionary.get("FormatConversionDialog.GS2_Text_Tooltip")); 160 gs3_textarea.setToolTipText(Dictionary.get("FormatConversionDialog.GS2_Text_Tooltip")); 154 161 155 162 … … 212 219 editor_textarea.setLineWrap(true); 213 220 editor_textarea.setRows(11); 214 editor_textarea.setWrapStyleWord(false); 215 editor_textarea.setToolTipText(Dictionary.get("CDM.FormatManager.Add_Tooltip")); 221 editor_textarea.setWrapStyleWord(false); 216 222 } 217 223 … … 420 426 if(process_exitValue >= 2) { 421 427 System.err.println("@@@ Process exit value: " + process_exitValue); 422 errorMsg = "Tidy failed. XML is still invalid."; 428 errorMsg = Dictionary.get("FormatConversionDialog.Tidy_Failed") 429 + " " + Dictionary.get("FormatConversionDialog.XML_Still_Invalid"); 423 430 } else { 424 431 errorMsg = ""; … … 437 444 boolean parsed = setGS3Format(i, gs3formatstr); // will parse the gs3formatstr into a DOM object 438 445 if(!parsed && errorMsg.equals("")) { 439 errorMsg = "Tidy done. XML is still invalid."; 446 errorMsg = Dictionary.get("FormatConversionDialog.Tidy_Done") 447 + " " + Dictionary.get("FormatConversionDialog.XML_Still_Invalid"); 440 448 } 441 449 return errorMsg; … … 812 820 813 821 if(!parse_success) { // invalid XML, warn the user 814 String message = "There is an error in the XML. Either press Cancel to go back and re-edit the XML. Or press OK to store the current XML as-is, albeit inactive, and continue on to the next statement. You can later use the Format tab to revisit this format statement if you want to update its syntax.";815 int user_choice = JOptionPane.showConfirmDialog(FormatConversionDialog.this, message, "Warning: Invalid XML. Continue?", JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE);822 String message = Dictionary.get("FormatConversionDialog.Invalid_XML") + " " + Dictionary.get("FormatConversionDialog.Cancel_Or_Continue_Next"); 823 int user_choice = JOptionPane.showConfirmDialog(FormatConversionDialog.this, message, WARNING_TITLE, JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE); 816 824 817 825 if(user_choice == JOptionPane.CANCEL_OPTION) { … … 850 858 851 859 if(!parse_success) { // invalid XML for current format statement, warn the user 852 setErrorStatus( "Invalid XML");853 854 message = "Invalid XML. Either press Cancel to go back and re-edit the XML. Or press OK to store the current XML as-is, albeit inactive, and continue on to the next statement. You can later use the Format tab to revisit this format statement if you want to update its syntax.";860 setErrorStatus(Dictionary.get("FormatConversionDialog.Invalid_XML")); 861 862 message = Dictionary.get("FormatConversionDialog.Invalid_XML") + " " + Dictionary.get("FormatConversionDialog.Cancel_Or_Continue_Next"); 855 863 } 856 864 … … 863 871 if(!validationMsg.startsWith(XMLTools.WELLFORMED)) { 864 872 parse_success = false; 865 message = "One or more GS3 format statements contains invalid XML. Either press Cancel to correct the XML. Or press OK to store the GS3 format statements as-is, albeit inactive. You can later use the Format tab to revisit the format statements if you want to update their syntax.";873 message = Dictionary.get("FormatConversionDialog.Cancel_Or_Accept_All"); 866 874 } 867 875 } 868 876 869 877 if(!parse_success) { 870 int user_choice = JOptionPane.showConfirmDialog(FormatConversionDialog.this, message, "Warning: Invalid XML. Continue?", JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE);878 int user_choice = JOptionPane.showConfirmDialog(FormatConversionDialog.this, message, WARNING_TITLE, JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE); 871 879 if(user_choice == JOptionPane.CANCEL_OPTION) { 872 880 return; // Don't close the dialog. Let the user continue looking at this or subsequent GS3 format statements. … … 892 900 if(process_exitValue >= 2) { 893 901 System.err.println("@@@ Process exit value: " + process_exitValue); 894 setErrorStatus( "Tidy failed.");902 setErrorStatus(Dictionary.get("FormatConversionDialog.Tidy_Failed")); 895 903 } else { 896 904 gs3formatstr_notags = htmltidy_string; … … 908 916 909 917 if(parse_success) { 910 statusbar.setText( "Tidy done.");918 statusbar.setText(Dictionary.get("FormatConversionDialog.Tidy_Done")); 911 919 } else { 912 setErrorStatus("Tidy done. Error in GS3 format statement. Invalid XML."); 920 setErrorStatus(Dictionary.get("FormatConversionDialog.Tidy_Done") 921 + " " + Dictionary.get("FormatConversionDialog.Error_GS3_Format") 922 + " " + Dictionary.get("FormatConversionDialog.Invalid_XML")); 913 923 } 914 924 }
Note:
See TracChangeset
for help on using the changeset viewer.