In the admin interface there are some links that have hardcoded urls.
Eg: <a href="/admin/config/services/twitter/settings">Twitter Settings</a>
Solution: url function should be used and added as a variable for t function.

There are some strings that are sent to t function and use p tag inside.
Eg: <p>You need to authenticate at least one Twitter account in order to use the Twitter API. Please fill out the OAuth fields at <a href="/admin/config/services/twitter/settings">Twitter Settings</a> and then return here.</p>
Solution: p tag should be moved outside.

I used http://drupal.org/node/322774 for reference.

The problem is that if we change those strings we might break translations.
I'll post a patch anyway.

Comments

mfernea’s picture

Status:Active» Needs review
StatusFileSize
new2.95 KB

This is the patch.

joachim’s picture

+++ b/twitter.pages.inc
@@ -89,7 +89,9 @@ function twitter_admin_form($form, &$form_state) {
+    $text = 'You need to authenticate at least one Twitter account in order to use the Twitter API. Please fill out the OAuth fields at <a href="@twitter-settings">Twitter Settings</a> and then return here.';
+    $variables = array('@twitter-settings' => url('admin/config/services/twitter/settings'));
+    $output = '<p>' . t($text, $variables) . '</p>';

I'm pretty sure having the $text outside of the call to t() breaks translation tools.

mfernea’s picture

StatusFileSize
new2.86 KB

Yes, you are right. Thanks!
I'm posting a new patch.

juampy’s picture

Status:Needs review» Fixed
juampy’s picture

Version:7.x-5.x-dev» 7.x-6.x-dev

Ported to 7.x-6.x

juampy’s picture

Version:7.x-6.x-dev» 6.x-5.x-dev
Status:Fixed» Needs work

Patches for 6.x-5.x are welcome.

mfernea’s picture

Assigned:Unassigned» mfernea
Status:Needs work» Patch (to be ported)
mfernea’s picture

Status:Patch (to be ported)» Needs review
StatusFileSize
new2.69 KB

I'm posting a patch for 6.x-5.x branch.

juampy’s picture

Status:Needs review» Fixed

Status:Fixed» Closed (fixed)

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