Customize welcome text from room and OU
This commit is contained in:
@@ -170,10 +170,10 @@ function Get-DirectoryWelcomeMetadata {
|
||||
function Get-SpanishArticle {
|
||||
param([Parameter(Mandatory)][string]$Value)
|
||||
|
||||
if ($Value -match '^(Sala|Aula|Facultad|Unidad|Biblioteca|Oficina|Coordinaci.n)\b') {
|
||||
if ($Value -match '^(Sala|Facultad|Unidad|Biblioteca|Oficina|Coordinaci.n)\b') {
|
||||
return 'la'
|
||||
}
|
||||
if ($Value -match '^(Laboratorio|Centro|Edificio|Campus|Taller|Auditorio)\b') {
|
||||
if ($Value -match '^(Aula|Laboratorio|Centro|Edificio|Campus|Taller|Auditorio)\b') {
|
||||
return 'el'
|
||||
}
|
||||
return $null
|
||||
@@ -202,9 +202,17 @@ function Get-WelcomeLocationText {
|
||||
if ($Room -and $OuName) {
|
||||
$roomArticle = Get-SpanishArticle -Value $Room
|
||||
$ouArticle = Get-SpanishArticle -Value $OuName
|
||||
$roomPhrase = if ($roomArticle) { "$roomArticle $Room" } else { $Room }
|
||||
$roomPhrase = if ($roomArticle -eq 'el') {
|
||||
"al $Room"
|
||||
}
|
||||
elseif ($roomArticle) {
|
||||
"a $roomArticle $Room"
|
||||
}
|
||||
else {
|
||||
"a $Room"
|
||||
}
|
||||
$ouPhrase = if ($ouArticle -eq 'el') { "del $OuName" } elseif ($ouArticle) { "de $ouArticle $OuName" } else { "de $OuName" }
|
||||
return "$located $roomPhrase $ouPhrase."
|
||||
return "Acceso $roomPhrase $ouPhrase."
|
||||
}
|
||||
if ($Room) {
|
||||
$article = Get-SpanishArticle -Value $Room
|
||||
|
||||
Reference in New Issue
Block a user