Skip to content

Commit a404a2e

Browse files
authored
Added v. 9.0.0 to CHANGELOG (#128)
* Added v. 9.0.0 to CHANGELOG Replaced use of deprecated CodeBase with Location (in tests) Also minor code cleanup in TempFile.cs
1 parent 3eeffa1 commit a404a2e

7 files changed

Lines changed: 17 additions & 20 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1616

1717
## [Unreleased]
1818

19+
## [9.0.0] - 2026-02-02
20+
1921
### Changed
2022

2123
- BREAKING CHANGE: Move code that depends on Windows.Forms or System.Drawing into an L10NSharp.Windows.Forms namespace. Rename L10NSharp.UI as L10NSharp.Windows.Forms.UIComponents. Move L10NExtender out of UI subfolder into L10NSharp.Windows.Forms. Move Winforms related tests to L10NSharp.Windows.Forms.Tests. Change the folder for L10NSharp tests to match its namespace L10NSharp.Tests.

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<Company>SIL</Company>
55
<Authors>SIL Global</Authors>
66
<Product>L10NSharp</Product>
7-
<Copyright>Copyright © 2010-2025 SIL Global</Copyright>
7+
<Copyright>Copyright © 2010-2026 SIL Global</Copyright>
88
<ErrorReport>prompt</ErrorReport>
99
<WarningLevel>4</WarningLevel>
1010
<PackageLicenseExpression>MIT</PackageLicenseExpression>

src/L10NSharp.Tests/LocalizationManagerXliffTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public void Create_PreferredUiLanguageIsGenericVariant_CreatesLocalizationManage
3838
string genericLocaleId, string countrySpecificLocalId)
3939
{
4040
LocalizationManager.ClearLoadedManagers();
41-
var dir = Path.GetDirectoryName(new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath);
41+
var dir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
4242
var lm = LocalizationManager.Create(genericLocaleId, "Test", "Test", "1.0",
4343
Path.Combine(dir, "../../../src/L10NSharp.Tests/TestXliff2"), "", "",
4444
new string[] {});

src/L10NSharp.Tests/TempFile.cs

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,7 @@ public TempFile(string[] contentLines)
5454
File.WriteAllLines(_path, contentLines);
5555
}
5656

57-
public string Path
58-
{
59-
get { return _path; }
60-
}
57+
public string Path => _path;
6158

6259
// See comment on class above regarding Dispose
6360
public void Dispose()
@@ -97,7 +94,7 @@ public static TempFile CreateAndGetPathButDontMakeTheFile()
9794
/// <summary>
9895
/// Use this one when it's important to have a certain file extension
9996
/// </summary>
100-
/// <param name="extension">with or with out '.', will work the same</param>
97+
/// <param name="extension">with or without '.', will work the same</param>
10198
public static TempFile WithExtension(string extension)
10299
{
103100
extension = extension.TrimStart('.');
@@ -109,16 +106,16 @@ public static TempFile WithExtension(string extension)
109106
/// <summary>
110107
/// Use this one when it's important to have a certain file name (with, or without extension).
111108
/// </summary>
112-
/// <param name="filename">with or with out an extension, will work the same</param>
109+
/// <param name="filename">with or without an extension, will work the same</param>
113110
public static TempFile WithFilename(string filename)
114111
{
115112
if(filename == null)
116-
throw new ArgumentNullException("filename");
113+
throw new ArgumentNullException(nameof(filename));
117114
if(filename == string.Empty)
118-
throw new ArgumentException("Filename has no content", "filename");
115+
throw new ArgumentException("Filename has no content", nameof(filename));
119116
filename = filename.Trim();
120117
if(filename == string.Empty)
121-
throw new ArgumentException("Filename has only whitespace", "filename");
118+
throw new ArgumentException("Filename has only whitespace", nameof(filename));
122119

123120
var pathname = System.IO.Path.Combine(System.IO.Path.GetTempPath(), filename);
124121
File.Create(pathname).Close();
@@ -136,7 +133,7 @@ public static TempFile WithFilenameInTempFolder(string fileName)
136133
var tempFolder = System.IO.Path.Combine(System.IO.Path.GetTempPath(), System.IO.Path.GetRandomFileName());
137134
Directory.CreateDirectory(tempFolder);
138135
var path = System.IO.Path.Combine(tempFolder, fileName);
139-
var result = TempFile.TrackExisting(path);
136+
var result = TrackExisting(path);
140137
result._folderToDelete = tempFolder;
141138
return result;
142139
}
@@ -145,7 +142,7 @@ public static TempFile WithFilenameInTempFolder(string fileName)
145142
/// Used to make a real file out of a resource for the purpose of testing
146143
/// </summary>
147144
/// <param name="resource">e.g., an audio resource</param>
148-
/// <param name="extension">with or with out '.', will work the same</param>
145+
/// <param name="extension">with or without '.', will work the same</param>
149146
public static TempFile FromResource(Stream resource, string extension)
150147
{
151148
var f = WithExtension(extension);
@@ -159,7 +156,7 @@ public static TempFile FromResource(Stream resource, string extension)
159156
/// Used to make a real file out of a resource for the purpose of testing
160157
/// </summary>
161158
/// <param name="resource">e.g., a video resource</param>
162-
/// <param name="extension">with or with out '.', will work the same</param>
159+
/// <param name="extension">with or without '.', will work the same</param>
163160
public static TempFile FromResource(byte[] resource, string extension)
164161
{
165162
var f = WithExtension(extension);

src/L10NSharp.Tests/XLiffSchemaValidationTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ private static string SchemaLocation
1818
{
1919
get
2020
{
21-
var dir = Path.GetDirectoryName(new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath);
21+
var dir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
2222
var installedXliffDir = "../../../src/L10NSharp.Tests/TestXliff";
2323

2424
var schemaLocation = Path.Combine(dir, installedXliffDir,

src/L10NSharp.Tests/XLiffUtilsTests.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.IO;
33
using System.Reflection;
44
using NUnit.Framework;
@@ -13,9 +13,7 @@ public class XLiffUtilsTests
1313

1414
public XLiffUtilsTests()
1515
{
16-
var asmFile = Assembly.GetExecutingAssembly().CodeBase.Replace("file://", String.Empty);
17-
if (Environment.OSVersion.Platform == PlatformID.Win32NT)
18-
asmFile = asmFile.TrimStart('/');
16+
var asmFile = Assembly.GetExecutingAssembly().Location;
1917
var folder = Path.GetDirectoryName(asmFile); // will be something like <repodir>/output/Debug
2018
folder = Path.GetDirectoryName(folder);
2119
folder = Path.GetDirectoryName(folder);

src/L10NSharp.Windows.Forms.Tests/ILocalizableComponentTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public class ILocalizableComponentXLiffTests
2626
/// ------------------------------------------------------------------------------------
2727
protected void TestSetup(string installedTranslationDir)
2828
{
29-
var dir = Path.GetDirectoryName(new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath);
29+
var dir = Path.GetDirectoryName(new Uri(Assembly.GetExecutingAssembly().Location).LocalPath);
3030
m_manager = LocalizationManagerWinforms.Create("en", "LocalizableComponentTest", "LocalizableComponentTest", "1.0",
3131
Path.Combine(dir, installedTranslationDir),
3232
"", null, "", new string[] { })

0 commit comments

Comments
 (0)