Repository: microsoft/terminal
File: src/cascadia/TerminalSettingsModel/ActionArgs.cpp (C++)

Code before:
            directionString = RS_(L"DirectionDown");
            break;
        case FocusDirection::Previous:
            directionString = RS_(L"LastUsedPane");
            isTarget = true;
            break;
        case FocusDirection::NextInOrder:
            directionString = RS_(L"NextPaneInOrder");
            isTarget = true;
            break;
        case FocusDirection::PreviousInOrder:
            directionString = RS_(L"PreviousPaneInOrder");
            isTarget = true;
            break;
        case FocusDirection::First:
            directionString = RS_(L"FirstPane");
            isTarget = true;
            break;
        }

        return { directionString, isTarget };
    }

    winrt::hstring MoveFocusArgs::GenerateName() const
    {
        auto [directionString, isTarget] = GetFocusDirectionString(FocusDirection());
        if (isTarget)
        {
            return winrt::hstring{
                fmt::format(std::wstring_view(RS_(L"MoveFocusWithTargetArgCommandKey")),
                            directionString)
            };
        }

        return winrt::hstring{
            fmt::format(std::wstring_view(RS_(L"MoveFocusWithArgCommandKey")),
                        directionString)
        };
    }

    winrt::hstring SwapPaneArgs::GenerateName() const
    {
        auto [directionString, isTarget] = GetFocusDirectionString(Direction());
        if (isTarget)
        {
            return winrt::hstring{
                fmt::format(std::wstring_view(RS_(L"SwapPaneWithTargetArgCommandKey")),
                            directionString)
            };
        }


Review comment (bug):
I really like how much cleverer this code is now. However, this might not work from a localization standpoint 😢 IIRC, localizing strings like this doesn't always work, because there's no guarantee that  the entire string we're going to format in to `MoveFocusWithTargetArgCommandKey` will insert correctly in all languages. (I'm now realizing I'm not sure how to really explain this...)

Like, I don't think it's a guarantee that `translate("Move focus to the ") + translate("last used pane")` == `translate("Move focus to the last used pane")`. 

@DHowett can correct me If I'm wrong on this part 

Code after:
            break;
        case FocusDirection::Previous:
            return RS_(L"MoveFocusToLastUsedPane");
        case FocusDirection::NextInOrder:
            return RS_(L"MoveFocusNextInOrder");
        case FocusDirection::PreviousInOrder:
            return RS_(L"MoveFocusPreviousInOrder");
        case FocusDirection::First:
            return RS_(L"MoveFocusFirstPane");
        }

        return winrt::hstring{
            fmt::format(std::wstring_view(RS_(L"MoveFocusWithArgCommandKey")),
                        directionString)
        };
    }

    winrt::hstring SwapPaneArgs::GenerateName() const
    {
        winrt::hstring directionString;
        switch (Direction())
        {
        case FocusDirection::Left:
            directionString = RS_(L"DirectionLeft");
            break;
        case FocusDirection::Right:
            directionString = RS_(L"DirectionRight");
            break;
        case FocusDirection::Up:
            directionString = RS_(L"DirectionUp");
            break;
        case FocusDirection::Down:
            directionString = RS_(L"DirectionDown");
            break;
        case FocusDirection::Previous:
            return RS_(L"SwapPaneToLastUsedPane");
        case FocusDirection::NextInOrder:
            return RS_(L"SwapPaneNextInOrder");
        case FocusDirection::PreviousInOrder:
            return RS_(L"SwapPanePreviousInOrder");
        case FocusDirection::First:
            return RS_(L"SwapPaneFirstPane");
        }

        return winrt::hstring{
            fmt::format(std::wstring_view(RS_(L"SwapPaneWithArgCommandKey")),
                        directionString)
        };
    }

    winrt::hstring AdjustFontSizeArgs::GenerateName() const