Skip to content

Commit

Permalink
다국어 지원을 위한 지역화 작업
Browse files Browse the repository at this point in the history
  • Loading branch information
icaros7 committed Dec 3, 2018
1 parent 3c6ff2e commit 8826096
Show file tree
Hide file tree
Showing 14 changed files with 2,361 additions and 1,103 deletions.
Binary file modified server/Ets2Telemetry.exe
Binary file not shown.
Binary file modified server/Ets2Telemetry.pdb
Binary file not shown.
1,412 changes: 706 additions & 706 deletions source/Funbit.Ets.Telemetry.Server/Data/IEts2TelemetryData.cs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,11 @@
<Compile Include="Helpers\Settings.cs" />
<Compile Include="Helpers\Win32Uac.cs" />
<Compile Include="Helpers\NetworkHelper.cs" />
<Compile Include="StringLib.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>StringLib.resx</DependentUpon>
</Compile>
<Compile Include="SetupForm.cs">
<SubType>Form</SubType>
</Compile>
Expand Down Expand Up @@ -380,6 +385,10 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Resources\app.ico" />
<EmbeddedResource Include="StringLib.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>StringLib.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Include="SetupForm.resx">
<DependentUpon>SetupForm.cs</DependentUpon>
</EmbeddedResource>
Expand Down
4 changes: 2 additions & 2 deletions source/Funbit.Ets.Telemetry.Server/Helpers/ProcessHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ public static int RunAndWait(

var exited = false;

Log.InfoFormat("실행 명령어 : \r\n{0} {1}", exeFileName, arguments);
Log.InfoFormat(StringLib.ProcessHelper_RunArgs + " : \r\n{0} {1}", exeFileName, arguments);

using (var outputWaitHandle = new AutoResetEvent(false))
using (var errorWaitHandle = new AutoResetEvent(false))
using (var process = Process.Start(info))
{
if (process == null || process.Handle == IntPtr.Zero)
throw new Exception("실행 실패한 프로세스 : " + exeFileName);
throw new Exception(StringLib.ProcessHelper_RunFailed + " : " + exeFileName);

// ReSharper disable AccessToDisposedClosure
process.OutputDataReceived += (sender, a) =>
Expand Down
120 changes: 60 additions & 60 deletions source/Funbit.Ets.Telemetry.Server/MainForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

62 changes: 40 additions & 22 deletions source/Funbit.Ets.Telemetry.Server/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void Setup()
{
if (Program.UninstallMode && SetupManager.Steps.All(s => s.Status == SetupStatus.Uninstalled))
{
MessageBox.Show(this, @"서버가 설치되어 있지 않습니다. 제거 할 수 없습니다.", @"완료",
MessageBox.Show(this, StringLib.Uninstall_NotInstall, StringLib.Done,
MessageBoxButtons.OK, MessageBoxIcon.Information);
Environment.Exit(0);
}
Expand All @@ -69,7 +69,7 @@ void Setup()
catch (Exception ex)
{
Log.Error(ex);
ex.ShowAsMessageBox(this, @"설치 오류");
ex.ShowAsMessageBox(this, StringLib.Error_Install);
}
}

Expand Down Expand Up @@ -114,17 +114,39 @@ void Start()
catch (Exception ex)
{
Log.Error(ex);
ex.ShowAsMessageBox(this, @"네트워크 오류", MessageBoxIcon.Exclamation);
ex.ShowAsMessageBox(this, StringLib.Error_Network, MessageBoxIcon.Exclamation);
}
}

void MainForm_Load(object sender, EventArgs e)
{
// log current version for debugging
Log.InfoFormat("{0} ({1}) {2}에서 실행중", Environment.OSVersion,
Environment.Is64BitOperatingSystem ? "64비트" : "32비트",
Program.UninstallMode ? "[제거 모드]" : "");
Text += @" " + AssemblyHelper.Version;
Log.InfoFormat("{0} ({1}) {2}", Environment.OSVersion,
Environment.Is64BitOperatingSystem ? "64" + StringLib.CurrentVersion_Bit : "32" + StringLib.CurrentVersion_Bit,
Program.UninstallMode ? "[" + StringLib.CurrentVersion_UninstallMode + "]" : "" + StringLib.CurrentVersion_Running);

// Locale Apply

// Main Form Title
Text = StringLib.Title + @" " + AssemblyHelper.Version;
// ToolStripMenu_Sever
serverToolStripMenu.Text = StringLib.Menu_Server;
AddShortCutToolStripMenuItem.Text = StringLib.Menu_Server_ShortCut;
uninstallToolStripMenuItem.Text = StringLib.Menu_Server_Uninstall;

// ToolStripMenu_Help
helpToolStripMenuItem.Text = StringLib.Menu_Help;
helpToolStripMenu.Text = StringLib.Menu_Help;
donateToolStripMenuItem.Text = StringLib.Menu_Help_Donation;
aboutToolStripMenuItem.Text = StringLib.Menu_Help_About;
TranslateToolStripMenuItem.Text = StringLib.Menu_Help_Translate;

groupBox1.Text = StringLib.groupBox1;
statusTitleLabel.Text = StringLib.statusTitleLabel + @" :";
networkInterfaceTitleLabel.Text = StringLib.networkInterfaceTitleLabel + @" :";
serverIpTitleLabel.Text = StringLib.serverIpTitleLabel + @" :";
appUrlTitleLabel.Text = StringLib.appUrlTitleLabel + @" :";
apiEndpointUrlTitleLabel.Text = StringLib.apiEndpointUrlTitleLabel + @" :";

// install or uninstall server if needed
Setup();
Expand Down Expand Up @@ -155,29 +177,29 @@ void statusUpdateTimer_Tick(object sender, EventArgs e)
{
if (UseTestTelemetryData)
{
statusLabel.Text = @"Ets2TestTelemetry.json에 연결됨";
statusLabel.Text = @"Ets2TestTelemetry.json" + StringLib.statusLabel_ConnectedAt;
statusLabel.ForeColor = Color.DarkGreen;
}
else if (Ets2ProcessHelper.IsEts2Running && Ets2TelemetryDataReader.Instance.IsConnected)
{
statusLabel.Text = $"시뮬레이터에 연결됨 ({Ets2ProcessHelper.LastRunningGameName})";
statusLabel.Text = $"{StringLib.statusLabel_ConnectedSim} ({Ets2ProcessHelper.LastRunningGameName})";
statusLabel.ForeColor = Color.DarkGreen;
}
else if (Ets2ProcessHelper.IsEts2Running)
{
statusLabel.Text = $"시뮬레이터가 실행중 ({Ets2ProcessHelper.LastRunningGameName})";
statusLabel.Text = $"{StringLib.statusLabel_RunningSim} ({Ets2ProcessHelper.LastRunningGameName})";
statusLabel.ForeColor = Color.Teal;
}
else
{
statusLabel.Text = @"시뮬레이터가 실행중이 아님";
statusLabel.Text = StringLib.statusLabel_NotRunningSim;
statusLabel.ForeColor = Color.FromArgb(240, 55, 30);
}
}
catch (Exception ex)
{
Log.Error(ex);
ex.ShowAsMessageBox(this, @"프로세스 에러");
ex.ShowAsMessageBox(this, StringLib.Error_Process);
statusUpdateTimer.Enabled = false;
}
}
Expand All @@ -197,8 +219,8 @@ void MainForm_Resize(object sender, EventArgs e)
ShowInTaskbar = WindowState != FormWindowState.Minimized;
if (!ShowInTaskbar && trayIcon.Tag == null)
{
trayIcon.ShowBalloonTip(1000, @"ETS2/ATS Telemetry 서버", @"Double-click to restore.", ToolTipIcon.Info);
trayIcon.Tag = "이미 보여짐";
trayIcon.ShowBalloonTip(1000, StringLib.Title, StringLib.trayIcon_DoubleClick, ToolTipIcon.Info);
trayIcon.Tag = StringLib.trayIcon_Tag;
}
}

Expand Down Expand Up @@ -260,26 +282,22 @@ private void contextMenuStrip_Opening(object sender, System.ComponentModel.Cance

}

private void 번역ToolStripMenuItem_Click(object sender, EventArgs e)
{
}

private void AddShortCutToolStripMenuItem_Click(object sender, EventArgs e)
{
string startupFolderPath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
var shell = new WshShell();
string shortCutLinkFilePath = startupFolderPath + @"Telemetry 서버.lnk";
string shortCutLinkFilePath = startupFolderPath + @"\" + StringLib.AddShortCut_Name + @".lnk";
var windowsApplicationShortcut = (IWshShortcut)shell.CreateShortcut(shortCutLinkFilePath);
windowsApplicationShortcut.Description = "ETS2/ATS Telemetry 웹 서버를 실행 합니다.";
windowsApplicationShortcut.Description = StringLib.AddShortCut_Desciption;
windowsApplicationShortcut.WorkingDirectory = Application.StartupPath;
windowsApplicationShortcut.TargetPath = Application.ExecutablePath;
windowsApplicationShortcut.Save();
MessageBox.Show(@"바로가기가 바탕화면에 생성 되었습니다.", @"알림", MessageBoxButtons.OK, MessageBoxIcon.Information);
MessageBox.Show(StringLib.AddShortCut_Done, StringLib.Information, MessageBoxButtons.OK, MessageBoxIcon.Information);
}

private void TranslateToolStripMenuItem_Click(object sender, EventArgs e)
{
MessageBox.Show(this, @"한글화 : hominlab@minnote.net", @"한글화", MessageBoxButtons.OK ,MessageBoxIcon.Information);
MessageBox.Show(this, @"한국어 : hominlab@minnote.net", StringLib.Menu_Help_Translate, MessageBoxButtons.OK ,MessageBoxIcon.Information);
}
}
}
4 changes: 2 additions & 2 deletions source/Funbit.Ets.Telemetry.Server/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.2.7.1")]
[assembly: AssemblyFileVersion("3.2.7.1")]
[assembly: AssemblyVersion("3.2.7.2")]
[assembly: AssemblyFileVersion("3.2.7.2")]
26 changes: 13 additions & 13 deletions source/Funbit.Ets.Telemetry.Server/Setup/FirewallSetup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class FirewallSetup : ISetup
{
static readonly log4net.ILog Log = log4net.LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);

