Browse Source

修改拉丁化、標準化輸出樣示

develop
pcnick 3 weeks ago
parent
commit
2a26de717d
  1. 6
      Animelibk.ps1

6
Animelibk.ps1

@ -68,7 +68,7 @@ $WorkData = $(if (Test-Path $RecorDB) {
Get-Content $RecorDB | ConvertFrom-Json
} else {
""
}) | Select-Object ID, WorkName, TargetName, DestinName, Season, Episode, Latinization, Standard
}) | Select-Object ID, WorkName, TargetName, DestinName, Latinization, Standard, Season, Episode
$RecorDB
# 確認資料狀態,缺少則進行物件資料建立
@ -92,7 +92,7 @@ $Latinization = {
param($String)
# 載入置換檔
$C = if (Test-path $PSScriptRoot\C2E.csv) {Import-Csv -Encoding UTF8 $PSScriptRoot\C2E.csv}
$C = if ($WorkData.Standard -and (Test-path $PSScriptRoot\C2E.csv)) {Import-Csv -Encoding UTF8 $PSScriptRoot\C2E.csv}
if ($WorkData.Latinization.Length -eq 0) {
$T = Read-Host "請輸入拉丁化作品名稱"
@ -105,7 +105,7 @@ $Latinization = {
$RuleString = $RuleString + $Matches[0]
$TString = $TString -replace $Matches[0], '-'
}
return $String -replace $RuleString, $T
return ($String -replace "$RuleString\s?", "$T ").Trim()
}
}
$WorkData

Loading…
Cancel
Save