mirror of
https://github.com/Mibew/java.git
synced 2025-01-23 01:50:34 +03:00
- OK/cancel/apply logics for localization option;
- Localized buttons and window title; git-svn-id: https://webim.svn.sourceforge.net/svnroot/webim/trunk@82 c66351dc-e62f-0410-b875-e3a5c0b9693f
This commit is contained in:
parent
f558332718
commit
e9fad99416
@ -104,5 +104,13 @@ namespace webImTray {
|
|||||||
if (args.Length == 1 && args[0].Equals("/show"))
|
if (args.Length == 1 && args[0].Equals("/show"))
|
||||||
forceShowWindow = true;
|
forceShowWindow = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static bool RussianLocale {
|
||||||
|
get {
|
||||||
|
return Application.UserAppDataRegistry.GetValue("isrussianlocale", "false").ToString().ToLower().Equals("true");
|
||||||
|
} set {
|
||||||
|
Application.UserAppDataRegistry.SetValue("isrussianlocale", value.ToString());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -131,9 +131,5 @@ namespace webImTray {
|
|||||||
private System.Windows.Forms.Button apply;
|
private System.Windows.Forms.Button apply;
|
||||||
private System.Windows.Forms.Panel container;
|
private System.Windows.Forms.Panel container;
|
||||||
private System.Windows.Forms.LinkLabel linkLabel1;
|
private System.Windows.Forms.LinkLabel linkLabel1;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -24,8 +24,13 @@ namespace webImTray {
|
|||||||
public static CultureInfo englishCulture = new CultureInfo("en-US");
|
public static CultureInfo englishCulture = new CultureInfo("en-US");
|
||||||
public static CultureInfo russianCulture = new CultureInfo("ru-RU");
|
public static CultureInfo russianCulture = new CultureInfo("ru-RU");
|
||||||
|
|
||||||
|
// FIXME: we have only one OptionsDialog instance
|
||||||
|
// thus it's safe to keep it in a static variable.
|
||||||
|
private static OptionsDialog currentInstance = null;
|
||||||
|
|
||||||
public OptionsDialog() {
|
public OptionsDialog() {
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
currentInstance = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void changePanel(OptionsPanel panel) {
|
private void changePanel(OptionsPanel panel) {
|
||||||
@ -102,6 +107,10 @@ namespace webImTray {
|
|||||||
for (int i = 0; i < 4; i++) {
|
for (int i = 0; i < 4; i++) {
|
||||||
((OptionsPanel)panels[i]).updateUI(resourceManager);
|
((OptionsPanel)panels[i]).updateUI(resourceManager);
|
||||||
}
|
}
|
||||||
|
currentInstance.ok.Text = resourceManager.GetString("ok");
|
||||||
|
currentInstance.cancel.Text = resourceManager.GetString("cancel");
|
||||||
|
currentInstance.apply.Text = resourceManager.GetString("apply");
|
||||||
|
currentInstance.Text = resourceManager.GetString("optionsTitle");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -7,6 +7,7 @@ using System.Text;
|
|||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using System.Resources;
|
using System.Resources;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
using System.Globalization;
|
||||||
|
|
||||||
namespace webImTray {
|
namespace webImTray {
|
||||||
public partial class OptionsGeneralPanel : UserControl, OptionsPanel {
|
public partial class OptionsGeneralPanel : UserControl, OptionsPanel {
|
||||||
@ -27,6 +28,18 @@ namespace webImTray {
|
|||||||
Options.ShowInTaskBar = showInTaskBar.Checked;
|
Options.ShowInTaskBar = showInTaskBar.Checked;
|
||||||
Options.AutoStart = autoStart.Checked;
|
Options.AutoStart = autoStart.Checked;
|
||||||
Options.HideAfterStart = hideWhenStarted.Checked;
|
Options.HideAfterStart = hideWhenStarted.Checked;
|
||||||
|
|
||||||
|
// Save locale
|
||||||
|
Options.RussianLocale = radioRussian.Checked;
|
||||||
|
|
||||||
|
// Apply locale
|
||||||
|
if (radioEnglish.Checked) {
|
||||||
|
Thread.CurrentThread.CurrentUICulture = OptionsDialog.englishCulture;
|
||||||
|
} else if (radioRussian.Checked) {
|
||||||
|
Thread.CurrentThread.CurrentUICulture = OptionsDialog.russianCulture;
|
||||||
|
}
|
||||||
|
// Update UI according to the current locale
|
||||||
|
OptionsDialog.updateUI();
|
||||||
modified = false;
|
modified = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -35,6 +48,17 @@ namespace webImTray {
|
|||||||
showInTaskBar.Checked = Options.ShowInTaskBar;
|
showInTaskBar.Checked = Options.ShowInTaskBar;
|
||||||
autoStart.Checked = Options.AutoStart;
|
autoStart.Checked = Options.AutoStart;
|
||||||
hideWhenStarted.Checked = Options.HideAfterStart;
|
hideWhenStarted.Checked = Options.HideAfterStart;
|
||||||
|
|
||||||
|
// Restore previously set locale
|
||||||
|
if (!Options.RussianLocale) {
|
||||||
|
radioEnglish.Checked = true;
|
||||||
|
} else {
|
||||||
|
radioRussian.Checked = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update UI according to the current locale
|
||||||
|
OptionsDialog.updateUI();
|
||||||
|
|
||||||
modified = false;
|
modified = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -56,23 +80,13 @@ namespace webImTray {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void radioEnglish_CheckedChanged(object sender, EventArgs e) {
|
private void radioEnglish_CheckedChanged(object sender, EventArgs e) {
|
||||||
if (radioEnglish.Checked) {
|
modified = true;
|
||||||
// Set english culture
|
PanelModified.Invoke();
|
||||||
Thread.CurrentThread.CurrentUICulture = OptionsDialog.englishCulture;
|
|
||||||
|
|
||||||
// Update UI
|
|
||||||
OptionsDialog.updateUI();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void radioRussian_CheckedChanged(object sender, EventArgs e) {
|
private void radioRussian_CheckedChanged(object sender, EventArgs e) {
|
||||||
if (radioRussian.Checked) {
|
modified = true;
|
||||||
// Set russian culture
|
PanelModified.Invoke();
|
||||||
Thread.CurrentThread.CurrentUICulture = OptionsDialog.russianCulture;
|
|
||||||
|
|
||||||
// Update UI
|
|
||||||
OptionsDialog.updateUI();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -120,6 +120,9 @@
|
|||||||
<data name="application" xml:space="preserve">
|
<data name="application" xml:space="preserve">
|
||||||
<value>Application</value>
|
<value>Application</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="apply" xml:space="preserve">
|
||||||
|
<value>Apply</value>
|
||||||
|
</data>
|
||||||
<data name="autoDesconnectOnSS" xml:space="preserve">
|
<data name="autoDesconnectOnSS" xml:space="preserve">
|
||||||
<value>Become idle if the screen saver is activated</value>
|
<value>Become idle if the screen saver is activated</value>
|
||||||
</data>
|
</data>
|
||||||
@ -129,6 +132,9 @@
|
|||||||
<data name="autoStart" xml:space="preserve">
|
<data name="autoStart" xml:space="preserve">
|
||||||
<value>Start automatically when starting Windows</value>
|
<value>Start automatically when starting Windows</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="cancel" xml:space="preserve">
|
||||||
|
<value>Cancel</value>
|
||||||
|
</data>
|
||||||
<data name="connection" xml:space="preserve">
|
<data name="connection" xml:space="preserve">
|
||||||
<value>Connection</value>
|
<value>Connection</value>
|
||||||
</data>
|
</data>
|
||||||
@ -156,9 +162,15 @@
|
|||||||
<data name="notifications" xml:space="preserve">
|
<data name="notifications" xml:space="preserve">
|
||||||
<value>Notifications</value>
|
<value>Notifications</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="ok" xml:space="preserve">
|
||||||
|
<value>OK</value>
|
||||||
|
</data>
|
||||||
<data name="operatorPreferences" xml:space="preserve">
|
<data name="operatorPreferences" xml:space="preserve">
|
||||||
<value>Operator preferences</value>
|
<value>Operator preferences</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="optionsTitle" xml:space="preserve">
|
||||||
|
<value>Web IM Tray Options</value>
|
||||||
|
</data>
|
||||||
<data name="playSoundOnVisitor" xml:space="preserve">
|
<data name="playSoundOnVisitor" xml:space="preserve">
|
||||||
<value>Play sound when visitor comes</value>
|
<value>Play sound when visitor comes</value>
|
||||||
</data>
|
</data>
|
||||||
|
@ -120,6 +120,9 @@
|
|||||||
<data name="application" xml:space="preserve">
|
<data name="application" xml:space="preserve">
|
||||||
<value>Приложение</value>
|
<value>Приложение</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="apply" xml:space="preserve">
|
||||||
|
<value>Применить</value>
|
||||||
|
</data>
|
||||||
<data name="autoDesconnectOnSS" xml:space="preserve">
|
<data name="autoDesconnectOnSS" xml:space="preserve">
|
||||||
<value>Автоматически отсоединяться, если запущен хранитель экрана</value>
|
<value>Автоматически отсоединяться, если запущен хранитель экрана</value>
|
||||||
</data>
|
</data>
|
||||||
@ -129,6 +132,9 @@
|
|||||||
<data name="autoStart" xml:space="preserve">
|
<data name="autoStart" xml:space="preserve">
|
||||||
<value>Запускать автоматически при загрузке системы</value>
|
<value>Запускать автоматически при загрузке системы</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="cancel" xml:space="preserve">
|
||||||
|
<value>Нет</value>
|
||||||
|
</data>
|
||||||
<data name="connection" xml:space="preserve">
|
<data name="connection" xml:space="preserve">
|
||||||
<value>Соединение</value>
|
<value>Соединение</value>
|
||||||
</data>
|
</data>
|
||||||
@ -156,9 +162,15 @@
|
|||||||
<data name="notifications" xml:space="preserve">
|
<data name="notifications" xml:space="preserve">
|
||||||
<value>Звуковые уведомления</value>
|
<value>Звуковые уведомления</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="ok" xml:space="preserve">
|
||||||
|
<value>Да</value>
|
||||||
|
</data>
|
||||||
<data name="operatorPreferences" xml:space="preserve">
|
<data name="operatorPreferences" xml:space="preserve">
|
||||||
<value>Настройки оператора</value>
|
<value>Настройки оператора</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="optionsTitle" xml:space="preserve">
|
||||||
|
<value>Настройки Веб Мессенджер "Трей"</value>
|
||||||
|
</data>
|
||||||
<data name="playSoundOnVisitor" xml:space="preserve">
|
<data name="playSoundOnVisitor" xml:space="preserve">
|
||||||
<value>Звуковое уведомление о появлении посетителя</value>
|
<value>Звуковое уведомление о появлении посетителя</value>
|
||||||
</data>
|
</data>
|
||||||
|
Loading…
Reference in New Issue
Block a user