What changed, and why it matters
This commit simply renames a field used for language codes from 'Bcp47' to 'Code' in the translation/language-pack feature. It updates the matching test expectations and the internal data model. There is no security-relevant change here.
No security action needed. Treat as routine refactoring.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch unifies the JSON property name consumed by LanguagePackUpdateService from ‘Bcp47’ to ‘Code’ in the language manifest DTO and record. Tests are adjusted to use ‘Code’ instead of ‘Bcp47’. No logic, validation, parsing, trust, or redirect behavior is altered.
Changed components
BTCPayServer/Plugins/Translations/LanguagePackUpdateService.csBTCPayServer.Tests/LanguageServiceTests.csInspect captured patch +7 / −8
### BTCPayServer.Tests/LanguageServiceTests.cs
@@ -68,7 +68,7 @@ public async Task LanguagePackUpdateService_ParsesManifestEntries()
"Languages": [
{
"Name": "French",
- "Bcp47": "fr-FR",
+ "Code": "fr-FR",
"Native": "Francais",
"File": "translations/french.json",
"Sha": "sha-fr",
@@ -93,7 +93,7 @@ public async Task LanguagePackUpdateService_ParsesManifestEntries()
Assert.Equal(2, languages.Length);
var french = languages.Single(l => l.Name == "French");
- Assert.Equal("fr-FR", french.Bcp47);
+ Assert.Equal("fr-FR", french.Code);
Assert.Equal("Francais", french.Native);
Assert.Equal("alice", french.MaintainerHandle);
Assert.Equal("https://github.com/alice", french.MaintainerUrl);
@@ -177,8 +177,7 @@ public async Task LanguagePackUpdateService_FollowsTrustedRedirect()
"Languages": [
{
"Name": "French",
- "Code": "fr",
- "Bcp47": "fr-FR",
+ "Code": "fr-FR",
"File": "translations/french.json",
"Sha": "{{expectedSha}}"
}
@@ -190,7 +189,7 @@ public async Task LanguagePackUpdateService_FollowsTrustedRedirect()
var service = CreateLanguageService(handler);
var languages = await service.GetManifestLanguages();
var french = Assert.Single(languages);
- Assert.Equal("fr-FR", french.Bcp47);
+ Assert.Equal("fr-FR", french.Code);
var (translationsJson, version, rtl) = await service.FetchLanguagePackFromRepository("French");
Assert.Equal(expectedSha, version, ignoreCase: true);
Assert.False(rtl);
### BTCPayServer/Plugins/Translations/LanguagePackUpdateService.cs
@@ -24,7 +24,7 @@ public record LanguageManifestEntry(
string File,
string Sha,
bool Rtl,
- string? Bcp47)
+ string? Code)
{
internal static LanguageManifestEntry FromDto(ManifestLanguageDto dto)
{
@@ -42,7 +42,7 @@ internal static LanguageManifestEntry FromDto(ManifestLanguageDto dto)
dto.File ?? string.Empty,
dto.Sha ?? string.Empty,
dto.Rtl ?? false,
- dto.Bcp47);
+ dto.Code);
}
private static (string? Handle, string? Url) SplitMaintainer(string? raw)
@@ -61,7 +61,7 @@ internal record ManifestLanguageDto(
string? File,
string? Sha,
bool? Rtl,
- string? Bcp47);
+ string? Code);
internal record ManifestRootDto(ManifestLanguageDto[]? Languages, string? Redirect);
private sealed record ManifestSnapshot(LanguageManifestEntry[] Entries, Uri ManifestUri);Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.