Skip to content

Commit b01ba35

Browse files
feat: Turtle.get/set_Locale ( Fixes #300 )
1 parent e091e77 commit b01ba35

File tree

3 files changed

+30
-40
lines changed

3 files changed

+30
-40
lines changed

Types/Turtle.js/ToHTML.ps1

Lines changed: 0 additions & 40 deletions
This file was deleted.

Types/Turtle/get_Locale.ps1

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<#
2+
.SYNOPSIS
3+
Gets a Turtle's Locale
4+
.DESCRIPTION
5+
Gets the locale associated with a Turtle.
6+
7+
This is usually nothing, as a picture speaks a thousand words in any language.
8+
9+
If it is set, it can be used to render content invisible unless the systemLanguage attribute matches the current language preference.
10+
#>
11+
return $this.Attributes['systemLanguage']

Types/Turtle/set_Locale.ps1

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<#
2+
.SYNOPSIS
3+
Gets a Turtle's Locale
4+
.DESCRIPTION
5+
Gets the locale associated with a Turtle.
6+
7+
This is usually nothing, as a picture speaks a thousand words in any language.
8+
9+
If it is set, it can be used to render content invisible unless the systemLanguage attribute matches the current language preference.
10+
#>
11+
$unrolledArgs = $args | . { process { $_ } }
12+
$joinedArgs = $unrolledArgs -join ','
13+
if (-not $joinedArgs) {
14+
$this.Attribute.Remove('systemLanguage')
15+
$this.SVGAttribute.Remove('systemLanguage')
16+
} else {
17+
$this.Attribute['systemLanguage'] = $joinedArgs
18+
$this.SVGAttribute['systemLanguage'] = $joinedArgs
19+
}

0 commit comments

Comments
 (0)