Changeset 2349
- Timestamp:
- 11/09/07 01:04:16 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
Trunk/SpeechSubmission/VFSpeechSubmission/java/src/speechrecorder/CapturePlayback.java
r2348 r2349 65 65 import speechrecorder.License; 66 66 import speechrecorder.Prompts; 67 import speechrecorder.LabelLocalizer; 67 68 import java.util.regex.Matcher; 68 69 import java.util.regex.Pattern; … … 262 263 // !!!!!! 263 264 JTextField usernameTextField; 264 265 String usernamePanelLabel = "Username:";265 LabelLocalizer labels = new LabelLocalizer("Dutch"); 266 String usernamePanelLabel = labels.usernamePanelLabel; 266 267 String userName; 268 String usernamePanelText = labels.usernamePanelText; 267 269 268 String copyrightName = "Free Software Foundation";269 String gplAccepted = "Yes";270 String copyrightName = labels.copyrightName; 271 String gplAccepted = labels.gplAccepted; 270 272 271 public static final String pleaseSelect = "Please Select";272 public static final String notApplicable = "unknown";273 String pleaseSelect = labels.pleaseSelect; 274 String notApplicable = labels.notApplicable; 273 275 274 String genderPanelLabel = "Gender:";276 String genderPanelLabel = labels.genderPanelLabel; 275 277 JComboBox genderChooser; 276 public static final String male = "Male"; 277 public static final String female = "Female"; 278 String male = labels.male; 279 String female = labels.female; 280 String[] genderSelection = {pleaseSelect,male, female}; 278 281 String gender = notApplicable; 279 282 280 String ageRangePanelLabel = "Age Range:";283 String ageRangePanelLabel = labels.ageRangePanelLabel; 281 284 JComboBox ageRangeChooser; 282 public static final String youth = "Youth"; 283 public static final String adult = "Adult"; 284 public static final String senior = "Senior"; 285 String youth = labels.youth; 286 String adult = labels.adult; 287 String senior = labels.senior; 288 String[] ageSelection = {pleaseSelect ,youth, adult, senior }; 285 289 String ageRange = notApplicable; 286 290 287 291 String dialectPanelLabel = "Pronunciation Dialect:"; 288 292 JComboBox dialectChooser; 289 public static final String australian = "Australian English"; 290 public static final String american = "American English"; 291 public static final String british = "British English"; 292 public static final String canadian = "Canadian English"; 293 public static final String european = "European English"; 294 public static final String newzealand = "New Zealand English"; 295 public static final String southafrican = "South African English"; 296 public static final String otherDialect = "Other"; 293 String dialect1 = labels.dialect1; 294 String dialect2 =labels.dialect2; 295 String dialect3 = labels.dialect3; 296 String dialect4 = labels.dialect4; 297 String dialect5 = labels.dialect5; 298 String dialect6 = labels.dialect6; 299 String dialect7 = labels.dialect7; 300 String dialect8 = labels.dialect8; 301 String dialect9 = labels.dialect9; 302 String dialect10 = labels.dialect10; 303 String otherDialect = labels.otherDialect; 304 String[] dialectSelection = {pleaseSelect,dialect1, dialect2, dialect3, dialect4, dialect5, dialect6, dialect7, otherDialect}; 297 305 String dialect = notApplicable; 298 306 299 307 String microphonePanelLabel = "Microphone Type:"; 300 308 JComboBox microphoneChooser; 301 public static final String headset = "Headset mic"; 302 public static final String desktopBoom = "Desktop Boom mic"; 303 public static final String laptopBuiltin = "Laptop Built-in mic"; 304 public static final String webcam = "WebCam mic"; 305 public static final String studio = "Studio mic"; 306 public static final String otherMic = "Other"; 309 String headset = labels.headset; 310 String USBheadset = labels.USBheadset; 311 String desktopBoom = labels.desktopBoom; 312 String USBdesktopBoom = labels.USBdesktopBoom; 313 String laptopBuiltin = labels.laptopBuiltin; 314 String webcam = labels.webcam; 315 String studio = labels.studio; 316 String otherMic = labels.otherMic; 317 String[] microphonetSelection = {pleaseSelect,headset,USBheadset, desktopBoom, USBdesktopBoom, laptopBuiltin, webcam, studio, otherMic}; 307 318 String microphone = notApplicable; 308 319 309 String uploadText = "<html>By clicking the \"Upload\" button, you agree to assign the Copyright to your recorded speech to <br> " 310 + "the Free Software Foundation, and to license your submission under the GNU Public Licence (\"GPL\"):" ; 311 String uploadButtonLabel = "Upload"; 320 String uploadText = labels.uploadText; 321 String uploadButtonLabel = labels.uploadButtonLabel; 312 322 313 String moreInfoText = "For more information on Copyright and GPL, click here:"; 314 String moreInfoButtonLabel = "More Information"; 315 316 String disclaimerText = 317 "<html>VoxForge SpeechSubmission Applet - Copyright (C) 2007 VoxForge<br>" 318 +"This program comes with ABSOLUTELY NO WARRANTY; without even the implied<br> " 319 +"warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For<br>" 320 +"more details click the \"About\" button:"; 321 String aboutButtonLabel = "About"; 323 String moreInfoText = labels.moreInfoText; 324 String moreInfoButtonLabel = labels.moreInfoButtonLabel; 325 326 String disclaimerText = labels.disclaimerText; 327 String aboutButtonLabel = labels.aboutButtonLabel; 322 328 323 public static final String recordButton = "Record";324 public static final String stopButton = "Stop";325 public static final String playButton = "Play";329 String recordButton = labels.recordButton; 330 String stopButton = labels.stopButton; 331 String playButton = labels.playButton; 326 332 // !!!!!! 327 333 … … 501 507 usernamePanel.add(new JLabel(usernamePanelLabel)); 502 508 usernamePanel.add(usernameTextField = new JTextField(20)); 503 504 String usernamePanelText = "(leave blank to submit anonymously)";505 509 usernamePanel.add(new JLabel(usernamePanelText)); 506 510 … … 509 513 JPanel genderPanel = new JPanel(); 510 514 genderPanel.setLayout(new FlowLayout(FlowLayout.CENTER)); 511 512 515 genderPanel.add(new JLabel(genderPanelLabel)); 513 String[] genderSelection = {pleaseSelect,male, female};514 516 genderPanel.add(genderChooser = new JComboBox(genderSelection)); 515 517 genderChooser.setSelectedIndex(0); … … 534 536 ageRangePanel.setLayout(new FlowLayout(FlowLayout.CENTER)); 535 537 ageRangePanel.add(new JLabel(ageRangePanelLabel)); 536 String[] ageSelection = {pleaseSelect, youth, adult, senior};537 538 ageRangePanel.add(ageRangeChooser = new JComboBox(ageSelection)); 538 539 ageRangeChooser.setSelectedIndex(0); … … 558 559 dialectPanel.setLayout(new FlowLayout(FlowLayout.CENTER)); 559 560 dialectPanel.add(new JLabel(dialectPanelLabel)); 560 String[] dialectSelection = {pleaseSelect,australian, american, british, canadian, european, newzealand, southafrican, otherDialect};561 561 dialectPanel.add(dialectChooser = new JComboBox(dialectSelection)); 562 562 dialectChooser.setSelectedIndex(0); … … 564 564 public void actionPerformed(ActionEvent e){ 565 565 String choice = (String)dialectChooser.getSelectedItem(); 566 if(choice.equals(australian)){ 567 dialect = (australian); 568 }else if (choice.equals(american)){ 569 dialect = (american); 570 }else if(choice.equals(british)){ 571 dialect = (british); 572 }else if(choice.equals(canadian)){ 573 dialect = (canadian); 574 }else if(choice.equals(european)){ 575 dialect = (european); 576 }else if(choice.equals(newzealand)){ 577 dialect = (newzealand); 578 }else if(choice.equals(southafrican)){ 579 dialect = (southafrican); 566 if(choice.equals(dialect1)){ 567 dialect = (dialect1); 568 }else if (choice.equals(dialect2)){ 569 dialect = (dialect2); 570 }else if(choice.equals(dialect3)){ 571 dialect = (dialect3); 572 }else if(choice.equals(dialect4)){ 573 dialect = (dialect4); 574 }else if(choice.equals(dialect5)){ 575 dialect = (dialect5); 576 }else if(choice.equals(dialect6)){ 577 dialect = (dialect6); 578 }else if(choice.equals(dialect7)){ 579 dialect = (dialect7); 580 }else if(choice.equals(dialect8)){ 581 dialect = (dialect8); 582 }else if(choice.equals(dialect9)){ 583 dialect = (dialect9); 584 }else if(choice.equals(dialect10)){ 585 dialect = (dialect10); 580 586 }else if(choice.equals(otherDialect)){ 581 587 dialect = (otherDialect); … … 593 599 microphonePanel.setLayout(new FlowLayout(FlowLayout.CENTER)); 594 600 microphonePanel.add(new JLabel(microphonePanelLabel)); 595 String[] microphonetSelection = {pleaseSelect,headset, desktopBoom, laptopBuiltin, webcam, studio, otherMic};596 601 microphonePanel.add(microphoneChooser = new JComboBox(microphonetSelection)); 597 602 microphoneChooser.setSelectedIndex(0); … … 602 607 if(choice.equals(headset)){ 603 608 microphone = (headset); 609 }else if (choice.equals(USBheadset)){ 610 microphone = (USBheadset); 604 611 }else if (choice.equals(desktopBoom)){ 605 612 microphone = (desktopBoom); 613 }else if (choice.equals(USBdesktopBoom)){ 614 microphone = (USBdesktopBoom); 606 615 }else if(choice.equals(laptopBuiltin)){ 607 616 microphone = (laptopBuiltin);