Skip to content

feat: add string-details usage docs for figma plugin and adjust outda… #926

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 37 additions & 1 deletion platform/integrations/figma_plugin/usage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,45 @@ If you want to update only translations of some keys, first select the keys and

## Locating translation on the page

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.
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.

<FigmaScreenshotWrapper
aria-label="Usage - locate string on the page"
src="/img/docs/platform/figma-plugin/usage-locate-string.png"
/>

## Formatting text

There are a few syntaxes supported to format the text for Figma. Supported are the following HTML tags:
- `<b>` or `<strong>` – bold
- `<i>` or `<em>` – italic
- `<u>` – underline
- `<br>` – line break

If your text contains any of these tags, the plugin will automatically format the text in Figma.
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.

<FigmaScreenshotWrapper
aria-label="Usage - locate string on the page"
src="/img/docs/platform/figma-plugin/usage-formatting.png"
/>

## Using Plurals and Variables

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.

<FigmaScreenshotWrapper
aria-label="Usage - string details"
src="/img/docs/platform/figma-plugin/usage-string-details.png"
/>

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.

<FigmaScreenshotWrapper
aria-label="Usage - string details"
src="/img/docs/platform/figma-plugin/usage-string-details-variable.png"
/>
<FigmaScreenshotWrapper
aria-label="Usage - string details"
src="/img/docs/platform/figma-plugin/usage-string-details-plural.png"
/>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified static/img/docs/platform/figma-plugin/usage-locate-string.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified static/img/docs/platform/figma-plugin/usage-push-key-name.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified static/img/docs/platform/figma-plugin/usage-push-keys.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.