1 guizi6 Feb 22, 2008 05:19
3 guizi6 Feb 22, 2008 22:54
Hi, Afwas,
You resolved my problem, although I am still puzzled.
I should added that the error was reported in the column of "Action", for each row listed.
With your trick, I first identified the troubled string which turns out as the "Del" translation as shown below as in the messages.po file.
#. TRANS: Abbrev. for Delete (stats)
#: ..\..\..\conf\_icons.php:99
#: ..\..\..\conf\_icons.php:306
#: ..\..\..\inc\sessions\views\_stats_direct.view.php:63
msgid "Del"
I noticed that the translated string, which does not contain a quote in it, somehow mysterously becomes a string containing a single quote under the debug mode. I am not sure if this is due to the character-set swaping.
However, this same icon and the translation related to it apparently is also used in other screen, such as Regional (Setting) screen. And there is no problem found under other cases.
At any way, the quick solution I am using right now is changing the translation. And then it works charmingly.
Thanks a thousand! You have a nice weekend.
4 afwas Feb 22, 2008 23:13
hi guizi6,
Nice you solved the problem.
I more or less expected what you described: the translated text is still not displayed in the charset that it is supposed to be displayed. Unfortunately this is an internal thing from B2evo and we cannot fix it at the moment. Note that the phpBB forum we are using here has exactly the same problem - the text in the posts is correct but not the post in the titles.
Happu blogging
5 guizi6 Mar 05, 2008 23:47
Hi, Afwas,
I have another question related to the "view" in the skin and translation.
I notice that the word of "No views", "1 view", "%d views" has been hardcoded in the program, possibly _item.class.php. Meanwhile, there are no translation "placeholders" for those three defined in the messages.po file. Therefore, the returned string is displayed as is.
My quesiton is, how can this be fixed so that this data can be displayed with the localized labels.
Thanks.
6 afwas Mar 06, 2008 00:10
Inc/Items/Model/_item.class.php lines 2543 - 2573:
function get_views( $zero = '#', $one = '#', $more = '#' )
{
if( !$this->views )
{
$r = ( $zero == '#' ? T_( 'No views' ) : $zero );
}
elseif( $this->views == 1 )
{
$r = ( $one == '#' ? T_( '1 view' ) : $one );
}
else
{
$r = ( $more == '#' ? T_( '%d views' ) : $more );
}
return str_replace( '%d', $this->views, $r );
}
Lines 7090 - 7094 - 7099 in the German .po file. It is in all translation files in the package for B2evo 2.4.
Do have another look.
Good luck
7 guizi6 Mar 06, 2008 03:34
Thanks Afwas for pointing me to the direction! After reading your message, I just went back and re-searched the messages.po file I am working on, and found all three placeholders are all there!
I guess I was looking for "views" at first. But when I found out there should be three strings, I forgot to go back to messages.po and look again. Sorry for this stupid question.
8 afwas Mar 06, 2008 04:10
:lol:
Hi guizi6,
I looked into this problem with the information you provided. Of course I don't have the translation and if I did, I wouldn't be able to read it. But your description of the problem gave some clues to go after.
This is the snippet that causes the warning / error. I added line numbers:
I removed the pound sign (#) from line 1171 so I had a look at the page in debug mode. There are a few strings that are in the translation files.
The error T_CONSTANT_ENCAPSED_STRING means there is some text in quotes (either single or double) that shouldn't be inside quotes.
I think you want to turn off the translation, view the page, note the English taxt and find that text within the translation. Now watch carefully for any quotes (single or double) within the zh_CH translation. If you find them, remove.
I hope this helps you find the problem.
Good luck