Skip to content

Commit af856fe

Browse files
author
Markus Fleschutz
committed
Update translate-files.ps1
1 parent baccfcf commit af856fe

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Scripts/translate-files.ps1

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
.SYNOPSIS
33
Translates text files
44
.DESCRIPTION
5-
This PowerShell script translates text files into any supported language.
6-
.PARAMETER FilePattern
7-
Specifies the file pattern
5+
This PowerShell script translates text files into multiple languages.
6+
.PARAMETER filePattern
7+
Specifies the file pattern of the text file(s) to be translated
88
.EXAMPLE
99
PS> ./translate-files C:\Temp\*.txt
1010
.LINK
@@ -13,7 +13,7 @@
1313
Author: Markus Fleschutz | License: CC0
1414
#>
1515

16-
param([string]$FilePattern = "")
16+
param([string]$filePattern = "")
1717

1818
function DetectSourceLang { param([string]$Filename)
1919
if ("$Filename" -like "*Deutsch*") { return "de" }
@@ -32,10 +32,10 @@ function TranslateFilename { param([string]$Filename, [string]$SourceLang, [stri
3232
}
3333

3434
try {
35-
if ($FilePattern -eq "" ) { $FilePattern = read-host "Enter the file pattern" }
35+
if ($filePattern -eq "" ) { $filePattern = Read-Host "Enter the file pattern of the text file(s) to be translated" }
3636

3737
$TargetLanguages = "ar","zh","fr","de","hi","ga","it","ja","ko","pt","ru","es"
38-
$SourceFiles = get-childItem -path "$FilePattern"
38+
$SourceFiles = Get-ChildItem -path "$filePattern"
3939
foreach($SourceFile in $SourceFiles) {
4040
$SourceLang = DetectSourceLang $SourceFile
4141
foreach($TargetLang in $TargetLanguages) {

0 commit comments

Comments
 (0)