Skip to content

Commit b9312d8

Browse files
authored
feat: add string-details usage docs for figma plugin (#926)
1 parent 9f424c1 commit b9312d8

9 files changed

+37
-1
lines changed

platform/integrations/figma_plugin/usage.mdx

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,45 @@ If you want to update only translations of some keys, first select the keys and
125125

126126
## Locating translation on the page
127127

128-
If you want to locate a string on the page, click on the **target** button, which will align your figma view so that the node is in the center of your screen.
128+
If you want to locate a string on the page, click on the **more** button and then on the **Move to string** button, which will align your figma view so that the node is in the center of your screen.
129129

130130
<FigmaScreenshotWrapper
131131
aria-label="Usage - locate string on the page"
132132
src="/img/docs/platform/figma-plugin/usage-locate-string.png"
133133
/>
134+
135+
## Formatting text
136+
137+
There are a few syntaxes supported to format the text for Figma. Supported are the following HTML tags:
138+
- `<b>` or `<strong>` – bold
139+
- `<i>` or `<em>` – italic
140+
- `<u>` – underline
141+
- `<br>` – line break
142+
143+
If your text contains any of these tags, the plugin will automatically format the text in Figma.
144+
It will just work in the direction from Tolgee to Figma, so if you change the font weight or decoration for any of the connected texts in figma, this plugin won't recognize these changes.
145+
146+
<FigmaScreenshotWrapper
147+
aria-label="Usage - locate string on the page"
148+
src="/img/docs/platform/figma-plugin/usage-formatting.png"
149+
/>
150+
151+
## Using Plurals and Variables
152+
153+
You can use Tolgee's Plurals and Variables in Figma. To define a variable or mark a string as plural, you need to go to the **String details** page in the plugin by clicking on the **More** button for a text.
154+
155+
<FigmaScreenshotWrapper
156+
aria-label="Usage - string details"
157+
src="/img/docs/platform/figma-plugin/usage-string-details.png"
158+
/>
159+
160+
In the **String details** page, you can define a variable by using the [ICU syntax](/platform/translation_process/tolgee_universal_icu_placeholders) you know from Tolgee (`{varName}`) and mark a string as plural by checking the **Plural** checkbox.
161+
162+
<FigmaScreenshotWrapper
163+
aria-label="Usage - string details"
164+
src="/img/docs/platform/figma-plugin/usage-string-details-variable.png"
165+
/>
166+
<FigmaScreenshotWrapper
167+
aria-label="Usage - string details"
168+
src="/img/docs/platform/figma-plugin/usage-string-details-plural.png"
169+
/>
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading

0 commit comments

Comments
 (0)