Hi,

There's no way to translate the strings that appear as @action as in
"Are you sure you want to @action the request to create a %relationship_name relationship to !name?"

Thanks,
Introfini

Comments

sprsquish’s picture

Status: Active » Postponed (maintainer needs more info)

If I were to inject the word directly in to the string

  foreach (array('approve', 'disapprove', 'cancel') as $action) {
    "Are you sure you want to {$action} the request to create a %relationship_name relationship to !name?";
  }

like that. Would that help? You'd be able to do a translation on all three versions of the string.

introfini’s picture

It doesn't seems to work. But this way it works:

t("Are you sure you want to @action the request to create a %relationship_name relationship to !name?", array(
      '@action'             => t($action),
      '%relationship_name'  => $relationship->name,
      '!name'               => theme('username', user_load(array('uid' => ($viewed_id == $relationship->requester_id ? $relationship->requestee_id : $relationship->requester_id))))
    )),

t($action)

introfini

sprsquish’s picture

I don't know anything about the syntax other languages use. I figured that saying "Are you sure you want to {perform some action}" may be very different in other languages. I think that in Japanese it'd end up like "{perform some action}, sure of this you are?" With that in mind just dropping in the name of the action may not always work.

The approach I outlined above means translating three different sentences instead of doing them piecemeal:

  "Are you sure you want to approve the request to create a %relationship_name relationship to !name?"
  "Are you sure you want to disapprove the request to create a %relationship_name relationship to !name?"
  "Are you sure you want to cancel the request to create a %relationship_name relationship to !name?"

With that in mind, is it still a problem?

introfini’s picture

No, for Portuguese there's no problem. Can you give me a patch so I can try?

Thanks.

introfini

sprsquish’s picture

It may not be a problem in Portugues, but other languages use very different syntaxes.

introfini’s picture

Yes I agree with you, but in the present time there's no way to translate this to any language.

Thanks, great module!

introfini

sprsquish’s picture

Would you mind attaching the translation file you've finished so far?

introfini’s picture

StatusFileSize
new5.82 KB

Here it is...

Thanks.

sprsquish’s picture

StatusFileSize
new838 bytes

Okay, I pushed a fix in to -dev that injects the action directly in the string. Now each translation file will need three strings (one for each action).

I'm providing the diff to show how it'll work.

introfini’s picture

Hi,

Thanks, it worked. But there's still a problem, the title in that confirmation form can’t be translated “@action approve”… (the same problem)

introfini

sprsquish’s picture

Status: Postponed (maintainer needs more info) » Fixed

Okay. Fixed in -dev. @actions is now run through t().

I've never needed to provide a translation interface for something I've written. Thanks for your patience with all this.

introfini’s picture

Hi,

All is ok now :-) Thanks!

I’ll be completing the rest of the translation and post it.

Regards,
introfini

Anonymous’s picture

Status: Fixed » Closed (fixed)

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