Skip to content

Commit

Permalink
resources to localize
Browse files Browse the repository at this point in the history
  • Loading branch information
zadjii-msft committed May 3, 2024
1 parent 43d46db commit 7b8b60b
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 13 deletions.
11 changes: 11 additions & 0 deletions src/cascadia/TerminalApp/Resources/en-US/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -898,4 +898,15 @@
<data name="RestartConnectionToolTip" xml:space="preserve">
<value>Restart the active pane connection</value>
</data>
<data name="SnippetPaneTitle.Text" xml:space="preserve">
<value>Snippets</value>
<comment>Header for a page that includes small snippets of text for the user to enter</comment>
</data>
<data name="SnippetsFilterBox.PlaceholderText" xml:space="preserve">
<value>Filter snippets...</value>
<comment>Placeholder text for a text box to filter snippets (on the same page as the 'SnippetPaneTitle')</comment>
</data>
<data name="SnippetPlayButton.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
<value>Input this command</value>
</data>
</root>
4 changes: 2 additions & 2 deletions src/cascadia/TerminalApp/TasksPaneContent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ namespace winrt::TerminalApp::implementation
{
InitializeComponent();

auto res = Windows::UI::Xaml::Application::Current().Resources();
auto bg = res.Lookup(winrt::box_value(L"UnfocusedBorderBrush"));
// auto res = Windows::UI::Xaml::Application::Current().Resources();
auto bg = Resources().Lookup(winrt::box_value(L"PageBackground"));
Background(bg.try_as<WUX::Media::Brush>());
}

Expand Down
4 changes: 2 additions & 2 deletions src/cascadia/TerminalApp/TasksPaneContent.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "FilteredTask.g.h"
#include "FilteredCommand.h"
#include "ActionPaletteItem.h"
#include <LibraryResources.h>

namespace winrt::TerminalApp::implementation
{
Expand All @@ -23,7 +24,7 @@ namespace winrt::TerminalApp::implementation
winrt::Microsoft::Terminal::Settings::Model::INewContentArgs GetNewTerminalArgs(BuildStartupKind kind) const;

// TODO! lots of strings here and in XAML that need RS_-ifying
winrt::hstring Title() { return L"Tasks"; }
winrt::hstring Title() { return RS_(L"SnippetPaneTitle/Text"); }
uint64_t TaskbarState() { return 0; }
uint64_t TaskbarProgress() { return 0; }
bool ReadOnly() { return false; }
Expand All @@ -49,7 +50,6 @@ namespace winrt::TerminalApp::implementation

winrt::weak_ref<Microsoft::Terminal::Control::TermControl> _control{ nullptr };
winrt::Microsoft::Terminal::Settings::Model::CascadiaSettings _settings{ nullptr };

winrt::Windows::Foundation::Collections::IObservableVector<TerminalApp::FilteredTask> _allTasks{ nullptr };

void _runCommandButtonClicked(const Windows::Foundation::IInspectable& sender, const Windows::UI::Xaml::RoutedEventArgs&);
Expand Down
35 changes: 26 additions & 9 deletions src/cascadia/TerminalApp/TasksPaneContent.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@
Visibility="Collapsed" />
</ContentPresenter>

<Button Grid.Row="0"
<Button x:Uid="SnippetPlayButton"
Grid.Row="0"
Grid.RowSpan="1"
Grid.Column="0"
Padding="3"
VerticalAlignment="Bottom"
Background="Transparent"
BorderBrush="Transparent"
Click="_runCommandButtonClicked"
ToolTipService.ToolTip="Input this command">
Click="_runCommandButtonClicked">

<Button.Content>
<FontIcon FontFamily="Segoe Fluent Icons, Segoe MDL2 Assets"
Expand Down Expand Up @@ -111,26 +111,43 @@
</Grid>
</mux:TreeViewItem>
</DataTemplate>

<ResourceDictionary.ThemeDictionaries>
<!-- same as in MainPage, this is SolidBackgroundFillColorTertiary -->
<ResourceDictionary x:Key="Dark">
<Color x:Key="PageBackground">#282828</Color>
</ResourceDictionary>
<ResourceDictionary x:Key="Light">
<Color x:Key="PageBackground">#F9F9F9</Color>
</ResourceDictionary>
<ResourceDictionary x:Key="HighContrast">
<!-- Define resources for HighContrast mode here -->
<StaticResource x:Key="PageBackground"
ResourceKey="SystemColorWindowColorBrush" />
</ResourceDictionary>

</ResourceDictionary.ThemeDictionaries>

</ResourceDictionary>
</UserControl.Resources>

<Grid>
<Grid Background="{ThemeResource PageBackground}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>

<TextBlock x:Name="_title"
x:Uid="SnippetPaneTitle"
Grid.Row="0"
Margin="9"
FontSize="24"
Text="Tasks" />
Margin="4"
FontSize="24" />

<TextBox x:Name="_filterBox"
x:Uid="SnippetsFilterBox"
Grid.Row="1"
Margin="8"
PlaceholderText="Filter tasks..."
Margin="8,0,8,8"
TextChanged="_filterTextChanged" />

<mux:TreeView x:Name="_treeView"
Expand Down

1 comment on commit 7b8b60b

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@check-spelling-bot Report

🔴 Please review

See the 📜action log or 📝 job summary for details.

Unrecognized words (5)

actiopn
ifying
sxnui
taskpane
tbh

Previously acknowledged words that are now absent CRLFs Redir wcsicmp 🫥
To accept these unrecognized words as correct and remove the previously acknowledged and now absent words, you could run the following commands

... in a clone of the git@github.com:microsoft/terminal.git repository
on the dev/migrie/f/snippets-pane branch (ℹ️ how do I use this?):

curl -s -S -L 'https://raw.githubusercontent.com/check-spelling/check-spelling/v0.0.22/apply.pl' |
perl - 'https://github.com/microsoft/terminal/actions/runs/8944091332/attempts/1'
Available 📚 dictionaries could cover words (expected and unrecognized) not in the 📘 dictionary

This includes both expected items (2207) from .github/actions/spelling/expect/04cdb9b77d6827c0202f51acd4205b017015bfff.txt
.github/actions/spelling/expect/alphabet.txt
.github/actions/spelling/expect/expect.txt
.github/actions/spelling/expect/web.txt and unrecognized words (5)

Dictionary Entries Covers Uniquely
cspell:cpp/src/lang-jargon.txt 11 1 1
cspell:swift/src/swift.txt 53 1 1
cspell:gaming-terms/dict/gaming-terms.txt 59 1 1
cspell:monkeyc/src/monkeyc_keywords.txt 123 1 1
cspell:cryptocurrencies/cryptocurrencies.txt 125 1 1

Consider adding them (in .github/workflows/spelling2.yml) for uses: check-spelling/check-spelling@v0.0.22 in its with:

