Using most Recenter Version, problem with \N

More
8 years 8 months ago #1355 by wagenheimer
Using the most recent version, all my \N (Break Line) were converted to \\N and does not works anymore.

How to fix this?

Please Log in or Create an account to join the conversation.

More
8 years 8 months ago #1356 by Frank
Hi,
1- Can you please let me exactly which version of the plugin are you using:
2.6.5 a2 (AssetStore latest)
2.6.5 f1 (Beta folder latest)

Each of them uses a different WebService.

2- Also, are you importing from Google or from a CSV file?

3- when you say it converts \n to \\n, Are you texts written with a "\" and an "n" like "this is a line\n this is another line"

or with a real linebreak like:
"this is a line
this is another line"

Thanks,
Frank

Are you :-) Give I2L 5 stars!
Are you :-( Please lets us know how to improve it!
To get the betas as soon as they are ready, check this out

Please Log in or Create an account to join the conversation.

More
8 years 8 months ago #1357 by wagenheimer
1- Can you please let me exactly which version of the plugin are you using:
2.6.5 f1 (Beta folder latest)

2- Also, are you importing from Google or from a CSV file?
Import from Google

3- when you say it converts \n to \\n, Are you texts written with a "\" and an "n" like "this is a line\n this is another line"

My Text is this way :
"Level {0}\nStart!"

On I2 prefab it appears correctly! "Level {0}\nStart!"

But in realtime,
var Text = LocalizationManager.GetTermTranslation("levelstart");
Debug.Log(Text);

It shows me on Console : "Level {0}\nStart!"
But if I add an breakpoint and inspect the Text variable, the Text value is "Level {0}\\nStart!"

I don't know if this is expected! But I'm having problems with LineBreaks not working on TextMeshPro, and I'm not sure if the problem is with I2 or with TextMeshPro.

Any advice?

Please Log in or Create an account to join the conversation.

More
8 years 8 months ago #1358 by Frank

wagenheimer wrote: My Text is this way :
"Level {0}\nStart!"

On I2 prefab it appears correctly! "Level {0}\nStart!"

But in realtime,

var Text = LocalizationManager.GetTermTranslation("levelstart");
Debug.Log(Text);

It shows me on Console : "Level {0}\nStart!"
But if I add an breakpoint and inspect the Text variable, the Text value is "Level {0}\\nStart!"

I don't know if this is expected! But I'm having problems with LineBreaks not working on TextMeshPro, and I'm not sure if the problem is with I2 or with TextMeshPro.

Any advice?


Hi,
If I understood you correctly, what you are describing is the correct behavior.

If in unity or google you type "Level {0}\nStart!", you are not actually typing a line break, instead you are saying that you want the text to show a '\' followed by the letter n.
If you want a break line, then press enter or copy/paste a line break. That makes easy to copy/paste texts and keep the original formatting.

What you see in the plugin inspector is exactly what you will see in TextMeshPro, "\n" will not be translated to a new line character.

And when you use the debugger, monobehavior and visual studio preview will show you the '\' as \\ to make you realize that \n is not a new line character but two separated characters.

A quick fix is to either remove the \n in I2L and press enter to make a real new line character. Then export back to Google.

If you look at the example scenes, there a few labels showing texts with several lines.

Hope that helps, but if you need it, I can post some screenshots of how it should look in google spreadsheet, unity and in-game.
Frank

Are you :-) Give I2L 5 stars!
Are you :-( Please lets us know how to improve it!
To get the betas as soon as they are ready, check this out

Please Log in or Create an account to join the conversation.

More
8 years 8 months ago #1359 by wagenheimer
Thanks for the answer Frank!

I was using "Real Line Breaks" before, but on some cases I need to convert the translation to CSV and use the CSV_Import Feature and it seems CSV does not like "real line breakes".

But thanks, I will make some more tests here.

Please Log in or Create an account to join the conversation.

More
8 years 8 months ago - 8 years 8 months ago #1360 by wagenheimer

What you see in the plugin inspector is exactly what you will see in TextMeshPro, "\n" will not be translated to a new line character.

The problem is here! Create a new term by example : Level {0}\n Start!1

I2 is converting it to "\\n" somehow in runtime... I expect the exact same string is returned from my tag, but not, the string is really returning with \\n.


Attachments:
Last edit: 8 years 8 months ago by wagenheimer.

Please Log in or Create an account to join the conversation.

Time to create page: 0.166 seconds
Template by JoomlaShine