static readonly string FirewallRuleName = $"ETS2 TELEMETRY 서버 (포트 {ConfigurationManager.AppSettings["Port"]})";
static readonly string FirewallRuleName = StringLib.Firewall_RuleName + $"{ConfigurationManager.AppSettings["Port"]})";

SetupStatus _status;

Expand All @@ -26,8 +26,8 @@ public FirewallSetup()
{
string port = ConfigurationManager.AppSettings["Port"];
const string arguments = "advfirewall firewall show rule dir=in name=all";
Log.Info("방화벽 규칙 확인중...");
string output = ProcessHelper.RunNetShell(arguments, "방화벽 규칙 상태 확인 실패");
Log.Info(StringLib.Firewall_CheckRule);
string output = ProcessHelper.RunNetShell(arguments, StringLib.Firewall_FailedCheckRule);
// this check is kind of lame, but it works in any locale...
_status = output.Contains(port) && output.Contains(FirewallRuleName)
? SetupStatus.Installed : SetupStatus.Uninstalled;
Expand All @@ -52,8 +52,8 @@ public SetupStatus Install(IWin32Window owner)
string port = ConfigurationManager.AppSettings["Port"];
string arguments = $"advfirewall firewall add rule name=\"{FirewallRuleName}\" " +
$"dir=in action=allow protocol=TCP localport={port} remoteip=localsubnet";
Log.Info("방화벽 규칙 추가중...");
ProcessHelper.RunNetShell(arguments, "방화벽 규칙 추가 실패");
Log.Info(StringLib.Firewall_AddRule);
ProcessHelper.RunNetShell(arguments, StringLib.Firewall_FailedAddRule);
_status = SetupStatus.Installed;
}
catch (Exception ex)
Expand All @@ -62,9 +62,9 @@ public SetupStatus Install(IWin32Window owner)
Log.Error(ex);
Settings.Instance.FirewallSetupHadErrors = true;
Settings.Instance.Save();
throw new Exception("윈도우 방화벽에 연결 할 수 없습니다." + Environment.NewLine +
"만약 제3자 소프트웨어 백신 (V3, 카스퍼스키 등)을 사용중 이라면, " +
ConfigurationManager.AppSettings["Port"] + "번 TCP포트를 직접 열어주세요!", ex);
throw new Exception(StringLib.Firewall_WFMissing1 + Environment.NewLine +
StringLib.Firewall_WFMissing2 +
ConfigurationManager.AppSettings["Port"] + StringLib.Firewall_WFMissing3, ex);
}

