Not signed in (Sign In)

Vanilla 1.1.9 is a product of Lussumo. More Information: Documentation, Community Support.

Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    • CommentAuthorelarequi
    • CommentTimeOct 8th 2007 edited
     
    I've created an es_ES.mo file for Tarski 1.7.2. This is a new formal spanish version, which corrects some misspellings I've found in Patis version. My own translation (.mo file + .pot file) can be downloaded in my blog, La Bitácora del Tigre, in http://www.labitacoradeltigre.com/docs/tarski_larequi.zip. You are free to copy my translation and put it in your own server.

    Nevertheless, there's a problem with Tarski design (and I suppose the same occurss with other WordPress themes) which can't be solved just by translating .mo files. For example, in Tarski loop.php file, line 62, we have:

    <p><?php echo __('You are currently browsing the archive for the ','tarski'). '<strong>'; single_cat_title(); echo '</strong>'. __(' category.','tarski'); ?></p>

    After applying the translated .mo file, we get this result: "Está navegando por los archivos de la xxxx categoría", which is not correct in Spanish. If we want a correct result in our language, we have to change the order of functions in loop.php, to something like:

    <p><?php echo __('You are currently browsing the archive for the ','tarski'). __(' category.','tarski'). '<strong>'; single_cat_title(); echo '</strong>'; ?></p>

    Now, we can get the correct result: "Está navegando por los archivos de la categoría xxxx".

    This is not the only example in which there are problems caused by different word order between English and Spanish. In line 73 (author header), we have another similar case.
  1.  

    Thanks, I’ll upload the translation when I have some time this evening.

    I’ll have a think about how to better translate these ‘mixed’ sentences where words are interspersed by links, WordPress-generated text and so on. If you have any suggestions as to how I could rejig the various problematic areas so that they can be better translated into Spanish (and other languages), while at the same time allowing a natural English sentence structure, I’d be happy to consider them.

    • CommentAuthorliggitt
    • CommentTimeOct 8th 2007
     
    I think the easiest way would be to embed tokens in the translated strings, then use sprintf to replace with the literal values:
    sprintf( __('You are currently browsing the archive for the %s category.','tarski'), single_cat_title() )

    If there were multiple interspersed tokens in a string, it would be good to explicitly number the tokens, like this:
    sprintf( __('Your search for %1$s returned no results. Try returning to the %2$s.','tarski'), '<strong>'.the_search_query().'</strong>', '<a href="'. get_bloginfo('url').'">'. __('front page', 'tarski'). '</a>' )

    That way, the translations can reorder the entire sentence if needed, swap the order of tokens, etc.
  2.  

    Yeah, that’s probably the best way to do it; thanks Jordan. I’ll have a go at getting it into the next release. Obviously there’s rather a lot of text in Tarski, so it may take me a while. I started using sprintf a lot more recently (being a PHP newbie, it’s taking me a while to gain a working knowledge of PHP’s inbuilt functions), it’s quite useful for generating links and similar HTML elements because of their structured nature, but it looks like it would work well for translations too.

    • CommentAuthorliggitt
    • CommentTimeOct 8th 2007
     
    After a quick run-through, I think I got all the calls to __() that were being concatenated together... here's a SVN patch file from the current trunk:

    http://jordan.liggitt.net/tarski.sprintf.patch.txt
  3.  

    Fantastic work, thanks a lot for that Jordan. Makes my life an awful lot easier.

  4.  

    Ok, I’ve applied the patch to trunk. Eduardo, I’ve uploaded your 1.7.2 translation and credited you on the localisation page. Once the next version comes out, it would be wonderful if you could provide an updated Spanish translation. Thanks for pointing out an area where we could improve, and thanks again to Jordan for providing such a comprehensive patch.

    • CommentAuthorliggitt
    • CommentTimeOct 9th 2007
     
    One last question... is the default POT file automatically generated whenever a release is locked? I assumed so, but wanted to double check and make sure it was ok that I didn't update it with the new referenced strings.
  5.  

    Yeah, I generate it (by hand, basically) whenever I tag a new release. So the translations trunk tarski.pot doesn’t correspond to the theme trunk, it corresponds to Tarski 1.7.2 (the latest release in the stable branch).

    • CommentAuthorelarequi
    • CommentTimeOct 9th 2007 edited
     
    You can count on me, Ben, for new Tarski versions. I'll try to do my best with them. And thanks for the the credits on your page.

    I've written a short post on this thread in my blog: La traducción del tema Tarski y el problema del orden de palabras (Theme Tarski translation and the problem of word order).
    •  
      CommentAuthorDetective
    • CommentTimeOct 17th 2007
     
    La traducción está muy buena, muchas gracias :)