Skip to main content

Allow break lines in string variables


Daniel_Marcos

I’m trying to localize an app using the new variables feature but it looks like I can’t add break lines to the string.
For titles, especially in some languages like Japanese where there are no spaces, it is totally necessary.

Is this planned for the near future?

19 replies

David_Clayton

I would also love this feature, I’m trying to error messages in multiple languages and we really need line breaks!


chanwen
  • 1 reply
  • August 14, 2023

Agree, I would love this feature, too. This is critical for marketing-related materials in character-based languages such as Chinese and Japanese. Otherwise, some key phrases might be wrapped accidentally into two lines and cause confusion when reading.


Borys_Sviet

@Daniel_Marcos
There is a workaround this issue. Before pasting text into variable input, put it aside as plain text, make a break line with shift + enter shortcut, then copy and paste this text to the variable input


Daniel_Marcos
  • Author
  • New Member
  • 2 replies
  • August 28, 2023

Thank you Borys for the tip! It works great!!


  • 0 replies
  • November 26, 2023

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.


rahend
  • 11 replies
  • March 6, 2024

Continuing the discussion from Allow break lines in string variables:

The approach from @Borys_Sviet did not cover the paragraph spacing. What I’m trying is to handle paragraphs in multi-language using variables, so sometimes I need to break lines and add a paragraph space to them.


Jason_Thompson

Doing two line breaks (eg; old skool HTML where we did

) seems to work and give a simulated paragraph break. You’d do SHIFT-Enter twice.


rahend
  • 11 replies
  • April 18, 2024

Yes indeed @Jason_Thompson, but it doesn’t work with paragraph spacing properties. doesn’t it?


Brian_Nail1

This workaround didn’t work for me. It ended up looking like this and failing to insert the line breaks.
image


Benjamin18

Inserting a UNICODE paragraph Separator (U+2029) into the variable string works here:

  • Figma desktop app: 116.15.15
  • macOS 14.5

tcldr
  • 4 replies
  • May 23, 2024

Apple’s IDE, Xcode, handles this well in its Strings catalogs using an alt-return. A multiline browser would be a nice touch too.

The interface looks like this:


S_e_b_a_s_t_i_a_n

This works, but the result is different to a real paragraph spacing.
And I hate Figma for stupid work arounds like this 🤯


rahend
  • 11 replies
  • June 25, 2024

Indeed, we need a real thing than an approach look-a-like


Sergey_Tomashevsky

Ioana_Ionescu
  • New Participant
  • 14 replies
  • March 17, 2025
Borys_Sviet wrote:

@Daniel_Marcos
There is a workaround this issue. Before pasting text into variable input, put it aside as plain text, make a break line with shift + enter shortcut, then copy and paste this text to the variable input

 

 

This didn’t work for me. Does it still work for you? Do you have another solution? Thanks!


Jeremias_Santos

@Ioana_Ionescu Are you sure? I’ve just tested the aforementioned method and it worked! Just paste the desired text (with your break lines created) to the input, just like you would with any other local variable value.

 


Ioana_Ionescu
Jeremias_Santos wrote:

@Ioana_Ionescu Are you sure? I’ve just tested the aforementioned method and it worked! Just paste the desired text (with your break lines created) to the input, just like you would with any other local variable value.

 

@Jeremias_Santos 
Yes, I just tried it again and it doesn’t work :( I pasted the text with the break lines from Notepad and it’s still just one line of text. I used a unicode - Line Separator (U+2028): [‌
] I pasted the value between the brackets where I wanted my break line to be. That’s the only way I could make it work. 


Jeremias_Santos

@Ioana_Ionescu Have you tried creating the break lines in Figma with the Text tool? Copy the text from there, not Notepad, and it should work.


Ioana_Ionescu

@Jeremias_Santos Thanks! Looks like it worked this time. I tried it when I first came across this issue and at the time it didn't work. 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings