From 9690226ae7e07e026d5cf84add4714fef3abce22 Mon Sep 17 00:00:00 2001 From: Jonathan Colon Date: Tue, 30 Jan 2024 14:57:46 -0400 Subject: [PATCH] Initial Support for UICulture --- AsBuiltReport.Veeam.VBR.psm1 | 15 +++++++++++++++ .../en-US/AsBuiltReport.Veeam.VBR.Resources.psd1 | 7 +++++++ .../es-ES/AsBuiltReport.Veeam.VBR.Resources.psd1 | 5 +++++ 3 files changed, 27 insertions(+) create mode 100644 Language/en-US/AsBuiltReport.Veeam.VBR.Resources.psd1 create mode 100644 Language/es-ES/AsBuiltReport.Veeam.VBR.Resources.psd1 diff --git a/AsBuiltReport.Veeam.VBR.psm1 b/AsBuiltReport.Veeam.VBR.psm1 index e22b0dc..655d9ef 100644 --- a/AsBuiltReport.Veeam.VBR.psm1 +++ b/AsBuiltReport.Veeam.VBR.psm1 @@ -1,3 +1,18 @@ +## Import localisation strings based on UICulture +$importLocalizedDataParams = @{ + BindingVariable = 'localized' + BaseDirectory = ($PSScriptRoot + '\Language') + FileName = 'AsBuiltReport.Veeam.VBR.Resources.psd1' +} +Import-LocalizedData @importLocalizedDataParams -ErrorAction SilentlyContinue + +#Fallback to en-US culture strings +if (-not (Test-Path -Path 'Variable:\localized')) +{ + $importLocalizedDataParams['UICulture'] = 'en-US' + Import-LocalizedData @importLocalizedDataParams -ErrorAction Stop +} + # Get public and private function definition files and dot source them $Public = @(Get-ChildItem -Path $PSScriptRoot\Src\Public\*.ps1 -ErrorAction SilentlyContinue) $Private = @(Get-ChildItem -Path $PSScriptRoot\Src\Private\*.ps1 -ErrorAction SilentlyContinue) diff --git a/Language/en-US/AsBuiltReport.Veeam.VBR.Resources.psd1 b/Language/en-US/AsBuiltReport.Veeam.VBR.Resources.psd1 new file mode 100644 index 0000000..df998ac --- /dev/null +++ b/Language/en-US/AsBuiltReport.Veeam.VBR.Resources.psd1 @@ -0,0 +1,7 @@ +# en-US +ConvertFrom-StringData @' + LicenseSectionHeader = License Information + LicenseSectionHeaderParagraph = The following section provides a summary about the installed licenses + InstalledLicenseSectionHeader = Installed License Information + InstalledLicenseSectionTableParams = Licenses - {0} +'@; diff --git a/Language/es-ES/AsBuiltReport.Veeam.VBR.Resources.psd1 b/Language/es-ES/AsBuiltReport.Veeam.VBR.Resources.psd1 new file mode 100644 index 0000000..0ba13d6 --- /dev/null +++ b/Language/es-ES/AsBuiltReport.Veeam.VBR.Resources.psd1 @@ -0,0 +1,5 @@ +# es-ES +ConvertFrom-StringData @' + LicenseSectionHeader = Informacion de Licencias + LicenseSectionHeaderParagraph = La siguiente sección proporciona un resumen sobre las licencias instaladas. +'@;