Skip to content

Commit

Permalink
Update string translation function
Browse files Browse the repository at this point in the history
  • Loading branch information
jvlflame committed Aug 31, 2020
1 parent d1a5137 commit 3d7cee9
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions src/Javinizer/Private/Get-TranslatedString.ps1
Expand Up @@ -2,17 +2,13 @@ function Get-TranslatedString {
[CmdletBinding()]
param(
[Parameter(Mandatory = $true, Position = 0)]
[string]$String,
[string]$ScriptRoot,
[string]$Language
[String]$String,
[String]$Language
)

begin {
Write-Debug "[$(Get-TimeStamp)][$($MyInvocation.MyCommand.Name)] Function started"
$translatePath = Join-Path -Path $ScriptRoot -ChildPath 'translate.py'
}

process {
$translatePath = Join-Path -Path ((Get-Item $PSScriptRoot).Parent) -ChildPath 'translate.py'

if ([System.Environment]::OSVersion.Platform -eq 'Win32NT') {
$translatedString = python $translatePath $String $Language
} elseif ([System.Environment]::OSVersion.Platform -eq 'Unix') {
Expand All @@ -21,8 +17,4 @@ function Get-TranslatedString {

Write-Output $translatedString
}

end {
Write-Debug "[$(Get-TimeStamp)][$($MyInvocation.MyCommand.Name)] Function ended"
}
}

0 comments on commit 3d7cee9

Please sign in to comment.