Translating external api results in Drupal

Posted by Chuck Vose on Stack Overflow See other posts from Stack Overflow or by Chuck Vose
Published on 2010-03-18T17:37:07Z Indexed on 2010/03/19 0:41 UTC
Read the original article Hit count: 297

Filed under:
|
|
|

We're building a multi-language Drupal stack and one of the concerns we have is that our payment processor is going to have to send back some information to us. We've been able to narrow this down so that the strings they're sending back look like

<country code>-<number of months>

so we can easily translate that into any number of languages, except English.

t('FR-12') is all well and good if we want to translate that into a french description, but because there's not an English language a similar string like t('EN-12') is not translatable.

Similarly for the generic string: #API_Connection_Error

This sort of generic string approach seemed really compelling to me at first but it seems to not work in Drupal. Do you have any suggestions about how to translate generic strings like this into both English and other languages?

Thank you, I've been looking through Google all morning.

© Stack Overflow or respective owner

Related posts about drupal

Related posts about locale