Closed webspiderteam closed 2 years ago
and one more think if target dir has resx files we can check wich languages available before
for this I added
private void btnSelectResxSource_Click(object sender, EventArgs e)
{
var dlg = new OpenFileDialog();
dlg.Filter = "ResourceX File|*.resx";
if (dlg.ShowDialog() == DialogResult.OK)
{
txtSourceResx.Text = dlg.FileName;
if (txtOutputDir.Text.Length == 0)
{
txtOutputDir.Text = Path.GetDirectoryName(txtSourceResx.Text);
}
/// From Here ---->
string[] filePaths = Directory.GetFiles(Path.GetDirectoryName(txtSourceResx.Text), "*.resx");
foreach (int i in lstResxLanguages.CheckedIndices) // here clears checked items
lstResxLanguages.Items[i].Checked=false; // this can be disabled some users may not like
foreach (var file in filePaths)
{
var haslng = ReadLanguageName(file);
if (haslng != "")
{
var haskey = _languages.FirstOrDefault(x => string.Compare(x.Key, haslng, StringComparison.InvariantCultureIgnoreCase) == 0);
lstResxLanguages.Items[lstResxLanguages.Items.IndexOfKey(haskey.Key)].Checked = true;
}
}
// <---- to Here
var lng = ReadLanguageName(txtSourceResx.Text);
var key = _languages.FirstOrDefault(x => string.Compare(x.Key, lng, StringComparison.InvariantCultureIgnoreCase) == 0);
if (key.Key != null)
cmbSourceResxLng.SelectedItem = key;
else
Thank you it is merged now
Hello. First of all thanks for that beautiful app. Its life saver but I think it need this little improvement. Most programmer adds new features in their app by time and adds new keys to their resource files. But Google Translate is not perfect yet and translations can be wrong. So Programmers Fix their wrong translation by time. but when they add new keys their corrected Translations can gone if they translate them with this app and they have to fix all again one by one. So I made a little change to fix this.
In frmMain
I added a checkbox named "checkBoxTranslateOnlyNew"
in frmMain.cs ResxProgressCallback action was
and changed code as
I hope this would help other people too.