Skip to content

Commit

Permalink
next attempt for footer line after comment by @Krinkle in commit e4e82f9
Browse files Browse the repository at this point in the history
  • Loading branch information
FlominatorTM committed Apr 5, 2016
1 parent 0756819 commit d1cd95e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion foto_range.php
Expand Up @@ -49,7 +49,8 @@
echo " - ";
echo '<a href="foto_check.php">'. $I18N->msg( 'check_users') . '</a>';
echo ' - by <a href="http://de.wikipedia.org/wiki/Benutzer:Flominator">Flominator</a>';
echo $I18N->getPromoBox( 32, TSINT_HELP_ALL );
echo $I18N->getFooterLine( TSINT_HELP_ALL );

function print_debug($str)
{
global $is_debug;
Expand Down

5 comments on commit d1cd95e

@FlominatorTM
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Krinkle Thanks for your comment. Like this it still shows the "change language" link which goes to some labs website and from there presents error 404. What am I doing wrong?

@Krinkle
Copy link

@Krinkle Krinkle commented on d1cd95e Apr 5, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@FlominatorTM What do you want exactly?

See documentation at https://github.com/Krinkle/intuition/wiki/Documentation#backlinks, with examples at https://tools.wmflabs.org/intuition/demo/demo5.php.

Can you point to where this script is hosted/executed? What HTML output do you get?

@FlominatorTM
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Krinkle Thanks for the fast reply.

I am not completely sure, how "change language" is supposed to work in general for tools not hosted on tools.wmflabs.org. Is it supposed to go there anyway in order to "do some cookie/session magic" and return to my script or is it supposed just to call something in my script (e.g. GET parameter) to set the UI language?

A test version of the script can be found at http://wikipedia.ramselehof.de/nearest_april/foto_range.php

@Krinkle
Copy link

@Krinkle Krinkle commented on d1cd95e Apr 6, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On Tool Labs, most tool authors (and tool users) prefer to not have to set their preferred language for every tool separately. They also prefer to be able to modify, clear, renew and see those settings in a central place.

The intuition dashboard provides that. It's by no means mandatory however. You can call $I18N->setCookie( 'userlang', $langCode ); directly from your own tool (e.g. via a dropdown menu, popup or preference page in your own tool).

The change language link is a convenience feature for tools that prefer to point to a central portal instead of creating their own interface.

On that page, users can change their preference, submit the form. This will save the cookie and redirect them back where they came from.

The 404 error is probably because it redirects back to something on Tool Labs (where this tool doesn't exist). I could customise the redirect logic to support passing a hostname, but this wouldn't be very useful since it will only fix the 404 error. It still won't do what it is supposed to do, which is setting a cookie on your domain. (And it couldn't. Your own intuition install has to do that.)

Letting it communicate underneath could work, but I'd prefer not. This gets tricky with version conflicts over time, and additionally will be confusing due to the data mismatch. E.g. you'd visit the Tool Labs portal but it won't match the language setting for your tool. So it shouldn't be in charge of that.

You could host your own Intuition portal (just expose public_html somewhere), but that might be a bit overkill. I'd suggest creating a simple interface and call setCookie() yourself.

See https://github.com/Krinkle/intuition/blob/v0.2.3/public_html/index.php for the code behind the Intuition portal. Mainly Intuition::getAvailableLangs(), Intuition::getLang(), and Intuition::setCookie().

@FlominatorTM
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Krinkle Thanks for the very helpful reply. Maybe you want to include this text in your project documentation/wiki?

Please sign in to comment.