Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- [L10NSharp.Windows.Forms] Restored project-local Resources support for `FallbackLanguagesDlgBase` button images (`Move`, `Move_up`, and `Move_down`).
- [L10NSharp.Windows.Forms] Corrected resource manager base name to `L10NSharp.Windows.Forms.Properties.Resources`.
- [L10NSharp.Windows.Forms.Tests] Corrected resource manager base name to `L10NSharp.Windows.Forms.Tests.Properties.Resources`.
- [L10NSharp] Fixed file handle leak in `XliffLocalizationManager.CreateOrUpdateDefaultXliffFileIfNecessary` when an exception was thrown between `File.Open` and `Close`. (#151)
- [L10NSharp] Fixed race condition in `XLiffBody.AddTransUnitRaw` where two concurrent threads with the same translation-unit ID could both bypass the duplicate check and silently overwrite each other's entry. (#150)
- [L10NSharp] Eliminated unnecessary cross-instance lock contention in `XLiffBody` by making `_transUnitIdLock` instance-level instead of static. (#150)
- [L10NSharp] Fixed `FilenamesToAddToCache` yielding both the custom and installed XLIFF for the same language when `UseLanguageCodeFolders` is `true`, causing custom translations to be silently overwritten by installed ones. (#140)
Expand Down
3 changes: 1 addition & 2 deletions src/L10NSharp.Tests/LocalizationManagerTestsBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@ public void CreateOrUpdateDefaultTranslationFileIfNecessary_CopiesOverEmptyGener

// generate an empty English Translation file
Directory.CreateDirectory(GetGeneratedDirectory(folder));
var fileStream = File.Open(generatedFilePath, FileMode.Create, FileAccess.ReadWrite, FileShare.None);
fileStream.Close();
File.Open(generatedFilePath, FileMode.Create, FileAccess.ReadWrite, FileShare.None).Dispose();

// SUT (buried down in there somewhere)
SetupManager(folder);
Expand Down
3 changes: 1 addition & 2 deletions src/L10NSharp/XLiffUtils/XliffLocalizationManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,7 @@ private void CreateOrUpdateDefaultXliffFileIfNecessary(
}

// Before wasting a bunch of time, make sure we can open the file for writing.
var fileStream = File.Open(DefaultStringFilePath, FileMode.Create, FileAccess.ReadWrite, FileShare.None);
fileStream.Close();
File.Open(DefaultStringFilePath, FileMode.Create, FileAccess.ReadWrite, FileShare.None).Dispose();

var stringCache = new XliffLocalizedStringCache(this, false);

Expand Down
Loading