Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,22 @@ This method supports command-line parameters to customize the behaviour of the s
This method supports command-line parameters to customize the behaviour of the script. Please click [here](https://github.com/Raphire/Win11Debloat/wiki/Command%E2%80%90line-Interface#parameters) for more information.
</details>

### Languages

By default the interface is in English. A translated, fully right-to-left (RTL) interface can be enabled per run with the `-Language` parameter:

```PowerShell
.\Win11Debloat.ps1 -Language he
```

To make a language the default without passing the parameter every time, set the `WIN11DEBLOAT_LANG` environment variable (e.g. `he`). When no language is selected the script behaves exactly as before.

Currently available translations:

| Code | Language |
| ---- | -------- |
| `he` | Hebrew (עברית) |

## Features

Below is an overview of the key features and functionality offered by Win11Debloat. Please refer to [the wiki](https://github.com/Raphire/Win11Debloat/wiki/Default-Settings) for more information about the default settings preset.
Expand Down
30 changes: 16 additions & 14 deletions Scripts/GUI/MainWindow-AppSelection.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ function Update-AppSelectionStatus {
$selectedCount++
}
}
$AppSelectionStatus.Text = "$selectedCount app(s) selected for removal"
$AppSelectionStatus.Text = (Format-Localized '{0} app(s) selected for removal' @($selectedCount))

if ($AppRemovalScopeCombo -and $AppRemovalScopeSection -and $AppRemovalScopeDescription) {
if ($selectedCount -gt 0) {
Expand All @@ -182,15 +182,16 @@ function Update-AppRemovalScopeDescription {

$selectedItem = $AppRemovalScopeCombo.SelectedItem
if ($selectedItem) {
switch ($selectedItem.Content) {
"All users" {
$AppRemovalScopeDescription.Text = "Apps will be removed for all users and from the Windows image to prevent reinstallation for new users."
# Compare on SelectedIndex (stable order) instead of the localized text.
switch ($AppRemovalScopeCombo.SelectedIndex) {
0 {
$AppRemovalScopeDescription.Text = Get-LocalizedString "Apps will be removed for all users and from the Windows image to prevent reinstallation for new users."
}
"Current user only" {
$AppRemovalScopeDescription.Text = "Apps will only be removed for the current user."
1 {
$AppRemovalScopeDescription.Text = Get-LocalizedString "Apps will only be removed for the current user."
}
"Target user only" {
$AppRemovalScopeDescription.Text = "Apps will only be removed for the specified target user."
2 {
$AppRemovalScopeDescription.Text = Get-LocalizedString "Apps will only be removed for the specified target user."
}
}
}
Expand Down Expand Up @@ -379,9 +380,9 @@ function Load-AppsWithList {
$dot.Style = $Window.Resources['AppRecommendationDotStyle']
$dot.Fill = switch ($app.Recommendation) { 'safe' { $brushSafe } 'unsafe' { $brushUnsafe } default { $brushDefault } }
$dot.ToolTip = switch ($app.Recommendation) {
'safe' { '[Recommended] Safe to remove for most users' }
'unsafe' { '[Not Recommended] Only remove if you know what you are doing' }
default { "[Optional] Remove if you don't need this app" }
'safe' { Get-LocalizedString '[Recommended] Safe to remove for most users' }
'unsafe' { Get-LocalizedString '[Not Recommended] Only remove if you know what you are doing' }
default { Get-LocalizedString "[Optional] Remove if you don't need this app" }
}
[System.Windows.Controls.Grid]::SetColumn($dot, 0)

Expand All @@ -391,9 +392,10 @@ function Load-AppsWithList {
[System.Windows.Controls.Grid]::SetColumn($tbName, 1)

$tbDesc = New-Object System.Windows.Controls.TextBlock
$tbDesc.Text = $app.Description
$localizedDescription = Get-LocalizedString $app.Description
$tbDesc.Text = $localizedDescription
$tbDesc.Style = $Window.Resources['AppDescTextStyle']
$tbDesc.ToolTip = $app.Description
$tbDesc.ToolTip = $localizedDescription
[System.Windows.Controls.Grid]::SetColumn($tbDesc, 2)

$tbId = New-Object System.Windows.Controls.TextBlock
Expand All @@ -409,7 +411,7 @@ function Load-AppsWithList {
$checkbox.Content = $row

Add-Member -InputObject $checkbox -MemberType NoteProperty -Name 'AppName' -Value $app.FriendlyName
Add-Member -InputObject $checkbox -MemberType NoteProperty -Name 'AppDescription' -Value $app.Description
Add-Member -InputObject $checkbox -MemberType NoteProperty -Name 'AppDescription' -Value $localizedDescription
Add-Member -InputObject $checkbox -MemberType NoteProperty -Name 'SelectedByDefault' -Value $app.SelectedByDefault
Add-Member -InputObject $checkbox -MemberType NoteProperty -Name 'AppIds' -Value @($app.AppId)
Add-Member -InputObject $checkbox -MemberType NoteProperty -Name 'AppIdDisplay' -Value $app.AppIdDisplay
Expand Down
14 changes: 7 additions & 7 deletions Scripts/GUI/MainWindow-Deployment.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,12 @@ function New-Overview {
}
}
if ($selectedAppsCount -gt 0) {
$changesList += "Remove $selectedAppsCount application(s)"
$changesList += (Format-Localized 'Remove {0} application(s)' @($selectedAppsCount))
}

foreach ($tweakAction in @(Get-PendingTweakActions -Window $Window -ShowAppliedTweaksMode:$showAppliedTweaksMode)) {
if ($tweakAction.Action -eq 'Undo') {
$changesList += "Undo: $($tweakAction.Label)"
$changesList += (Format-Localized 'Undo: {0}' @($tweakAction.Label))
}
else {
$changesList += $tweakAction.Label
Expand Down Expand Up @@ -438,23 +438,23 @@ function Update-UserSelectionDescription {
0 {
$currentUserName = GetUserName
if ([string]::IsNullOrWhiteSpace($currentUserName)) {
$UserSelectionDescription.Text = "The currently logged-in user profile"
$UserSelectionDescription.Text = Get-LocalizedString "The currently logged-in user profile"
}
else {
$UserSelectionDescription.Text = "The currently logged-in user profile: $currentUserName"
$UserSelectionDescription.Text = (Format-Localized 'The currently logged-in user profile: {0}' @($currentUserName))
}
}
1 {
$targetUserName = $OtherUsernameTextBox.Text.Trim()
if ([string]::IsNullOrWhiteSpace($targetUserName)) {
$UserSelectionDescription.Text = "A different user profile on this system"
$UserSelectionDescription.Text = Get-LocalizedString "A different user profile on this system"
}
else {
$UserSelectionDescription.Text = "A different user profile on this system: $targetUserName"
$UserSelectionDescription.Text = (Format-Localized 'A different user profile on this system: {0}' @($targetUserName))
}
}
default {
$UserSelectionDescription.Text = "The default user template, affecting all new users created after this point. Useful for Sysprep deployment."
$UserSelectionDescription.Text = Get-LocalizedString "The default user template, affecting all new users created after this point. Useful for Sysprep deployment."
}
}
}
Expand Down
12 changes: 8 additions & 4 deletions Scripts/GUI/MainWindow-TweaksBuilder.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ function Build-DynamicTweaks {
throw "Unable to load Features.json file. The GUI cannot continue without feature definitions."
}

# Translate the display fields (labels, tooltips, value labels) to Hebrew.
# Category names are left as-is; they are localized only where displayed.
$featuresJson = Localize-FeaturesData $featuresJson

# Column containers
$col0 = $Window.FindName('Column0Panel')
$col1 = $Window.FindName('Column1Panel')
Expand Down Expand Up @@ -138,7 +142,7 @@ function Build-DynamicTweaks {
$headerRow.Children.Add($icon) | Out-Null

$header = New-Object System.Windows.Controls.TextBlock
$header.Text = $categoryName
$header.Text = Get-LocalizedString $categoryName
$header.Style = $Window.Resources['CategoryHeaderTextBlock']
$headerRow.Children.Add($header) | Out-Null

Expand All @@ -148,7 +152,7 @@ function Build-DynamicTweaks {

$helpBtn = New-Object System.Windows.Controls.Button
$helpBtn.Content = $helpIcon
$helpBtn.ToolTip = "Open wiki for more info on '$categoryName' tweaks"
$helpBtn.ToolTip = (Format-Localized "Open wiki for more info on '{0}' tweaks" @((Get-LocalizedString $categoryName)))
$helpBtn.Tag = (GetWikiUrlForCategory -category $categoryName)
$helpBtn.Style = $Window.Resources['CategoryHelpLinkButtonStyle']
$helpBtn.Add_Click({
Expand Down Expand Up @@ -250,7 +254,7 @@ function Build-DynamicTweaks {
foreach ($item in $sortedItems) {
if ($item.Type -eq 'group') {
$group = $item.Data
$items = @('No Change') + ($group.Values | ForEach-Object { $_.Label })
$items = @((Get-LocalizedString 'No Change')) + ($group.Values | ForEach-Object { $_.Label })
$comboName = 'Group_{0}Combo' -f $group.GroupId
$combo = CreateLabeledCombo -parent $panel -labelText $group.Label -comboName $comboName -items $items
# attach tooltip from UiGroups if present
Expand All @@ -277,7 +281,7 @@ function Build-DynamicTweaks {
if ($feature.ToolTip -or $feature.DisableWhenApplied -eq $true) {
$tooltipText = $feature.ToolTip
if ($feature.DisableWhenApplied -eq $true) {
$tooltipText = "This tweak is already applied and cannot be undone automatically. Visit the Win11Debloat wiki for instructions on how to manually revert this change."
$tooltipText = Get-LocalizedString "This tweak is already applied and cannot be undone automatically. Visit the Win11Debloat wiki for instructions on how to manually revert this change."
}

$tipBlock = New-Object System.Windows.Controls.TextBlock
Expand Down
2 changes: 1 addition & 1 deletion Scripts/GUI/RestoreBackupDialogFeatureLists.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function Get-RestoreDialogFeatureDisplayLabel {
)

if ([string]::IsNullOrWhiteSpace($FeatureId)) {
return 'Unknown feature'
return Get-LocalizedString 'Unknown feature'
}

$featureDefinition = Get-RestoreDialogFeatureDefinition -FeatureId $FeatureId -Features $Features
Expand Down
5 changes: 4 additions & 1 deletion Scripts/GUI/Show-AboutDialog.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ function Show-AboutDialog {

# Apply theme resources
SetWindowThemeResources -window $aboutWindow -usesDarkMode $usesDarkMode


# Translate to Hebrew + right-to-left
Invoke-WindowLocalization -Window $aboutWindow

# Get UI elements
$titleBar = $aboutWindow.FindName('TitleBar')
$versionText = $aboutWindow.FindName('VersionText')
Expand Down
5 changes: 4 additions & 1 deletion Scripts/GUI/Show-AppSelectionWindow.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ function Show-AppSelectionWindow {

SetWindowThemeResources -window $window -usesDarkMode $usesDarkMode

# Translate to Hebrew + right-to-left
Invoke-WindowLocalization -Window $window

$appsPanel = $window.FindName('AppsPanel')
$checkAllBox = $window.FindName('CheckAllBox')
$onlyInstalledBox = $window.FindName('OnlyInstalledBox')
Expand Down Expand Up @@ -78,7 +81,7 @@ function Show-AppSelectionWindow {
$checkbox.Tag = $_.AppIdDisplay
Add-Member -InputObject $checkbox -MemberType NoteProperty -Name 'AppIds' -Value @($_.AppId)
$checkbox.IsChecked = $_.IsChecked
$checkbox.ToolTip = $_.Description
$checkbox.ToolTip = Get-LocalizedString $_.Description
$checkbox.Style = $window.Resources["AppsPanelCheckBoxStyle"]

# Attach shift-click behavior for range selection
Expand Down
33 changes: 18 additions & 15 deletions Scripts/GUI/Show-ApplyModal.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ function Show-ApplyModal {

# Apply theme resources
SetWindowThemeResources -window $applyWindow -usesDarkMode $usesDarkMode


# Translate to Hebrew + right-to-left
Invoke-WindowLocalization -Window $applyWindow

# Get UI elements
$script:ApplyInProgressPanel = $applyWindow.FindName('ApplyInProgressPanel')
$script:ApplyCompletionPanel = $applyWindow.FindName('ApplyCompletionPanel')
Expand All @@ -84,16 +87,16 @@ function Show-ApplyModal {
# Initialize in-progress state
$script:ApplyInProgressPanel.Visibility = 'Visible'
$script:ApplyCompletionPanel.Visibility = 'Collapsed'
$script:ApplyStepNameEl.Text = "Preparing..."
$script:ApplyStepCounterEl.Text = "Preparing..."
$script:ApplyStepNameEl.Text = Get-LocalizedString "Preparing..."
$script:ApplyStepCounterEl.Text = Get-LocalizedString "Preparing..."
$script:ApplyProgressBarEl.Value = 0
$script:ApplyModalInErrorState = $false

# Set up progress callback for ExecuteAllChanges
$script:ApplyProgressCallback = {
param($currentStep, $totalSteps, $stepName)
$script:ApplyStepNameEl.Text = $stepName
$script:ApplyStepCounterEl.Text = "Step $currentStep of $totalSteps"
$script:ApplyStepNameEl.Text = Get-LocalizedString $stepName
$script:ApplyStepCounterEl.Text = (Format-Localized 'Step {0} of {1}' @($currentStep, $totalSteps))
# Store current step/total in Tag properties for sub-step interpolation
$script:ApplyStepCounterEl.Tag = $currentStep
$script:ApplyProgressBarEl.Tag = $totalSteps
Expand All @@ -107,7 +110,7 @@ function Show-ApplyModal {
# Sub-step callback updates step name and interpolates progress bar within the current step
$script:ApplySubStepCallback = {
param($subStepName, $subIndex, $subCount)
$script:ApplyStepNameEl.Text = $subStepName
$script:ApplyStepNameEl.Text = Get-LocalizedString $subStepName
# Interpolate progress bar between previous step and current step
$currentStep = [int]($script:ApplyStepCounterEl.Tag)
$totalSteps = [int]($script:ApplyProgressBarEl.Tag)
Expand Down Expand Up @@ -153,15 +156,15 @@ function Show-ApplyModal {
if ($script:CancelRequested) {
$script:ApplyCompletionIconEl.Text = [char]0xE7BA
$script:ApplyCompletionIconEl.Foreground = [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#e8912d"))
$script:ApplyCompletionTitleEl.Text = "Cancelled"
$script:ApplyCompletionMessageEl.Text = "Script execution was cancelled by the user."
$script:ApplyCompletionTitleEl.Text = Get-LocalizedString "Cancelled"
$script:ApplyCompletionMessageEl.Text = Get-LocalizedString "Script execution was cancelled by the user."
} elseif ($registryImportFailureCount -gt 0) {
$script:ApplyCompletionIconEl.Text = [char]0xE7BA
$script:ApplyCompletionIconEl.Foreground = [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#e8912d"))
$script:ApplyCompletionTitleEl.Text = "Changes Applied with Errors"
$script:ApplyCompletionMessageEl.Text = "$registryImportFailureCount registry change(s) failed. See console for details."
$script:ApplyCompletionTitleEl.Text = Get-LocalizedString "Changes Applied with Errors"
$script:ApplyCompletionMessageEl.Text = (Format-Localized '{0} registry change(s) failed. See console for details.' @($registryImportFailureCount))
} else {
$script:ApplyCompletionTitleEl.Text = "Changes Applied"
$script:ApplyCompletionTitleEl.Text = Get-LocalizedString "Changes Applied"

# Show completion message with reboot instructions if any applied features require reboot
if ($RestartExplorer) {
Expand All @@ -186,7 +189,7 @@ function Show-ApplyModal {
$applyRebootPanel.Visibility = 'Visible'
}
else {
$script:ApplyCompletionMessageEl.Text = "Your system is ready. Thanks for using Win11Debloat!"
$script:ApplyCompletionMessageEl.Text = Get-LocalizedString "Your system is ready. Thanks for using Win11Debloat!"
}
}
}
Expand All @@ -198,8 +201,8 @@ function Show-ApplyModal {
$script:ApplyCompletionPanel.Visibility = 'Visible'
$script:ApplyCompletionIconEl.Text = [char]0xEA39
$script:ApplyCompletionIconEl.Foreground = [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#c42b1c"))
$script:ApplyCompletionTitleEl.Text = "Error"
$script:ApplyCompletionMessageEl.Text = "An error occurred while applying changes: $($_.Exception.Message)"
$script:ApplyCompletionTitleEl.Text = Get-LocalizedString "Error"
$script:ApplyCompletionMessageEl.Text = (Format-Localized 'An error occurred while applying changes: {0}' @($_.Exception.Message))

# Set error state to change Kofi button to report link
$script:ApplyModalInErrorState = $true
Expand All @@ -208,7 +211,7 @@ function Show-ApplyModal {
$applyKofiBtn.Content = $null

$reportText = [System.Windows.Controls.TextBlock]::new()
$reportText.Text = 'Report a bug'
$reportText.Text = Get-LocalizedString 'Report a bug'
$reportText.VerticalAlignment = 'Center'
$reportText.FontSize = 14
$reportText.Margin = [System.Windows.Thickness]::new(0, 0, 0, 1)
Expand Down
4 changes: 3 additions & 1 deletion Scripts/GUI/Show-Bubble.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,11 @@ function Show-Bubble {
$reader.Close()
}

try { $bubblePanel.FlowDirection = [System.Windows.FlowDirection]::RightToLeft } catch { }

$bubbleText = $bubblePanel.FindName('BubbleText')
if ($bubbleText) {
$bubbleText.Text = $Message
$bubbleText.Text = Get-LocalizedString $Message
}

$bubblePanel.BeginAnimation([System.Windows.UIElement]::OpacityProperty, $null)
Expand Down
Loading