Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
use of language strings in new admin lists
The new lists showing articles, images, files etc. under the content tab have a small issue concerning the use of language strings:
There are 2 links called “Edit” and “View”. The last one reuses the language string for “View … per page”. Could these two things be seperated? Would be nice for a more meaningful translation :)
Thanks!
Offline
Re: use of language strings in new admin lists
In addition: It seems that “manage” under comments in the article list is not localisable.
Offline
Re: use of language strings in new admin lists
And another one: Found the “view” problem again on the plugin tab (help column)
Offline
#4 2006-08-10 14:51:59
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: use of language strings in new admin lists
A lot of this kind of thing is still around from years back, doing silly things you can’t expect from another language, like building a sentence this way:
function messenger($thing,$thething,$action)
{
return gTxt($thing).' '.strong($thething).' '.gTxt($action);
}
Which, expects the sentence to be structured exactly the same way as english. Sometimes it’s possible, but usually, it’s not. I’ve been converting them as I find them.
Keep in mind that, when I create new ones for these, some things will “disappear” until whichever translator updates their translation.
Offline
Re: use of language strings in new admin lists
Keep in mind that, when I create new ones for these, some things will “disappear” until whichever translator updates their translation.
But wouldn’t the string itself be returned, if it wasn’t translated yet?
I really would appreciate a change of the actual translation posibilities in these cases :)
Offline
Re: use of language strings in new admin lists
[1667] Allow “View per page” to be properly translated.
Thanks :)
Offline
Re: use of language strings in new admin lists
So here I am again:
Would it be possible to fix this problem the same way as you did it with “View per page”?
Something like “{time} ago” as language string so that it would be possible to have a German string like that: “vor {time}”?
Offline
#8 2006-08-10 17:16:21
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: use of language strings in new admin lists
But wouldn’t the string itself be returned, if it wasn’t translated yet?
Some are new strings, so yes. It’s not quite what I meant – sometimes it makes more sense to refactor existing ones, rather than create a new strings, so those will act odd. I encountered that in the admin tab, for example.
So here I am again:
Would it be possible to fix this problem the same way as you did it with “View per page”?
Sure, I think so.
Offline
Re: use of language strings in new admin lists
Just as an idea – what about modifying gTxt() to handle these cases:
function gTxt($var, $thing = '')
{
global $textarray;
if(isset($textarray[strtolower($var)]))
{
$out = $textarray[strtolower($var)];
if($thing)
{
$out = str_replace('{thing}', $thing, $out);
}
return $out;
}
return $var;
}
Offline
#10 2006-08-10 19:27:29
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: use of language strings in new admin lists
One problem would be that you’d be limited to only one replacement string. That’s not to say a better solution isn’t needed.
Offline
Re: use of language strings in new admin lists
So give me another try :)
echo gTxt('some_things', array('drink' => 'coke', 'food' => 'pizza'))
function gTxt($var, $thing = '')
{
global $textarray;
if(isset($textarray[strtolower($var)]))
{
$out = $textarray[strtolower($var)];
if($thing)
{
foreach($thing as $name => $value)
{
$out = str_replace('{'.$name.'}', $value, $out);
}
}
return $out;
}
return $var;
}
Offline
#12 2006-08-11 08:53:43
- zem
- Developer Emeritus

- From: Melbourne, Australia
- Registered: 2004-04-08
- Posts: 2,579
Re: use of language strings in new admin lists
Meanwhile, 200 revs earlier...
echo gTxt('foo', array('{bar}' => 'baz'));
Alex
Offline