Skip to content

Commit

Permalink
Fixed an issue that causes NLocalizer to crash if application's Curre…
Browse files Browse the repository at this point in the history
…ntCulture is not an english culture.
  • Loading branch information
ravibpatel committed Feb 27, 2018
1 parent 88b378d commit d5fe577
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 4 deletions.
6 changes: 3 additions & 3 deletions NLocalizer/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("NLocalizer")]
[assembly: AssemblyCopyright("Copyright © 2010-2017 Chris Prusik (KAP1 Ltd www.kap1.net)")]
[assembly: AssemblyCopyright("Copyright © 2010-2018 Chris Prusik (KAP1 Ltd www.kap1.net)")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand All @@ -50,5 +50,5 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// 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("1.10.0.0")]
[assembly: AssemblyFileVersion("1.10.0.0")]
[assembly: AssemblyVersion("1.10.1.0")]
[assembly: AssemblyFileVersion("1.10.1.0")]
6 changes: 5 additions & 1 deletion NLocalizer/Translation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,15 @@ public void Add(string key, bool autoTranslate, string fromLanguage = "", Progre
/// <summary>
/// Initializes a new instance of the <see cref="Translation"/> class and Init() this default values.
/// </summary>
public Translation()
public Translation() : this(StringComparer.InvariantCulture)
{
Init();
}

private Translation(IComparer<string> comparer) : base(comparer)
{
}

/// <summary>
/// Inits this instance default values.
/// </summary>
Expand Down
10 changes: 10 additions & 0 deletions NLocalizer/TranslationClasses.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
*******************************************************************************/

using System;
using System.Collections.Generic;

namespace NLocalizer
Expand All @@ -26,5 +28,13 @@ namespace NLocalizer
/// </summary>
public class TranslationClasses : SortedDictionary<string, TranslationProperties>
{
/// <inheritdoc />
public TranslationClasses() : this(StringComparer.InvariantCulture)
{
}

private TranslationClasses(IComparer<string> comparer) : base(comparer)
{
}
}
}
9 changes: 9 additions & 0 deletions NLocalizer/TranslationLocales.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ namespace NLocalizer
/// </example>
public class TranslationLocales : SortedDictionary<string, string>
{
/// <inheritdoc />
public TranslationLocales() : this(StringComparer.InvariantCulture)
{
}

private TranslationLocales(IComparer<string> comparer) : base(comparer)
{
}

/// <summary>
/// Get list of locales names.
/// </summary>
Expand Down
10 changes: 10 additions & 0 deletions NLocalizer/TranslationProperties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
*******************************************************************************/

using System;
using System.Collections.Generic;

namespace NLocalizer
Expand All @@ -26,6 +28,14 @@ namespace NLocalizer
/// </summary>
public class TranslationProperties : SortedDictionary<string, TranslationProperty>
{
/// <inheritdoc />
public TranslationProperties() : this(StringComparer.InvariantCulture)
{
}

private TranslationProperties(IComparer<string> comparer) : base(comparer)
{
}

/// <summary>
/// Check if static property to translate exists on this form.
Expand Down

0 comments on commit d5fe577

Please sign in to comment.