A tip about long strings

Discussion in 'Localization Archives' started by Krohon, Dec 8, 2015.

Thread Status:
Not open for further replies.
  1. Krohon

    Krohon Avatar

    Messages:
    412
    Likes Received:
    657
    Trophy Points:
    43
    Gender:
    Male
    Location:
    Brittany
    When I started with localization of SotA, I expected it to be easier and shorter. I was wrong. On the other hand localization become to me a more interesting task, one I can do for more time. But then I find some long strings.

    Short strings are easy, but long ones have a {NL} char inside, and stuff like , all in a single line, check this example:

    In order to import text to a custom book, a text file (with the .txt extension) must first be created and placed in the directory indicated at the bottom of the import interface.{NL}{NL}After placing the text file in the appropriate directory, click on the [ U]Refresh[/U] button to refresh the contents of the directory displayed in the import interface.{NL}{NL}Then, select the text file to preview the text as it will appear in the book. If you need to make any changes, you may edit the text file and then select it again to refresh the preview. Be sure to save any changes that you make to the text file, so that the changes may be reflected in the preview.{NL}{NL}When you are satisfied, click on the [ B]Publish[/B] button. [ U]Note that after publishing the book, the book cannot be edited.[/U]{NL}{NL}{NL}[ B]Adding Effects[/B]{NL}{NL}Several tags may be added to the text in your file in order to embed effects, such as [ B]bold[/B], [ U]underline[/U], [ I]italics[/I], and even [0099FF]color[-]! These effects are only availabe when importing text from a file and cannot be used when manually writing the book.{NL}{NL}[ B]Bold[/B] - [[-]b] and [[-]/b]{NL}example: This is [[-]b]bold[[-]/b] -> This is [ B]bold[/B]{NL}{NL}[ U]Underline[/U] - [[-]u] and [[-]/u]{NL}example: This is [[-]u]underlined[[-]/u] -> This is [ U]underlined[/U]{NL}{NL}[ I]Italic[/I] - [[-]i] and [[-]/i]{NL}example: This is [[-]i]italicized[[-]/i] -> This is [ I]italicized[/I]{NL}{NL}[0099FF]Color[-] - [[-]RrGgBb] and [[-]-]{NL}example: This is [[-]0099FF]colored[[-]-] -> This is [0099FF]colored[-]{NL}{NL}There are various color code pickers available online.

    OK, lets fix it.

    In order to import text to a custom book, a text file (with the .txt extension) must first be created and placed in the directory indicated at the bottom of the import interface.

    After placing the text file in the appropriate directory, click on the [ U]Refresh[/U] button to refresh the contents of the directory displayed in the import interface.

    Then, select the text file to preview the text as it will appear in the book. If you need to make any changes, you may edit the text file and then select it again to refresh the preview. Be sure to save any changes that you make to the text file, so that the changes may be reflected in the preview.

    When you are satisfied, click on the [ B]Publish[/B] button. [ U]Note that after publishing the book, the book cannot be edited.[/U]


    [ B]Adding Effects[/B]

    Several tags may be added to the text in your file in order to embed effects, such as [ B]bold[/B], [ U]underline[/U], [ I]italics[/I], and even [0099FF]color[-]! These effects are only availabe when importing text from a file and cannot be used when manually writing the book.

    [ B]Bold[/B] - [[-]b] and [[-]/b]
    example: This is [[-]b]bold[[-]/b] -> This is [ B]bold[/B]

    [ U]Underline[/U] - [[-]u] and [[-]/u]
    example: This is [[-]u]underlined[[-]/u] -> This is [ U]underlined[/U]

    [ I]Italic[/I] - [[-]i] and [[-]/i]
    example: This is [[-]i]italicized[[-]/i] -> This is [ I]italicized[/I]

    [0099FF]Color[-] - [[-]RrGgBb] and [[-]-]
    example: This is [[-]0099FF]colored[[-]-] -> This is [0099FF]colored[-]

    There are various color code pickers available online.



    It looks better to me. To do it we need to search and replace the {NL} tag with an line feed char. Many editors do it but can be a bit tricky so I will detail the procedure, as a example:

    1) Download and install Notepad Plus Plus
    2) Open a new document on it
    3) Copy and paste the text (from GetLocalization) you want to translate.
    4) Start a "Replace", you can use 'Ctrl' + 'H'
    5) On "Find what:" type "{NL}" and on "Replace with:" type "\n" (And be sure the Extended search mode is selected).
    6) Now, click on "Replace All"

    Once you do it once, it will be easier. We can even use a macro for max functionality.

    To return the text to the format GetLocalization understand, we have to do another Replace but inverting the data.

    1) Invoke "Replace" by hitting 'Ctrl' + 'H'
    2) On "Find what:" type "\n" and on "Replace with:" type "{NL}", and click on the "Replace All" button.

    Done, copy and paste back to the GetLocalization site.

    Please not we must be careful to not introduce unwanted characters.


    However, the text readability can still be improved, by processing the BBCode. For that we can use this very forum, we can create a new conversation and paste the text there.

    Once the text is on this editor, click the button "Use BB Code Editor" on the right most position at the tools bar. Finally, click on "Preview".

    In order to import text to a custom book, a text file (with the .txt extension) must first be created and placed in the directory indicated at the bottom of the import interface.

    After placing the text file in the appropriate directory, click on the Refresh button to refresh the contents of the directory displayed in the import interface.

    Then, select the text file to preview the text as it will appear in the book. If you need to make any changes, you may edit the text file and then select it again to refresh the preview. Be sure to save any changes that you make to the text file, so that the changes may be reflected in the preview.

    When you are satisfied, click on the Publish button. Note that after publishing the book, the book cannot be edited.


    Adding Effects

    Several tags may be added to the text in your file in order to embed effects, such as bold, underline, italics, and even [0099FF]color[-]! These effects are only availabe when importing text from a file and cannot be used when manually writing the book.

    Bold - [[-]b] and [[-]/b]
    example: This is [[-]b]bold[[-]/b] -> This is bold

    Underline - [[-]u] and [[-]/u]
    example: This is [[-]u]underlined[[-]/u] -> This is underlined

    Italic - [[-]i] and [[-]/i]
    example: This is [[-]i]italicized[[-]/i] -> This is italicized

    [0099FF]Color[-] - [[-]RrGgBb] and [[-]-]
    example: This is [[-]0099FF]colored[[-]-] -> This is [0099FF]colored[-]

    There are various color code pickers available online.
     
    Last edited: Dec 8, 2015
Thread Status:
Not open for further replies.