Skip to content

Commit

Permalink
app: Fix no templates error not localized
Browse files Browse the repository at this point in the history
  • Loading branch information
roxk committed Apr 18, 2024
1 parent 36e1983 commit 1a8c499
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
5 changes: 3 additions & 2 deletions WinUI3XamlPreview/WinUI3XamlPreview/MainPage.xaml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ namespace winrt::WinUI3XamlPreview::implementation
auto& elements = multipleElement->elements;
if (elements.empty())
{
toast().ShowError(L"Nothing to show",
L"ResourceDictionary doesn't contain any control template");
mwamr::ResourceLoader res(mwamr::ResourceLoader::GetDefaultResourceFilePath(), L"WinUI3XamlPreview/Resources");
toast().ShowError(res.GetString(L"XamlLoadedNothingError"),
res.GetString(L"ResourceDictionaryNoControlTemplates"));
return;
}
UpdateCustomControlItems(std::move(elements));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@
<data name="FileNotFoundTitle" xml:space="preserve">
<value>File Not Found</value>
</data>
<data name="ResourceDictionaryNoControlTemplates" xml:space="preserve">
<value>ResourceDictionary doesn't contain any control template</value>
</data>
<data name="ThemeDisplay_Dark" xml:space="preserve">
<value>Dark</value>
</data>
Expand All @@ -132,6 +135,9 @@
<data name="ThemeDisplay_System" xml:space="preserve">
<value>System Theme</value>
</data>
<data name="XamlLoadedNothingError" xml:space="preserve">
<value>Loaded But Nothing to Show</value>
</data>
<data name="XamlLoadErrorMessage" xml:space="preserve">
<value>Cannot load XAML. If you added new user/custom control, build the project first. If your app is packaged, deploy it first.</value>
</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@
<data name="FileNotFoundTitle" xml:space="preserve">
<value>找不到檔案</value>
</data>
<data name="ResourceDictionaryNoControlTemplates" xml:space="preserve">
<value>ResourceDictionary 沒有任何 control template</value>
</data>
<data name="ThemeDisplay_Dark" xml:space="preserve">
<value>深色</value>
</data>
Expand All @@ -132,6 +135,9 @@
<data name="ThemeDisplay_System" xml:space="preserve">
<value>系統主題</value>
</data>
<data name="XamlLoadedNothingError" xml:space="preserve">
<value>已讀取但沒有東西可顯示</value>
</data>
<data name="XamlLoadErrorMessage" xml:space="preserve">
<value>無法讀取 XAML。如果你新增了 User/Custom Control,請先構建專案。如果你的應用是已包裝的,請先安裝。</value>
</data>
Expand Down

0 comments on commit 1a8c499

Please sign in to comment.