return _status;
Expand All @@ -79,17 +79,17 @@ public SetupStatus Uninstall(IWin32Window owner)
try
{
string arguments = $"advfirewall firewall delete rule name=\"{FirewallRuleName}\"";
Log.Info("방화벽 규칙 제거중...");
ProcessHelper.RunNetShell(arguments, "방화벽 규칙 제거 실패");
Log.Info(StringLib.Firewall_RmRule);
ProcessHelper.RunNetShell(arguments, StringLib.Firewall_FailedRmRule);
status = SetupStatus.Uninstalled;
}
catch (Exception ex)
{
Log.Error(ex);
_status = SetupStatus.Failed;
throw new Exception("윈도우 방화벽에 연결 할 수 없습니다." + Environment.NewLine +
"만약 제3자 소프트웨어 백신 (V3, 카스퍼스키 등)을 사용중 이라면, " +
ConfigurationManager.AppSettings["Port"] + "번 TCP포트를 직접 닫아주세요!", ex);
throw new Exception(StringLib.Firewall_WFMissing1 + Environment.NewLine +
StringLib.Firewall_WFMissing2 +
ConfigurationManager.AppSettings["Port"] + StringLib.Firewall_WFMissing3_1, ex);
}
return status;
}
Expand Down
Loading

0 comments on commit 8826096

Please sign in to comment.