Problem

When the user goes to admin/content/import and clicks on the "configure the settings" link, the webserver reports "page not found" ... the link seems to send the use to the wrong page.

This appears to happen on a Drupal site that is not installed on a path at the webserver root.

Example

Instead of sending the user to:
http://localhost/mydrupalsite/admin/content/import

The link sends the user to:
http://localhost/admin/content/import

Solution

None yet.

CommentFileSizeAuthor
#1 node-export.patch590 bytesstephen.moz

Comments

stephen.moz’s picture

StatusFileSize
new590 bytes

Here is a patch that should fix the issue ...

danielb’s picture

it should really be

  $form['#prefix'] .= "<p>". t("To change this behaviour, !configure.", array("!configure" => l(t("configure the settings"), "admin/settings/node_export"))) ."</p>";

I recommend using that until I update this module

joachim’s picture

Status: Active » Needs work

For better translatability, you should include the whole visible string in the one t() call and only bring in the URL as a placeholder rather than the entire A element:

 $form['#prefix'] .= "<p>" . t('To change this behaviour, <a href="@configure">configure the settings</a>.', array('@configure' => url('admin/settings/node_export'))) . "</p>";
danielb’s picture

That's debatable, I think the placeholder can be enough to indicate the context of the string, with the advantage being that the translator doesn't need to futz with the html. Additionally I think using 'a' tags should never be done, but rather the l() function should decide the html. I know at the moment l() has 'a' tags hardcoded so my statement doesn't quite make sense, but I have a dream that l() will be themeable one day.

joachim’s picture

The API docs disagree with you: http://api.drupal.org/api/function/t

> When using t(), try to put entire sentences and strings in one t() call. This makes it easier for translators, as it provides context as to what each word refers to. HTML markup within translation strings is allowed, but should be avoided if possible. The exception are embedded links; link titles add a context for translators, so should be kept in the main string.

and the examples below in particular.

danielb’s picture

I am aware of what it says, but it doesn't disagree with me, it provides some information about constraints and then provides a possible solution which is inconsistent with the rest of the document. My solution is better and I have given more justification than they have.

Then again there is something to say for consistency and I'm not about to start a t() rebellion.

Not yet.

joachim’s picture

If you do, I would say the best thing would be to have the path filled in with a placeholder somehow, and still keep the whole sentence together. Grammatical rules such as case and gender may mean that in some languages, "configure the settings" can only be correctly translated with reference to the rest of the sentence. Actually, even in French: I can't tell if that string is part of "To configure the settings..." or "Configure the settings in order to..." and both get different verb forms in French.

danielb’s picture

wouldn't it be cool if there was a symbol for doing links, you know instead of !, @, %, etc..
perhaps the way wikipedia does it

danielb’s picture

Status: Needs work » Active

ok I've not had any brilliant ideas on that, so I'll just go with what joachim said.

I've committed it to CVS but I'm getting some very strange responses from cvs.drupal.org so I won't make a release until I see it all went fine in the dev snapshot.

danielb’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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