Skip to content

Commit 2247e1b

Browse files
committed
UI improvements
1 parent 3afc463 commit 2247e1b

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

Src/Private/Initialize-LocalizedData.ps1

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,27 @@ function Initialize-LocalizedData {
202202
# Core module = UI language, Report module = Document language
203203
$LanguageType = if ($ModuleType -eq 'Core') { "UI language" } else { "document language" }
204204

205+
206+
# Determine the language source for Report modules
207+
$LanguageSourceText = ""
208+
if ($ModuleType -eq 'Report' -and $Language) {
209+
# Check if the language was explicitly specified via command-line parameter
210+
# by examining if ReportConfig exists and comparing with its language setting
211+
if ($global:ReportConfig -and $global:ReportConfig.Report.Language) {
212+
if ($Language -eq $global:ReportConfig.Report.Language) {
213+
$LanguageSourceText = "(from report configuration file)"
214+
} else {
215+
# Language differs from config, so it must be from command-line
216+
$LanguageSourceText = "(from command-line parameter)"
217+
}
218+
} elseif ($Language -eq 'en-US') {
219+
# Default language
220+
$LanguageSourceText = "(fallback to default)"
221+
} else {
222+
# Explicitly specified via command-line (no config or config doesn't have language)
223+
$LanguageSourceText = "(from command-line parameter)"
224+
}
225+
}
205226
# Create unique key for this culture fallback scenario
206227
# When there's a fallback, include module type to show both messages
207228
# When there's no fallback, just use culture to avoid duplicate messages for same culture
@@ -226,9 +247,9 @@ function Initialize-LocalizedData {
226247

227248
if ($ShouldShowMessage) {
228249
if ($TargetCulture -ne $Culture.Name) {
229-
Write-Host ("Setting $LanguageType to '{0}' (fallback from '{1}')." -f $TargetCulture, $Culture.Name) -ForegroundColor Yellow
250+
Write-Host ("Setting $LanguageType to '{0}' (fallback from '{1}')$LanguageSourceText." -f $TargetCulture, $Culture.Name) -ForegroundColor Yellow
230251
} else {
231-
Write-Host ("Setting $LanguageType to '{0}'." -f $TargetCulture) -ForegroundColor Yellow
252+
Write-Host ("Setting $LanguageType to '{0}' $LanguageSourceText." -f $TargetCulture) -ForegroundColor Yellow
232253
}
233254

234255
# Mark this combination as already shown

0 commit comments

Comments
 (0)