      with:
        extra_dictionaries:
          cspell:cpp/src/lang-jargon.txt
          cspell:swift/src/swift.txt
          cspell:gaming-terms/dict/gaming-terms.txt
          cspell:monkeyc/src/monkeyc_keywords.txt
          cspell:cryptocurrencies/cryptocurrencies.txt

To stop checking additional dictionaries, add (in .github/workflows/spelling2.yml) for uses: check-spelling/check-spelling@v0.0.22 in its with:

check_extra_dictionaries: ''
Errors (1)

See the 📜action log or 📝 job summary for details.

❌ Errors Count
❌ ignored-expect-variant 3

See ❌ Event descriptions for more information.

✏️ Contributor please read this

By default the command suggestion will generate a file named based on your commit. That's generally ok as long as you add the file to your commit. Someone can reorganize it later.

If the listed items are:

  • ... misspelled, then please correct them instead of using the command.
  • ... names, please add them to .github/actions/spelling/allow/names.txt.
  • ... APIs, you can add them to a file in .github/actions/spelling/allow/.
  • ... just things you're using, please add them to an appropriate file in .github/actions/spelling/expect/.
  • ... tokens you only need in one place and shouldn't generally be used, you can add an item in an appropriate file in .github/actions/spelling/patterns/.

See the README.md in each directory for more information.

🔬 You can test your commits without appending to a PR by creating a new branch with that extra change and pushing it to your fork. The check-spelling action will run in response to your push -- it doesn't require an open pull request. By using such a branch, you can limit the number of typos your peers see you make. 😉

If the flagged items are 🤯 false positives

If items relate to a ...

  • binary file (or some other file you wouldn't want to check at all).

    Please add a file path to the excludes.txt file matching the containing file.

    File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.

    ^ refers to the file's path from the root of the repository, so ^README\.md$ would exclude README.md (on whichever branch you're using).

  • well-formed pattern.

    If you can write a pattern that would match it,
    try adding it to the patterns.txt file.

    Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines.

    Note that patterns can't match multiline strings.

Please sign in to comment.