Advertisement:

Author Topic: Language bug in BoardIndex.template.php  (Read 13482 times)

Offline spiros

  • Local Moderator
  • SMF Hero
  • *
  • Posts: 1,676
  • Gender: Male
  • A different point of view
    • spiros.doikas on Facebook
    • doikas on LinkedIn
    • @greektranslator on Twitter
    • Greek Translation
Language bug in BoardIndex.template.php
« on: November 22, 2004, 03:33:39 PM »
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:

Code: [Select]
<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:

Code: [Select]
<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 />
« Last Edit: December 28, 2004, 08:02:50 PM by spiros »

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: Language bug in BoardIndex.template.php
« Reply #1 on: November 22, 2004, 08:21:36 PM »
 * The wrong language strings were being used for 'Total Topics'. (BoardIndex template)

-[Unknown]

Offline spiros

  • Local Moderator
  • SMF Hero
  • *
  • Posts: 1,676
  • Gender: Male
  • A different point of view
    • spiros.doikas on Facebook
    • doikas on LinkedIn
    • @greektranslator on Twitter
    • Greek Translation
Re: Language bug in BoardIndex.template.php
« Reply #2 on: December 28, 2004, 05:13:59 AM »
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.

Offline vkot

  • Local Moderator
  • Full Member
  • *
  • Posts: 603
  • Gender: Male
  • @}-'-,--
    • vassiliskotaras on LinkedIn
    • kithara.gr
Re: Language bug in BoardIndex.template.php
« Reply #3 on: December 29, 2004, 05:26:40 AM »
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")
« Last Edit: December 29, 2004, 05:41:54 AM by vkot »
For specialized SMF installation/customization, Web Development, Linux Server Administration, click here.
Για εξειδικευμένες υπηρεσίες στα παραπάνω, πατήστε εδώ.

Offline vkot

  • Local Moderator
  • Full Member
  • *
  • Posts: 603
  • Gender: Male
  • @}-'-,--
    • vassiliskotaras on LinkedIn
    • kithara.gr
Re: Language bug in BoardIndex.template.php
« Reply #4 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
« Last Edit: December 30, 2004, 02:53:08 AM by vkot »
For specialized SMF installation/customization, Web Development, Linux Server Administration, click here.
Για εξειδικευμένες υπηρεσίες στα παραπάνω, πατήστε εδώ.

Offline vkot

  • Local Moderator
  • Full Member
  • *
  • Posts: 603
  • Gender: Male
  • @}-'-,--
    • vassiliskotaras on LinkedIn
    • kithara.gr
Re: Language bug in BoardIndex.template.php
« Reply #5 on: December 30, 2004, 02:39:50 AM »
The previous was in Themes/default/BoardIndex.template.php

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

Code: [Select]
', $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:
Code: [Select]
', $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.
« Last Edit: December 30, 2004, 02:56:53 AM by vkot »
For specialized SMF installation/customization, Web Development, Linux Server Administration, click here.
Για εξειδικευμένες υπηρεσίες στα παραπάνω, πατήστε εδώ.

Offline spiros

  • Local Moderator
  • SMF Hero
  • *
  • Posts: 1,676
  • Gender: Male
  • A different point of view
    • spiros.doikas on Facebook
    • doikas on LinkedIn
    • @greektranslator on Twitter
    • Greek Translation
Re: Language bug in BoardIndex.template.php
« Reply #6 on: December 30, 2004, 12:09:37 PM »
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.

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


Offline spiros

  • Local Moderator
  • SMF Hero
  • *
  • Posts: 1,676
  • Gender: Male
  • A different point of view
    • spiros.doikas on Facebook
    • doikas on LinkedIn
    • @greektranslator on Twitter
    • Greek Translation
Re: Language bug in BoardIndex.template.php
« Reply #7 on: January 16, 2005, 05:25:20 PM »
This problem has been corrected with version 1.0.1