Skip to content

Commit

Permalink
feat: 添加未完成的翻译
Browse files Browse the repository at this point in the history
即使未完成也可以供用户选择
  • Loading branch information
Blinue committed Oct 9, 2023
1 parent 0fda637 commit b80dd59
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 4 deletions.
4 changes: 4 additions & 0 deletions src/Magpie.App/LocalizationService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@ namespace winrt::Magpie::App {

// 标签必须为小写
static std::array SUPPORTED_LANGUAGES{
L"de",
L"en-us",
L"es",
L"fr",
L"hu",
L"id",
L"it",
L"ja",
L"ko",
Expand Down
4 changes: 4 additions & 0 deletions src/Magpie.App/Magpie.App.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -573,8 +573,12 @@
<SDKReference Include="WindowsDesktop, Version=10.0.22621.0" />
</ItemGroup>
<ItemGroup>
<PRIResource Include="Resources.language-de.resw" />
<PRIResource Include="Resources.language-en-US.resw" />
<PRIResource Include="Resources.language-es.resw" />
<PRIResource Include="Resources.language-fr.resw" />
<PRIResource Include="Resources.language-hu.resw" />
<PRIResource Include="Resources.language-id.resw" />
<PRIResource Include="Resources.language-it.resw" />
<PRIResource Include="Resources.language-ja.resw" />
<PRIResource Include="Resources.language-ko.resw" />
Expand Down
12 changes: 12 additions & 0 deletions src/Magpie.App/Magpie.App.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,18 @@
<PRIResource Include="Resources.language-it.resw">
<Filter>Strings</Filter>
</PRIResource>
<PRIResource Include="Resources.language-de.resw">
<Filter>Strings</Filter>
</PRIResource>
<PRIResource Include="Resources.language-fr.resw">
<Filter>Strings</Filter>
</PRIResource>
<PRIResource Include="Resources.language-hu.resw">
<Filter>Strings</Filter>
</PRIResource>
<PRIResource Include="Resources.language-id.resw">
<Filter>Strings</Filter>
</PRIResource>
</ItemGroup>
<ItemGroup>
<Text Include="conanfile.txt" />
Expand Down
4 changes: 2 additions & 2 deletions src/Magpie.Core/ImGuiHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ struct ImGuiHelper {
static constexpr ImWchar NOT_NUMBER_RANGES[] = { 0x20, L'0' - 1, L'9' + 1, 0x7E, 0 };
// Basic Latin
static constexpr ImWchar ENGLISH_RANGES[] = { 0x20, 0x7E, 0 };
// Basic Latin + Latin-1 Supplement + Latin Extended-A
// Basic Latin + Latin-1 Supplement + Latin Extended-A,用于土耳其语、匈牙利语等
// 参见 https://en.wikipedia.org/wiki/Latin_Extended-A
static constexpr ImWchar TURKISH_RANGES[] = { 0x20, 0x17F, 0 };
static constexpr ImWchar Latin_1_Extended_A_RANGES[] = { 0x20, 0x17F, 0 };
};

}
4 changes: 2 additions & 2 deletions src/Magpie.Core/OverlayDrawer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -355,8 +355,8 @@ void OverlayDrawer::_BuildFontUI(std::wstring_view language, const std::vector<u
builder.AddRanges(ImGuiHelper::ENGLISH_RANGES);
} else if (language == L"ru" || language == L"uk") {
builder.AddRanges(fontAtlas.GetGlyphRangesCyrillic());
} else if (language == L"tr") {
builder.AddRanges(ImGuiHelper::TURKISH_RANGES);
} else if (language == L"tr" || language == L"hu") {
builder.AddRanges(ImGuiHelper::Latin_1_Extended_A_RANGES);
} else {
// 默认 Basic Latin + Latin-1 Supplement
// 参见 https://en.wikipedia.org/wiki/Latin-1_Supplement
Expand Down

0 comments on commit b80dd59

Please sign in to comment.