Skip to content

Commit fe7fbd6

Browse files
committed
Localize string
1 parent 889d3dd commit fe7fbd6

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

lib/dsc-lib/locales/en-us.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,7 @@ secretNotFound = "Secret '%{name}' not found"
530530

531531
[functions.shallowMerge]
532532
description = "Combines an array of objects where only the top-level objects are merged"
533+
requiresObjects = "shallowMerge requires all array elements to be objects, but found: %{value}"
533534

534535
[functions.startsWith]
535536
description = "Checks if a string starts with a specific prefix"

lib/dsc-lib/src/functions/shallow_merge.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ impl Function for ShallowMerge {
3131

3232
for item in array {
3333
let obj = item.as_object().ok_or_else(|| {
34-
DscError::Parser(format!(
35-
"shallowMerge requires all array elements to be objects, but found: {}",
36-
item
37-
))
34+
DscError::Parser(t!(
35+
"functions.shallowMerge.requiresObjects",
36+
value = item
37+
).to_string())
3838
})?;
3939

4040
for (key, value) in obj {

0 commit comments

Comments
 (0)