sillsdev / l10nsharp

A .NET localization library for Windows Forms applications.
3 stars 10 forks source link

Fix mono test #4

Closed gmartin7 closed 8 years ago

gmartin7 commented 8 years ago

Ubuntu Precise does not have 'az' culture. Trusty does. This test will be ignored on Precise, but will pass correctly on Trusty.


This change is Reviewable

andrew-polk commented 8 years ago

Reviewed 1 of 1 files at r1. Review status: all files reviewed at latest revision, 1 unresolved discussion.


_src/L10NSharpTests/LocalizationManagerTests.cs, line 205 at r1 (raw file):_

      {
          // Check if the OS includes 'az' culture - Ubuntu 12.04 Precise doesn't
          if (!CultureInfo.GetCultures(CultureTypes.NeutralCultures).Select(c => c.Name == "az").Any())

Seems okay in general... But makes me wonder if there is another culture which could be tested on all systems to accomplish the original intent of the test.


Comments from Reviewable

gmartin7 commented 8 years ago

Review status: all files reviewed at latest revision, 1 unresolved discussion.


_src/L10NSharpTests/LocalizationManagerTests.cs, line 205 at r1 (raw file):_

Previously, andrew-polk wrote… > Seems okay in general... > But makes me wonder if there is another culture which could be tested on all systems to accomplish the original intent of the test. >

I doubt it, since this is a just a hack to make sure that NativeName returns the 'right' value according to an expert for just this one language: /// This class exists only to override Microsoft's NativeName for the Azeri neutral culture. /// According to Ken Keyes the NativeName on the 'az-Latn' culture is correct, while the /// NativeName on the 'az' culture is incorrect. So we do a swifty swap. ///

public class L10NCultureInfo: CultureInfo

and // The Windows .Net runtime returns 'Azərbaycan dili (Azərbaycan)' for az-Latn, and // something totally different for az. // The Mono runtime returns "azərbaycan" for both az and az-Latn. // So we just set this to what we "know" is the right value for az. if (name == "az") _nativeName = "Azərbaycan dili";


Comments from Reviewable

andrew-polk commented 8 years ago
:lgtm:

Review status: :shipit: all files reviewed at latest revision, all discussions resolved, all commit checks successful.


_Comments from Reviewable_