WordPress.org

Forums

Codestyling Localization
[resolved] Problem with encoded tab character (5 posts)

  1. Alexander Gieg
    Member
    Posted 2 years ago #

    I noticed a bug that I think is related to my previously reported one. Sometimes an original string has an encoded tab character \t. If I try including it in the translation, CSL converts it to \\t, causing a literal slash-followed-by-t to be output rather than the actual tab character. The workaround is to not include it, causing pure textual output to become misaligned.

    http://wordpress.org/extend/plugins/codestyling-localization/

  2. codestyling
    Member
    Plugin Author

    Posted 2 years ago #

    Please provide a code snippet out of!
    It dependends on how it's done.

  3. Alexander Gieg
    Member
    Posted 2 years ago #

    Sorry for the delay in replying. No, what I meant wasn't in the code, but in the editing. For example, let's say an original string is like this (I'll type [tab] where a tab character should appear:

    [tab]Something something something.

    This appears in the CSL translatable string as:

    \tSomething something something.

    So, I translated it by typing these exact characters:

    \tTranslated text translated text.

    And save. But CSL, instead of storing the typed '\t' as a tab character, saves it as a slash-followed-by-a-t, meaning internally it becomes this:

    \\tTranslated text translated text.

    And thus, when WordPress finally displays this string, it appears in the rendered output as:

    \tTranslated text translated text.

    And not as it should, which would be:

    [tab]Translated text translated text.

    The workaround then is to translate this:

    \tSomething something something.

    To this:

    Translated text translated text.

    What causes the output on, for example, pre-wrapped sections, to become misaligned. Or maybe to this:

            Something something something.

    Which, although it'll appear right, isn't semantically the same.

    I hope this helps!

  4. codestyling
    Member
    Plugin Author

    Posted 2 years ago #

    This is a known bug, not yet solved. The WordPress main file contains also a \t character but doesn't meen [TAB] with it.
    It's not that easy to solve this at all occurances, will be handled with later updates. Next update will fix some bugs introduced during WP 3.5 compatibility.

  5. codestyling
    Member
    Plugin Author

    Posted 2 years ago #

    Improved TAB charactor handling won't make it into 1.x versions from now on because the 2.0 reaches beta state soon. This will be handled with scope of 2.0 version only.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic