I am trying to translate
<span class='fbs_list_item' title='@username @status_long'> !user @status_short <div class='submitted'>!time</div></span>
and
<span class='fbs_list_item' title='@status_long'> !user @status_short <div class='submitted'>!time</div></span>
without any luck.

Can't search it in */admin/build/translate/search, l10client can't find it, and after exporting via potx and importing a facebook_status.po file, Drupal reports:
"2 translation strings were skipped because they contain disallowed HTML."

Comments

icecreamyou’s picture

Assigned: Unassigned » icecreamyou
Priority: Normal » Minor

Those strings are in a theme function so they can be quite easily overridden if you need them translated immediately, but I'll fix it within the next few days.

icecreamyou’s picture

Title: String contains disallowed HTML » String can't translate because it contains disallowed HTML
Status: Active » Fixed

Fixed in -dev in both branches.

johnnoc’s picture

Title: String can't translate because it contains disallowed HTML » String can't be translated
Status: Fixed » Active

It seems that there are still problems in translating. Uninstalled 6.x-1.0 and installed the dev version.

Still can't search it in */admin/build/translate/search, l10client can't find it, but this time exporting via potx and importing the facebook_status.po file does not report any errors though. I translated strings via poEdit but still the string won't show.

Yeah, it's possible with a theme override via template.php as a temporary solution but it will be great if there are no problems with translation strings.

Moreover, there's an empty string in the .po file

#: facebook_status.module:1131
msgid ""
msgstr ""

Thanks a lot!

icecreamyou’s picture

Status: Active » Postponed (maintainer needs more info)

I would guess this is some kind of caching problem--you may need to use Devel to flush all your caches. Also you might not be looking for the right thing. The original string was broken up into two strings.

If it's not either of those problems, I have no idea what it could be, and I can't fix it. I have never dealt with translations and to be honest I'm not really interested in learning how to deal with them. Of course I'll help as much as I can to fix it but unless your problem is mentioned above I need more information about what the problem actually is.

Assuming your problem is still with the same strings, this is what the related code looks like now:

function theme_facebook_status_item($account, $status_long, $status_short, $time) {
  if (variable_get('facebook_status_mode', 1)) {
    return '<span class="fbs_list_item" title="'. t('@username @status_long', array('@username' => $account->name, '@status_long' => $status_long, '!time' => $time)) .'">'.
      t('!user @status_short !time', array('@username' => $account->name, '@status_long' => $status_long, '!user' => theme('username', $account), '@status_short' => $status_short, '!time' => '<div class="submitted">'. $time .'</div>')) .'</span>';
  }
  else {
    return '<span class="fbs_list_item" title="'. t('@status_long', array('@username' => $account->name, '@status_long' => $status_long, '!time' => $time)) .'">'.
      t('!user @status_short !time', array('@username' => $account->name, '@status_long' => $status_long, '!user' => theme('username', $account), '@status_short' => $status_short, '!time' => '<div class="submitted">'. $time .'</div>')) .'</span>';
  }
}

...anyway, I imagine this is more a semantic problem, since there's not actually any language in the strings, just tokens.

johnnoc’s picture

Yeah...I checked the code.

I need to put an article before the username because it's what's needed for the Filipino language.. like...
msgid "!user @status_short !time"
msgstr "Si !user @status_short !time"
etc.

I've been flushing the cache via the .../admin/settings/performance page. I'll try to do that via devel and see what happens. I will also recheck the translated strings again.

Thanks.

johnnoc’s picture

Yupp it's showing in the "Recent Status Update" block.

But the Status block in the profile page is untranslatable. I did a very ugly hack just to accomodate correct grammar in the status.

Line 235:
'#field_prefix' => '<span style="float: left;">'. t('&nbsp; &nbsp;') . $xname .'&nbsp; </span>',

Line 331:
$block_content .= t('&nbsp; &nbsp;') . $fbs_name ." ";

In English, it will just show the status indented t('&nbsp; &nbsp;') but in translation to other languages that need something before the username, then there's a possibility. I know that this is ugly but would you care a theme function or make this better so users who use a language that needs a prefix before the username do not need to hack the module's code every update?

Thanks a lot!

icecreamyou’s picture

Yeah... it's generally not a good idea to use things like &nbsp; in translatable strings but what I can do is something like t(' !name', array('!name' => $xname)) if that works for you. And in the 2.x branch all of this will definitely be in a theme function.

I'll go ahead and make that change and commit a dev as soon as I can. Let me know if there are any other similar places you have trouble with.

icecreamyou’s picture

Status: Postponed (maintainer needs more info) » Reviewed & tested by the community

Er. Marking as some sort of patch here even though there isn't so I remember to make this change.

johnnoc’s picture

Wouldn't t(' !name' give a space before the name? Perhaps a t('!name', array('!name' => $xname)) so there is no space for languages that do not need a prefix and those who need a prefix can just add something before the !name in the translations. Thanks a lot! Your response time is excellent! 5 star on user support :-)

For the present site I'm building, that's all the problems I see I think, but of course I'll try to test this module for other i18n problems... that's the least I can do. Thanks again.

icecreamyou’s picture

Yeah... I was trying to remember why there was a hard-coded indent there, and couldn't... when I go to make the change I'll see what works best and I'll let you know.

Haha thanks. You actually can give the module five virtual stars if you are so inclined. :-)

Sounds good, thanks.

johnnoc’s picture

ok...i'll rate your module there :-)

Oh..Just wondering if it will be better if its !fbsname rather than !name so if there are other modules that use !name in a translation string which actually does not need a prefix then the prefix won't show.

icecreamyou’s picture

I hadn't thought of that. Do translations work module-by-module or does the system look for all translations over all modules that are available to it? I'll certainly reduce the ambiguity if the latter is the case.

johnnoc’s picture

It's the latter case. If you translate the word "Save" once, then all instances of "Save" will be translated regardless of the module. That's why in core, strings are normally distinct like "Save blocks", "Save string", "Create new revision", "Create content", "Create menu", etc.

icecreamyou’s picture

Okay then. fbsname it is.

icecreamyou’s picture

Status: Reviewed & tested by the community » Fixed

Committed to dev in both branches.

t('!fbsname', array('!fbsname' => $something));

johnnoc’s picture

Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.