-1

I need to add a line break before the work please

File type must be PDF, JPEG or PNG (max file size 20MB) Please provide English translation if the document is not in English or Chinese.

It should look like the following when it is rendered in html

File type must be PDF, JPEG or PNG (max file size 20MB) 
Please provide English translation if the document is not in English or Chinese.

I have tried the following in the insert statement

INSERT INTO #Temp_Language (OnScreenTextCode, English, Mandarin) 
Values
('common.file-type-info',       'File type must be PDF, JPEG or PNG (max file size 20MB) <br /> Please provide English translation if the document is not in English or Chinese.',   N'文件类型必须是PDF、JPEG或PNG(文件大小不超过20MB)文件如非英文或中文,请提供英文译本。')

INSERT INTO #Temp_Language (OnScreenTextCode, English, Mandarin) 
Values
('common.file-type-info',       'File type must be PDF, JPEG or PNG (max file size 20MB) \r\n Please provide English translation if the document is not in English or Chinese.',     N'文件类型必须是PDF、JPEG或PNG(文件大小不超过20MB)文件如非英文或中文,请提供英文译本。')

INSERT INTO #Temp_Language (OnScreenTextCode, English, Mandarin) 
Values
('common.file-type-info',       'File type must be PDF, JPEG or PNG (max file size 20MB)' + char(13) + 'Please provide English translation if the document is not in English or Chinese.',   N'文件类型必须是PDF、JPEG或PNG(文件大小不超过20MB)文件如非英文或中文,请提供英文译本。')
DarkBee
  • 16,592
  • 6
  • 46
  • 58
Tom
  • 8,175
  • 41
  • 136
  • 267
  • 1
    So how do you render it in HTML? – DarkBee Oct 12 '21 at 09:44
  • I am using it in my angular app with ngz-translate library. Something like – Tom Oct 12 '21 at 09:49
  • Does this answer your question? [How to insert a line break in a SQL Server VARCHAR/NVARCHAR string](https://stackoverflow.com/questions/31057/how-to-insert-a-line-break-in-a-sql-server-varchar-nvarchar-string) – SecretTimes Oct 12 '21 at 09:51
  • Then look at Angular's label's documentation or that of ngz-translate to find out how to pass raw HTML or let it render line breaks as-is. – CodeCaster Oct 12 '21 at 09:55

1 Answers1

0

I believe this depends on Your HTML renderer - it should respect the "/br" tag You supplied.

But You can add the CHAR(13)+CHAR(10) as Enter directly to your texts - CHAR(13) = Carriage Return, CHAR(10) = Line Feed.

Example:

INSERT INTO #Temp_Language (OnScreenTextCode, English, Mandarin) 
Values
('common.file-type-info', 'line1'+CHAR(13)+CHAR(10)+'line2', N'文件...')