Skip to content

Commit

Permalink
fix: Fix sr-Cyrl resourcesloading
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromelaban committed Jul 13, 2021
1 parent 7e2cb67 commit f8c3208
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/Uno.UI.Tests/Resources/Given_ResourceCandidate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public class Given_ResourceCandidate
[DataRow(@"Assets\logo.lang-fr-CA.png", @"Assets\logo.png", null, "fr-CA", null)]
[DataRow(@"Assets\logo.lang-fr-CA.scale-200.png", @"Assets\logo.png", "200", "fr-CA", null)]
[DataRow(@"Assets\logo.scale-200.lang-fr-CA.png", @"Assets\logo.png", "200", "fr-CA", null)]
[DataRow(@"Assets\sr-Cyrl\logo.png", @"Assets\logo.png", null, "sr-Cyrl", null)]
[TestMethod]
public void When_Parse(string relativePath, string logicalPath, string scale, string language, string custom)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,14 @@ private static HashSet<string> LanguageTags
{
var cultures = CultureInfo.GetCultures(CultureTypes.SpecificCultures);
var ietfLanguageTags = cultures.Select(c => c.IetfLanguageTag);
var ietfLanguageParentTags = cultures.Select(c => c.Parent.IetfLanguageTag);
var twoLetterLanguageTags = cultures.Select(c => c.TwoLetterISOLanguageName);
_languageTags = new HashSet<string>(Enumerable.Concat(ietfLanguageTags, twoLetterLanguageTags).Distinct());

var allCulture = Enumerable.Concat(
ietfLanguageTags,
twoLetterLanguageTags.Concat(ietfLanguageParentTags));

_languageTags = new HashSet<string>(allCulture.Distinct());
}

return _languageTags;
Expand Down

0 comments on commit f8c3208

Please sign in to comment.