Skip to content

Commit a69344c

Browse files
authored
docs(custom-placeholders): add expressions deconstructions, update headings (#506)
1 parent fbbf815 commit a69344c

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

src/content/docs/enterprise/organization-management/settings/custom-placeholders.mdx

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import customPlaceholderExpression from '!/enterprise/organization-management/cu
1111

1212
Custom Placeholders are designed for cases when the source texts contain some less common placeholders that are not highlighted in the source strings (in the Editor) by default.
1313

14-
## Configure your Custom Placeholders
14+
## Configure Your Custom Placeholders
1515

1616
You can manage Custom Placeholders in the **Organization Settings**.
1717

@@ -28,7 +28,7 @@ You can manage Custom Placeholders in the **Organization Settings**.
2828

2929
Once the custom placeholders are assigned to the project, project members will see them highlighted in the Editor during the translation process.
3030

31-
## Custom placeholders syntax elements
31+
## Understanding the Syntax: A Simple Example
3232

3333
To configure your custom placeholder expression, you can use the elements from [the expression syntax table](/enterprise/expression-syntax-elements/).
3434

@@ -62,7 +62,7 @@ To simplify things a bit, let's deconstruct the expression above.
6262
/>
6363
</CardGrid>
6464

65-
## Custom Placeholder expression examples
65+
## Custom Placeholder Expression Examples
6666

6767
Below you can see a few examples of custom placeholder expression and how they will be highlighted in source strings in the Editor.
6868

@@ -84,6 +84,16 @@ Expression:
8484
start, maybe "(", then "%", then "{", anything, then "}", maybe ")", then "%", end
8585
```
8686

87+
This expression deconstructed:
88+
89+
* `maybe "("` &ndash; Allows the placeholder to optionally start with a `(`.
90+
* `then "%"` &ndash; Requires a `%` character.
91+
* `then "{"` &ndash; Requires a `{` character.
92+
* `anything` &ndash; Matches any character or sequence of characters inside the placeholder.
93+
* `then "}"` &ndash; Requires a `}` character.
94+
* `maybe ")"` &ndash; Allows the placeholder to optionally end with a `)`.
95+
* `then "%"` &ndash; Requires a `%` character.
96+
8797
##### Custom placeholder enclosed in double square brackets
8898

8999
String example:
@@ -98,6 +108,13 @@ Expression:
98108
start, then "[[", anythingbut "[[", then "]]", multiple, end
99109
```
100110

111+
This expression deconstructed:
112+
113+
* `then "[["` &ndash; Requires the placeholder to start with `[[`.
114+
* `anythingbut "[["` &ndash; Matches any character *except* the opening `[[` brackets.
115+
* `then "]]"` &ndash; Requires the placeholder to end with `]]`.
116+
* `multiple` &ndash; Allows the pattern (the content inside the brackets) to repeat.
117+
101118
##### Custom placeholder
102119

103120
String example:
@@ -137,5 +154,5 @@ A test string with a Long sentence that you might want to highlight as a single
137154
Expression:
138155

139156
```graphql wrap
140-
start, then "Long sentence that you might want to highlight as a single custom placeholder"
157+
start, then "Long sentence that you might want to highlight as a single custom placeholder", end
141158
```

0 commit comments

Comments
 (0)