Skip to content

Commit 06c03bc

Browse files
committed
UHF-12838: Add aliases to hakuvahti URLS
1 parent 8979777 commit 06c03bc

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

public/modules/custom/helfi_kymp_content/helfi_kymp_content.install

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
declare(strict_types=1);
99

10+
use Drupal\path_alias\Entity\PathAlias;
11+
1012
/**
1113
* Creates District nodes from Project district taxonomy terms.
1214
*/
@@ -29,3 +31,38 @@ function helfi_kymp_content_update_9002(): void {
2931
$storage->load($id)->delete();
3032
}
3133
}
34+
35+
36+
/**
37+
* UHF-12838: Translate hakuvahti paths.
38+
*/
39+
function helfi_kymp_content_update_11001(): void {
40+
$paths = [
41+
'/hakuvahti/confirm' => [
42+
'en' => '/parking/confirm-vehicle-removal-alert',
43+
'fi' => '/pysakointi/vahvista-siirtovahti',
44+
'sv' => '/parkering/bekrafta-flyttningsvakten',
45+
],
46+
'/hakuvahti/renew' => [
47+
'en' => '/parking/extend-vehicle-removal-alert',
48+
'fi' => '/pysakointi/jatka-siirtovahti',
49+
'sv' => '/parkering/forlang-flyttningsvakten',
50+
],
51+
'/hakuvahti/unsubscribe' => [
52+
'en' => '/parking/remove-vehicle-removal-alert',
53+
'fi' => '/pysakointi/poista-siirtovahti',
54+
'sv' => '/parkering/redigera-flyttningsvakten',
55+
],
56+
];
57+
58+
foreach ($paths as $path => $info) {
59+
foreach ($info as $langcode => $alias) {
60+
PathAlias::create([
61+
'path' => $path,
62+
'alias' => $alias,
63+
'langcode' => $langcode,
64+
])->save();
65+
}
66+
}
67+
}
68+

0 commit comments

Comments
 (0)