OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Rev

Rev 142 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 142 Rev 177
Line 13... Line 13...
13
 
13
 
14
 package org.openconcerto.sql.ui;
14
 package org.openconcerto.sql.ui;
15
 
15
 
16
import static org.openconcerto.sql.TM.getTM;
16
import static org.openconcerto.sql.TM.getTM;
17
import org.openconcerto.sql.Configuration;
17
import org.openconcerto.sql.Configuration;
-
 
18
import org.openconcerto.sql.PropsConfiguration;
18
import org.openconcerto.sql.TM;
19
import org.openconcerto.sql.TM;
19
import org.openconcerto.sql.model.SQLRow;
20
import org.openconcerto.sql.model.SQLRow;
20
import org.openconcerto.sql.model.SQLTable;
21
import org.openconcerto.sql.model.SQLTable;
21
import org.openconcerto.sql.preferences.UserProps;
22
import org.openconcerto.sql.preferences.UserProps;
22
import org.openconcerto.sql.request.ComboSQLRequest;
23
import org.openconcerto.sql.request.ComboSQLRequest;
Line 54... Line 55...
54
 
55
 
55
import javax.swing.BorderFactory;
56
import javax.swing.BorderFactory;
56
import javax.swing.JButton;
57
import javax.swing.JButton;
57
import javax.swing.JCheckBox;
58
import javax.swing.JCheckBox;
58
import javax.swing.JCheckBoxMenuItem;
59
import javax.swing.JCheckBoxMenuItem;
-
 
60
import javax.swing.JComponent;
59
import javax.swing.JLabel;
61
import javax.swing.JLabel;
60
import javax.swing.JOptionPane;
62
import javax.swing.JOptionPane;
61
import javax.swing.JPanel;
63
import javax.swing.JPanel;
62
import javax.swing.JPasswordField;
64
import javax.swing.JPasswordField;
63
import javax.swing.JPopupMenu;
65
import javax.swing.JPopupMenu;
Line 511... Line 513...
511
        this.companyLabel.setText(bundle.getString("companyLabel"));
513
        this.companyLabel.setText(bundle.getString("companyLabel"));
512
        this.saveCheckBox.setText(bundle.getString("saveCheckBox"));
514
        this.saveCheckBox.setText(bundle.getString("saveCheckBox"));
513
        this.buttonConnect.setText(bundle.getString("buttonConnect"));
515
        this.buttonConnect.setText(bundle.getString("buttonConnect"));
514
        this.langButton.setText(locale.getLanguage());
516
        this.langButton.setText(locale.getLanguage());
515
        this.langButton.setVisible(true);
517
        this.langButton.setVisible(true);
-
 
518
        // for next launch
516
        UserProps.getInstance().setLocale(locale);
519
        UserProps.getInstance().setLocale(locale);
-
 
520
        // for current run
-
 
521
        ((PropsConfiguration) Configuration.getInstance()).setLocale(locale);
-
 
522
        // for code that will never need more than one Locale concurrently
-
 
523
        // (e.g. used by TM singletons in various packages)
-
 
524
        Locale.setDefault(locale);
-
 
525
        // as explained in Locale.setDefault() javadoc : "be prepared to reinitialize
-
 
526
        // locale-sensitive code"
-
 
527
        JComponent.setDefaultLocale(locale);
-
 
528
        // throw RuntimeException like ResourceBundle.getBundle() at the beginning of this
-
 
529
        // method
-
 
530
        TranslationManager.createDefaultInstance();
517
    }
531
    }
518
}
532
}