[QuickAccent] Add Vietnamese (#40164)

<!-- Enter a brief description/summary of your PR here. What does it
fix/what does it change/how was it tested (even manually, if necessary)?
-->
## Summary of the Pull Request
Adds support for Vietnamese in QuickAccent
<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist

- [x] **Closes:** #36491
- [x] **Communication:** I've discussed this with core contributors
already. If the work hasn't been agreed, this work might be rejected
- [ ] **Tests:** Added/updated and all pass
- [x] **Localization:** All end-user-facing strings can be localized
- [x] **Dev docs:** no need
- [x] **New binaries:** no need
- [x] **Documentation updated:** no need

<!-- Provide a more detailed description of the PR, other things fixed,
or any additional comments/features here -->
## Detailed Description of the Pull Request / Additional comments
Vietnamese character set based of on
[Wikipedia](https://en.wikipedia.org/wiki/Vietnamese_alphabet)
<!-- Describe how you validated the behavior. Add automated tests
wherever possible, but list manual validation steps taken as well -->
## Validation Steps Performed
Manually tested
This commit is contained in:
octastylos-pseudodipteros
2025-07-11 18:08:42 +02:00
committed by GitHub
parent e041556395
commit 22f565ca49
3 changed files with 23 additions and 0 deletions

View File

@@ -51,6 +51,7 @@ namespace PowerAccent.Core
SR_CYRL,
SV,
TK,
VI,
}
internal sealed class Languages
@@ -113,6 +114,7 @@ namespace PowerAccent.Core
Language.SR_CYRL => GetDefaultLetterKeySRCyrillic(letter), // Serbian Cyrillic
Language.SV => GetDefaultLetterKeySV(letter), // Swedish
Language.TK => GetDefaultLetterKeyTK(letter), // Turkish
Language.VI => GetDefaultLetterKeyVI(letter), // Vietnamese
_ => throw new ArgumentException("The language {0} is not known in this context", lang.ToString()),
});
}
@@ -168,6 +170,7 @@ namespace PowerAccent.Core
.Union(GetDefaultLetterKeySRCyrillic(letter))
.Union(GetDefaultLetterKeySV(letter))
.Union(GetDefaultLetterKeyTK(letter))
.Union(GetDefaultLetterKeyVI(letter))
.Union(GetDefaultLetterKeySPECIAL(letter))
.ToArray();
@@ -890,6 +893,22 @@ namespace PowerAccent.Core
};
}
// Vietnamese
private static string[] GetDefaultLetterKeyVI(LetterKey letter)
{
return letter switch
{
LetterKey.VK_A => new[] { "à", "ả", "ã", "á", "ạ", "ă", "ằ", "ẳ", "ẵ", "ắ", "ặ", "â", "ầ", "ẩ", "ẫ", "ấ", "ậ" },
LetterKey.VK_D => new[] { "đ" },
LetterKey.VK_E => new[] { "è", "ẻ", "ẽ", "é", "ẹ", "ê", "ề", "ể", "ễ", "ế", "ệ" },
LetterKey.VK_I => new[] { "ì", "ỉ", "ĩ", "í", "ị" },
LetterKey.VK_O => new[] { "ò", "ỏ", "õ", "ó", "ọ", "ô", "ồ", "ổ", "ỗ", "ố", "ộ", "ơ", "ờ", "ở", "ỡ", "ớ", "ợ" },
LetterKey.VK_U => new[] { "ù", "ủ", "ũ", "ú", "ụ", "ư", "ừ", "ử", "ữ", "ứ", "ự" },
LetterKey.VK_Y => new[] { "ỳ", "ỷ", "ỹ", "ý", "ỵ" },
_ => Array.Empty<string>(),
};
}
// IPA (International Phonetic Alphabet)
private static string[] GetDefaultLetterKeyIPA(LetterKey letter)
{