Needs work
Project:
Nodequeue
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
25 Dec 2008 at 12:08 UTC
Updated:
4 Apr 2013 at 07:03 UTC
Jump to comment: Most recent file
Comments
Comment #1
ezra-g commentedGood point -- We should translate the custom links.
Comment #2
Ali Majdzadeh Kohbanani commentedThanks, hope to see that working in future releases. By the way, thanks a lot for such a nice module.
Kind Regards
Ali Majdzadeh Kohbanani
Comment #3
pfaocleComment #4
fmjrey commentedYeah, would be great to have these translatable.
I'm no php developer but here are some pointers on how to do this:
http://drupal.org/node/579722#comment-3114550
Comment #5
jaydub commentedPart of the problem here is that variables are not supposed to be passed to the t() function which given that the add / remove from queue link strings here are undefined in the module code they are variable and thus not a candidate for use by t().
From API docs: http://api.drupal.org/api/function/t/6
"Because t() is designed for handling code-based strings, in almost all cases, the actual string and not a variable must be passed through t().
Extraction of translations is done based on the strings contained in t() calls. If a variable is passed through t(), the content of the variable cannot be extracted from the file for translation."
See more discussion on this subject here:
http://groups.drupal.org/node/15177
Comment #6
boum commentedHi everybody,
I find the solution to this problem.
On the nodequeue.module line 2278, you have to change :
$text = str_replace('%subqueue', $subqueue->title, $text);by
$text = str_replace('%subqueue', t($subqueue->title), t($text));So, you can add translation for your add/ remove link like :
Remove from the %subqueue listing ->Retirer du listing %subqueue
Add to the %subqueue listing : Ajouter au listing %subqueue
You can also add translation for your subqueue title
Comment #7
fmjrey commentedHere's the patch against 6.x-2.x-dev corresponding to comment #6.
My editor removes unnecessary spaces, these are in the patch as well.
Comment #8
fmjrey commentedHere's the patch against HEAD corresponding to comment #6.
My editor removes unnecessary spaces, these are in the patch as well.
Comment #9
fmjrey commentedComment #10
ezra-g commentedPassing in t($text) as the 3rd (subject) seems like awkward use of str_replace().
Wouldn't correct use of t() really call for
$title = t($title, array('%subqueue' => $subqueue->title));?Comment #11
amateescu commentedjaydub is correct in #5, we can't use t() for user defined strings. The solution here would be to use i18nstrings from the i18n module.
Comment #12
shadysamir commentedNothing on this yet?
Comment #13
Chris CharltonAny further testing needed?