Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xWebAppPoolDefaults: Move localization strings to strings.psd1 file #519

Merged
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Unreleased

- Changes to xWebAppPoolDefaults
- Move localization strings to strings.psd1 file ([Issue #470](https://github.com/PowerShell/xWebAdministration/issues/470))
- Changes to xWebAdministration
- Resolved custom Script Analyzer rules that was added to the test framework.
- Moved change log from README.md to a separate CHANGELOG.md ([issue #446](https://github.com/PowerShell/xWebAdministration/issues/446)).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,8 @@ $script:localizationModulePath = Join-Path -Path $script:modulesFolderPath -Chil

Import-Module -Name (Join-Path -Path $script:localizationModulePath -ChildPath 'xWebAdministration.Common.psm1')

# Localized messages
data LocalizedData
{
# culture="en-US"
ConvertFrom-StringData -StringData @'
NoWebAdministrationModule = Please ensure that WebAdministration module is installed.
SettingValue = Changing default value '{0}' to '{1}'
ValueOk = Default value '{0}' is already '{1}'
VerboseGetTargetResource = Get-TargetResource has been run.
'@
}
# Import Localization Strings
$script:localizedData = Get-LocalizedData -ResourceName 'MSFT_xWebAppPoolDefaults'

function Get-TargetResource
{
Expand All @@ -35,7 +26,7 @@ function Get-TargetResource

Assert-Module

Write-Verbose -Message $LocalizedData.VerboseGetTargetResource
Write-Verbose -Message $script:localizedData.VerboseGetTargetResource

return @{
ManagedRuntimeVersion = (Get-Value -Path '' -Name 'managedRuntimeVersion')
Expand Down Expand Up @@ -160,7 +151,7 @@ function Confirm-Value
else
{
$relPath = $Path + '/' + $Name
Write-Verbose($LocalizedData.ValueOk -f $relPath,$NewValue);
Write-Verbose($script:localizedData.ValueOk -f $relPath,$NewValue);
return $true
}
}
Expand Down Expand Up @@ -205,7 +196,7 @@ function Set-Value
-Value "$NewValue"

$relPath = $Path + '/' + $Name
Write-Verbose($LocalizedData.SettingValue -f $relPath,$NewValue);
Write-Verbose($script:localizedData.SettingValue -f $relPath,$NewValue);
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# culture="en-US"
ConvertFrom-StringData -StringData @'
NoWebAdministrationModule = Please ensure that WebAdministration module is installed.
SettingValue = Changing default value '{0}' to '{1}'
ValueOk = Default value '{0}' is already '{1}'
VerboseGetTargetResource = Get-TargetResource has been run.
'@