LanguageTags is a C# .NET library for handling ISO 639-2, ISO 639-3, and RFC 5646 / BCP 47 language tags.
The project serves two primary purposes:
- Data Publishing: Provides ISO 639-2, ISO 639-3, and RFC 5646 language tag records in JSON and C# formats
- Tag Processing: Implements IETF BCP 47 language tag construction and parsing per RFC 5646 semantic rules
For comprehensive coding standards and detailed conventions, refer to .github/copilot-instructions.md and CODESTYLE.md.
-
LanguageTags (
LanguageTags/LanguageTags.csproj)- Core library project
- NuGet package:
ptr727.LanguageTags - Target framework: .NET 10.0
- AOT compatible (
<IsAotCompatible>true</IsAotCompatible>)
-
LanguageTagsCreate (
LanguageTagsCreate/LanguageTagsCreate.csproj)- CLI utility for downloading and generating language data
- Downloads from official sources (Library of Congress, SIL, IANA)
- Converts to JSON and generates C# code files
-
LanguageTagsTests (
LanguageTagsTests/LanguageTagsTests.csproj)- xUnit test suite with comprehensive test coverage
- Uses AwesomeAssertions for test assertions
Public API Classes:
LanguageTag: Main class for working with language tags (parse, build, normalize, validate)LanguageTagBuilder: Fluent builder for constructing language tagsLanguageLookup: Language code conversion and matching (IETF ↔ ISO)Iso6392Data: ISO 639-2 language code data (Create(),FromDataAsync(),FromJsonAsync())Iso6393Data: ISO 639-3 language code data (Create(),FromDataAsync(),FromJsonAsync())Rfc5646Data: RFC 5646 / BCP 47 language subtag registry data (Create(),FromDataAsync(),FromJsonAsync())ExtensionTag: Represents extension subtags (sealed record)PrivateUseTag: Represents private use subtags (sealed record)LogOptions: Static class for configuring library-wide logging viaILoggerFactory
Internal Classes:
LanguageTagParser: Internal parser implementation (useLanguageTag.Parse()instead)
For detailed specifications, see:
.github/copilot-instructions.md- Complete coding conventions and style guideCODESTYLE.md- Code style and formatting rules.editorconfig- Automated style enforcement- Project task definitions -
CSharpier Format,.Net Build,.Net Format,Husky.Net Run