Skip to content

Fix featured bookmark character having no localization #2119

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 26 additions & 9 deletions ImperatorToCK3/CK3/CK3LocDB.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,34 @@
return false;
}

public bool TryGetValue(string key, [MaybeNullWhen(false)] out LocBlock locBlock) {
if (ModFSLocDB.TryGetValue(key, out locBlock)) {
return true;
}
if (ConverterGeneratedLocDB.TryGetValue(key, out locBlock)) {
return true;
public bool TryGetValue(string key, [MaybeNullWhen(false)] out LocBlock locBlock) { // TODO: return readonly locblock instead

Check warning on line 61 in ImperatorToCK3/CK3/CK3LocDB.cs

View workflow job for this annotation

GitHub Actions / build (macos-14)

Check warning on line 61 in ImperatorToCK3/CK3/CK3LocDB.cs

View workflow job for this annotation

GitHub Actions / build (self-hosted, linux)

Check warning on line 61 in ImperatorToCK3/CK3/CK3LocDB.cs

View workflow job for this annotation

GitHub Actions / test (macos-14)

Check warning on line 61 in ImperatorToCK3/CK3/CK3LocDB.cs

View workflow job for this annotation

GitHub Actions / build (self-hosted, windows)

Check warning on line 61 in ImperatorToCK3/CK3/CK3LocDB.cs

View workflow job for this annotation

GitHub Actions / test_and_check_coverage

Check warning on line 61 in ImperatorToCK3/CK3/CK3LocDB.cs

View workflow job for this annotation

GitHub Actions / test (self-hosted, windows)

bool found = false;
locBlock = null;

// TODO: add unit test for combining loc from all the sources into one locblock

Check warning on line 65 in ImperatorToCK3/CK3/CK3LocDB.cs

View workflow job for this annotation

GitHub Actions / build (macos-14)

TODO add unit test for combining loc from all the sources into one locblock (https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0026.md)

Check warning on line 65 in ImperatorToCK3/CK3/CK3LocDB.cs

View workflow job for this annotation

GitHub Actions / build (self-hosted, linux)

TODO add unit test for combining loc from all the sources into one locblock (https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0026.md)

Check warning on line 65 in ImperatorToCK3/CK3/CK3LocDB.cs

View workflow job for this annotation

GitHub Actions / test (macos-14)

TODO add unit test for combining loc from all the sources into one locblock (https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0026.md)

Check warning on line 65 in ImperatorToCK3/CK3/CK3LocDB.cs

View workflow job for this annotation

GitHub Actions / build (self-hosted, windows)

TODO add unit test for combining loc from all the sources into one locblock (https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0026.md)

Check warning on line 65 in ImperatorToCK3/CK3/CK3LocDB.cs

View workflow job for this annotation

GitHub Actions / test_and_check_coverage

TODO add unit test for combining loc from all the sources into one locblock (https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0026.md)

Check warning on line 65 in ImperatorToCK3/CK3/CK3LocDB.cs

View workflow job for this annotation

GitHub Actions / test (self-hosted, windows)

TODO add unit test for combining loc from all the sources into one locblock (https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0026.md)

if (OptionalConverterLocDB.TryGetValue(key, out var optionalLocBlock)) {
found = true;
locBlock = optionalLocBlock;
}
if (ConverterGeneratedLocDB.TryGetValue(key, out var converterGeneratedLocDBLocBlock)) {
found = true;
if (locBlock is null) {
locBlock = converterGeneratedLocDBLocBlock;
} else {
locBlock.CopyFrom(converterGeneratedLocDBLocBlock);
}
}
if (OptionalConverterLocDB.TryGetValue(key, out locBlock)) {
return true;
if (ModFSLocDB.TryGetValue(key, out var modFSLocBlock)) {
found = true;
if (locBlock is null) {
locBlock = modFSLocBlock;
} else {
locBlock.CopyFrom(modFSLocBlock);
}
}
return false;

return found;
}

public LocBlock? GetLocBlockForKey(string key) {
Expand Down
Loading