WordPress.org

Ready to get started?Download WordPress

Forums

Transposh WordPress Translation
Phrases and Block to NOT translate (3 posts)

  1. Georg Ludwig
    Member
    Posted 1 year ago #

    I had the problem to NOT translate certain things like the company name or special phrases I've put into double brackets. Though I found a workaround in parser.php I'd be glad to have a portable solution in future releases if possible.

    Here's my workaround:

    In the parser.php I've added the following excclusions:

    ` // Unicode - 2 Chars for the <<
    elseif ($string[$pos] == '«') {
    $this->tag_phrase($string, $start, $pos-1);
    while ($string[$pos] != '»' && $pos < strlen($string))
    $pos++;
    $pos++;
    $start = $pos;
    }
    elseif ($string[$pos] == 'C' && ($pos+10) < strlen($string) && substr($string, $pos, 11) == 'Companyname') {
    $this->tag_phrase($string, $start, $pos);
    $pos+=11;
    $start = $pos;
    }`

    http://wordpress.org/extend/plugins/transposh-translation-filter-for-wordpress/

  2. Ofer Wald
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    Do you have any good suggestion on how this will be made portable? :)

    Would be happy to hear, truly.

  3. Georg Ludwig
    Member
    Posted 1 year ago #

    Hi,

    in my Opinion this could be a simple solution as follows:

    • In the settings section offer the ability to enter phrases that shall not be translated as a CSV-String.
      Split the string into an array and use it with the sample code above to test on such phrases.
    • You may also offer to enter char-combinations that enclose phrases not to be translated, e.g. "<>,[],«»" - could be used to parse with the code above.
      The only problem is what I had: The « and » are held as unicode-character in my installation - perhaps You have a proper idea for that specific problem ?

    Regards,
    Georg

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.