diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2013-01-04 10:28:47 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2013-01-04 10:28:47 +0000 |
commit | 2a53a07949971e08b3526f168f701bf038c9dbf9 (patch) | |
tree | d9ad28188ae7bb839c2e0b9cc7c5e3081cc6c9ee /tools/Langpack Suite/Form1.cs | |
parent | e67bf0ac881c04b422c601f757776893974031c1 (diff) |
added ability to generate different langpacks
added new command line param (\p)
git-svn-id: http://svn.miranda-ng.org/main/trunk@2955 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'tools/Langpack Suite/Form1.cs')
-rw-r--r-- | tools/Langpack Suite/Form1.cs | 42 |
1 files changed, 36 insertions, 6 deletions
diff --git a/tools/Langpack Suite/Form1.cs b/tools/Langpack Suite/Form1.cs index 19bfc3abf4..40c3b3d38c 100644 --- a/tools/Langpack Suite/Form1.cs +++ b/tools/Langpack Suite/Form1.cs @@ -34,6 +34,18 @@ namespace Langpack_Suite tipper.ReshowDelay = 500;
tipper.ShowAlways = true;
+ DirectoryInfo root = Directory.GetParent(Directory.GetCurrentDirectory());
+ string[] dirs = Directory.GetDirectories(root.ToString());
+ foreach (string dir in dirs)
+ {
+ if (!dir.Equals(Directory.GetCurrentDirectory()) && File.Exists(dir + "\\=HEAD=.txt"))
+ {
+ int pos = dir.LastIndexOf('\\');
+ string item = dir.Substring(pos + 1);
+ LangpacksComboBox.Items.Add(item);
+ }
+ }
+
for (int i = 1; i < arguments.Length; i++)
{
string key = arguments[i].Substring(0, 2);
@@ -51,7 +63,7 @@ namespace Langpack_Suite if (fname.Contains("\\"))
OwnFileEdit.Text = fname;
else
- OwnFileEdit.Text = Directory.GetCurrentDirectory() + "\\" + fname;
+ OwnFileEdit.Text = Directory.GetParent(Directory.GetCurrentDirectory()).ToString() + "\\" + LangpacksComboBox.Text + "\\" + fname;
OwnFileCheckBox.Checked = true;
OwnFilesCheckBoxChange();
}
@@ -66,6 +78,12 @@ namespace Langpack_Suite {
output = arguments[i].Substring(2);
}
+ if (key.Equals("\\p"))
+ {
+ string fname = arguments[i].Substring(2);
+ LangpacksComboBox.Text = fname;
+ LangpacksComboBoxChange();
+ }
}
if (quiet)
{
@@ -151,7 +169,8 @@ namespace Langpack_Suite NotTranslFindBtn.Text = CurrentText;
CurrentText = rm.GetString("CommentFindBtn", culture);
CommentFindBtn.Text = CurrentText;
-
+ CurrentText = rm.GetString("AvailLangpacks", culture);
+ label7.Text = CurrentText;
}
private void GenerateLang()
@@ -169,7 +188,7 @@ namespace Langpack_Suite InfMessageLangBox.Text = LocaleText + "\r\n";
- FolderName = Directory.GetCurrentDirectory();
+ FolderName = Directory.GetParent(Directory.GetCurrentDirectory()).ToString() + "\\" + LangpacksComboBox.Text;
if (output == "")
output = FolderName + "\\" + LangpackNameEdit.Text + ".txt";
if (File.Exists(output))
@@ -631,7 +650,7 @@ namespace Langpack_Suite SelectOwnFilesOpenFileDialog.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*";
SelectOwnFilesOpenFileDialog.FilterIndex = 1;
SelectOwnFilesOpenFileDialog.RestoreDirectory = true;
- SelectOwnFilesOpenFileDialog.InitialDirectory = Directory.GetCurrentDirectory();
+ SelectOwnFilesOpenFileDialog.InitialDirectory = Directory.GetParent(Directory.GetCurrentDirectory()).ToString() + "\\" + LangpacksComboBox.Text;
if (SelectOwnFilesOpenFileDialog.ShowDialog() == DialogResult.OK)
{
try
@@ -665,7 +684,7 @@ namespace Langpack_Suite string LocaleText = rm.GetString("LinkListGen", culture);
InfMessageLinkBox.Text = LocaleText + "\r\n";
- FolderName = Directory.GetCurrentDirectory();
+ FolderName = Directory.GetParent(Directory.GetCurrentDirectory()).ToString() + "\\" + LangpacksComboBox.Text;
if (File.Exists(FolderName + "\\LinkList.txt"))
File.Delete(FolderName + "\\LinkList.txt");
@@ -736,7 +755,7 @@ namespace Langpack_Suite string FolderName = "";
InfMessageFindBox.Text = "";
- FolderName = Directory.GetCurrentDirectory();
+ FolderName = Directory.GetParent(Directory.GetCurrentDirectory()).ToString() + "\\" + LangpacksComboBox.Text;
DirectoryInfo RootDir = new DirectoryInfo(FolderName);
ResourceManager rm = new ResourceManager("LangpackSuite.myRes", typeof(MainForm).Assembly);
string LocaleText = rm.GetString("FindLang", culture);
@@ -823,5 +842,16 @@ namespace Langpack_Suite string LocaleHead = rm.GetString("VarHead", culture);
MessageBox.Show(LocaleText, LocaleHead);
}
+
+ private void LangpacksComboBoxChange()
+ {
+ LangpackNameEdit.Text = "Langpack_" + LangpacksComboBox.Text;
+ CreateLangpackBtn.Enabled = true;
+ }
+
+ private void LangpacksComboBox_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ LangpacksComboBoxChange();
+ }
}
}
\ No newline at end of file |