Language bug in BoardIndex.template.php

Started by spiros, November 22, 2004, 03:33:39 PM

Previous topic - Next topic

spiros

It took me quite a while to work this out and here it is:

In the forum stats box among other things we have
   
Total Topics:
Total Posts:
Total Members:

Now, ideally there should be one textual reference for each one of these (i.e. $txt[490] which stands for Total Topics). Instead, there were 2 different textual references for each one of these. And this is OK in languages were both "Total", "Topics" and "Total Topics" have the same structure but not OK with languages like Greek were topics in "Total Topics" is different than "Topics" on its own.

This is the original code:

<div style="float: left; width: 50%;">', $txt[94], ' ', $txt[64], ': <b>', $modSettings['totalTopics'], '</b></div>', $txt[94], ' ', $txt[95], ': <b>', $modSettings['totalMessages'], '</b><br />', !empty($context['latest_post']) ? '
' . $txt[659] . ': &quot;' . $context['latest_post']['link'] . '&quot;  (' . $context['latest_post']['time'] . ')<br />' : '', '
<a href="', $scripturl, '?action=recent">', $txt[234], '</a>', $context['show_stats'] ? '<br />
<a href="' . $scripturl . '?action=stats">' . $txt['smf223'] . '</a>' : '', '
</td>
<td width="32%" class="smalltext" valign="top">
', $txt[94], ' ', $txt[19], ': <b><a href="', $scripturl, '?action=mlist">', $modSett


Below you can see the changes I made to the boardindex.template.php   to correct this problem:

<div style="float: left; width: 50%;">', $txt[490], ': <b>', $modSettings['totalTopics'], '</b></div>', $txt[489], ': <b>', $modSettings['totalMessages'], '</b><br />', !empty($context['latest_post']) ? '
' . $txt[659] . ': &quot;' . $context['latest_post']['link'] . '&quot;  (' . $context['latest_post']['time'] . ')<br />' : '', '
<a href="', $scripturl, '?action=recent">', $txt[234], '</a>', $context['show_stats'] ? '<br />
<a href="' . $scripturl . '?action=stats">' . $txt['smf223'] . '</a>' : '', '
</td>
<td width="32%" class="smalltext" valign="top">
', $txt[488], ': <b><a href="', $scripturl, '?action=mlist">', $modSettings['memberCount'], '</a></b><br />

[Unknown]

 * The wrong language strings were being used for 'Total Topics'. (BoardIndex template)

-[Unknown]

spiros

The wrong language strings were being used not only for Total Topics but for Total Posts and Total Members as well. If other translators have problems with this please use my replacement code above.

vkot

#3
spiros is right. In greek, the words "Topics/Posts/Members" in the phrases "Total Topics/Posts/Members" have other form.
Can't we all use $txt[488], $txt[489], $txt[490] where spiros says? Will there be a problem in other languages? If no, I hope it'll be corrected before 1.0 release. If yes, we must include the corrected BoardIndex.template.php  in the greek translation.

(maybe this thread should be under "SMF Coding Discussion")
For specialized SMF installation/customization, Web Development, Linux Server Administration, click here.
Για εξειδικευμένες υπηρεσίες στα παραπάνω, πατήστε εδώ.

vkot

#4
I just saw the official 1.0 release. (congratulations!)
BoardIndex.template.php has been partially corrected. Still, the strings of "Total Posts" and "Total Members" have to be changed
For specialized SMF installation/customization, Web Development, Linux Server Administration, click here.
Για εξειδικευμένες υπηρεσίες στα παραπάνω, πατήστε εδώ.

vkot

#5
The previous was in Themes/default/BoardIndex.template.php

In Themes/classic/BoardIndex.template.php substitute:

', $txt[490], ': <b>', $modSettings['totalTopics'], '</b> &nbsp;&nbsp;&nbsp;&nbsp; ', $txt[94], ' ', $txt[95], ': <b>', $modSettings['totalMessages'], '</b><br />
', !empty($context['latest_post']) ? $txt[659] . ':
&quot;' . $context['latest_post']['link'] . '&quot;  (' . $context['latest_post']['time'] . ')<br />' : '', '
<a href="', $scripturl, '?action=recent">', $txt[234], '</a>', $context['show_stats'] ? '<br />
<a href="' . $scripturl . '?action=stats">' . $txt['smf223'] . '</a>' : '', '
</td>
<td class="smalltext">
', $txt[94], ' ', $txt[19], ': <b>', $context['show_member_list'] ? '<a href="' . $scripturl . '?action=mlist">' . $modSettings['memberCount'] . '</a>' : $modSettings['memberCount'], '</b><br />


with:
', $txt[490], ': <b>', $modSettings['totalTopics'], '</b> &nbsp;&nbsp;&nbsp;&nbsp; ', $txt[489], ': <b>', $modSettings['totalMessages'], '</b><br />
', !empty($context['latest_post']) ? $txt[659] . ':
&quot;' . $context['latest_post']['link'] . '&quot;  (' . $context['latest_post']['time'] . ')<br />' : '', '
<a href="', $scripturl, '?action=recent">', $txt[234], '</a>', $context['show_stats'] ? '<br />
<a href="' . $scripturl . '?action=stats">' . $txt['smf223'] . '</a>' : '', '
</td>
<td class="smalltext">
', $txt[488], ': <b>', $context['show_member_list'] ? '<a href="' . $scripturl . '?action=mlist">' . $modSettings['memberCount'] . '</a>' : $modSettings['memberCount'], '</b><br />


With all the previous changes, $txt[94] is not of use anymore.
For specialized SMF installation/customization, Web Development, Linux Server Administration, click here.
Για εξειδικευμένες υπηρεσίες στα παραπάνω, πατήστε εδώ.

spiros

Thanks vkot for letting us know that the suggested changes have been partially implemented. I think this is an important matter and the coding people should look into it ASAP.

Quote from: vkot on December 30, 2004, 02:01:03 AM
I just saw the official 1.0 release. (congratulations!)
BoardIndex.template.php has been partially corrected. Still, the strings of "Total Posts" and "Total Members" have to be changed


spiros

This problem has been corrected with version 1.0.1

Advertisement: