File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -220,7 +220,7 @@ $THUMB_W = 120
220220$THUMB_H = 120
221221
222222# ==================== YARDIMCI ====================
223- function T ([string ]$Key , [object []]$Args = @ ()) {
223+ function T ([string ]$Key , [object []]$FormatArgs = @ ()) {
224224 $lang = if ($script :CurrentLanguage -eq ' tr' ) { ' tr' } else { ' en' }
225225
226226 $text = switch ($lang ) {
@@ -518,9 +518,22 @@ function T([string]$Key, [object[]]$Args = @()) {
518518 }
519519 }
520520
521- if ($Args -and $Args.Count -gt 0 ) {
521+ if ($null -ne $FormatArgs -and $FormatArgs.Count -gt 0 ) {
522+ $resolvedArgs = @ ($FormatArgs )
523+
524+ # PowerShell can bind array inputs as a single nested element; flatten one level.
525+ if ($resolvedArgs.Count -eq 1 ) {
526+ $first = $resolvedArgs [0 ]
527+ if ($first -is [System.Array ]) {
528+ $resolvedArgs = @ ($first )
529+ }
530+ elseif ($first -is [System.Collections.IList ] -and -not ($first -is [string ])) {
531+ $resolvedArgs = @ ($first )
532+ }
533+ }
534+
522535 try {
523- return [string ]::Format($text , $Args )
536+ return [string ]::Format($text , [ object []] $resolvedArgs )
524537 }
525538 catch {
526539 return $text
You can’t perform that action at this time.
0 commit comments