Created
December 7, 2021 13:04
-
-
Save svick/65966b86c33013e43b13da27b8a63b5f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using var stream = File.OpenText(@"C:\Users\Svick\Desktop\iso-639-3.tab"); | |
using var reader = new CsvReader(stream, new(CultureInfo.InvariantCulture) { Delimiter = "\t" }); | |
var dict = reader.GetRecords(new { Id = "", Ref_Name = "" }).ToDictionary(x => x.Id, x => x.Ref_Name); | |
CultureInfo.GetCultures(CultureTypes.NeutralCultures) | |
.Where(c => c.TwoLetterISOLanguageName.Length > 2 && (!dict.TryGetValue(c.TwoLetterISOLanguageName, out string isoName) || isoName != c.EnglishName)) | |
.Select(c => new { c.Name, c.TwoLetterISOLanguageName, c.EnglishName, IsoName = dict[c.TwoLetterISOLanguageName] }) | |
.Dump(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment