Notice

The forum is in read only mode.

Support Forum

Welcome! Support Forums have been reactivated

Problem with lapsed time and Spanish Translation

6 years 10 months ago
  • Gerard's Avatar
    Topic Author
  • Gerard
  • Offline
  • Junior Boarder
  • Posts: 118
  • Thank you received: 3
Licenses:
JomSocial Expired

Hi,

I detected that there is a problem with lapsed time for activities and Sapnish translation because in some cases when a activity is a time lapse like 1 hour and 21 minutes it appears like: "Hace 1 hora Hace 21 minutos" instead of correct form that must be: "Hace 1 hora y 21 minutos".

The problem is that how are programmed Jomsocial with following strings:

COM_COMMUNITY_LAPSED_YEAR="Hace %1$s año"
COM_COMMUNITY_LAPSED_YEAR_MANY="Hace %1$s años"
COM_COMMUNITY_LAPSED_WEEK="Hace %1$s semanas"
COM_COMMUNITY_LAPSED_WEEK_MANY="Hace %1$s semanas"
COM_COMMUNITY_LAPSED_MONTH="Hace %1$s mes"
COM_COMMUNITY_LAPSED_MONTH_MANY="Hace %1$s meses"
COM_COMMUNITY_LAPSED_DAY="Hace %1$s día"
COM_COMMUNITY_LAPSED_DAY_MANY="Hace %1$s días"
COM_COMMUNITY_LAPSED_HOUR="Hace %1$s hora"
COM_COMMUNITY_LAPSED_HOUR_MANY="Hace %1$s horas"
COM_COMMUNITY_LAPSED_MINUTE="Hace %1$s minuto"
COM_COMMUNITY_LAPSED_MINUTE_MANY="Hace %1$s minutos"
COM_COMMUNITY_LAPSED_SECOND="Hace %1$s segundo"
COM_COMMUNITY_LAPSED_SECOND_MANY="Hace %1$s segundos"

If an activity have only 10 minutes it uses this string COM_COMMUNITY_LAPSED_MINUTES="Hace %1$s minutos" --> It's OK.
But when an activity have 1 hours and 21 minutes it uses both strings COM_COMMUNITY_LAPSED_HOUR="Hace %1$s hora" and COM_COMMUNITY_LAPSED_MINUTE="Hace %1$s minuto" and it looks something like this: "Hace 1 hora Hace 21 minutos" and it's wrong and so ugly.

Thanks for your support!

6 years 10 months ago
  • Dimas's Avatar
  • Dimas
  • Visitor
  • Thank you received: 0
Licenses:

Hi,

So you need to modify this string
COM_COMMUNITY_LAPSED_MINUTE="Hace %1$s minuto"

I dont undertsand how to time lapsed naming on spanish, but on english is like this
COM_COMMUNITY_LAPSED_MINUTE="%1$s minute ago"

on general grammar of time lapsed naming, the minute ago should be on the end after time, seems on spanish this rule is different ::side::

6 years 10 months ago
  • Gerard's Avatar
    Topic Author
  • Gerard
  • Offline
  • Junior Boarder
  • Posts: 118
  • Thank you received: 3
Licenses:
JomSocial Expired

Hi DImas,

Th problem is that if I translate following string

COM_COMMUNITY_LAPSED_MINUTES="y %1$s minutos"

Now when some activity have got some hours and minutes lapsed time it shows correctly but when some activity it has got only some minutes it shows wrong (I attached an image with this).

In spanish is necessary that these sentences start with:

Hace 1 hora y 20 minutos - (for activities with one hour and 20 minutes ago)

Hace 20 minutos - (for activities with 20 minutos ago)

The problem is that for both options it uses same string and in this case it doesn't show correctly at only 20 minutes ago (y 20 minutos instead of Hace 20 minutos)

"Hace" word in spanish it open sentences for hours and minutes but only one time. If there are hours and minutes, it must to use: "Hace X hours and X minutes".

Thanks! :)

Attachments:
The following user(s) said Thank You: Lucio
6 years 10 months ago
  • Dimas's Avatar
  • Dimas
  • Visitor
  • Thank you received: 0
Licenses:

Hi Gerard,

The solution you need change our time helper code for this, but the problem is we cant change our current code because will break another time translation because it designed like it..

if you wanna play with it you can check this file components/com_community/helpers/time.php look at this code

if (!empty($diff['hours'])) {
                if (!empty($diff['minutes'])) {
                    if ( $diff['hours'] == 1 ) {
                        $html .= JText::sprintf('COM_COMMUNITY_LAPSED_HOUR', $diff['hours']) . ' ';
                    }else {
                        $html .= JText::sprintf('COM_COMMUNITY_LAPSED_HOURS', $diff['hours']) . ' ';
                    }
                } else {
                    $html .= JText::sprintf('COM_COMMUNITY_LAPSED_HOURS_AGO', $diff['hours']) . ' ';
                }
            }

            if (($showFull && !empty($diff['hours'])) || (empty($diff['hours']))) {
                if (!empty($diff['minutes'])) {
                    if ( $diff['minutes'] == 1 ) {
                        $html .= JText::sprintf('COM_COMMUNITY_LAPSED_MINUTE', $diff['minutes']) . ' ';
                    }else {
                        $html .= JText::sprintf('COM_COMMUNITY_LAPSED_MINUTES', $diff['minutes']) . ' ';
                    }
                }

            }

thank you!

6 years 8 months ago
Licenses:
JomSocial Active iSEO Active Socialize Active

Did anyone find this topic? I do not see any yet ;-)

6 years 8 months ago
  • Dimas's Avatar
  • Dimas
  • Visitor
  • Thank you received: 0
Licenses:

Hi Lucio,

what is your detail problem, please let us know.

thank you!

6 years 8 months ago
Licenses:
JomSocial Active iSEO Active Socialize Active

The same as I explain Gerard

6 years 8 months ago
  • Dimas's Avatar
  • Dimas
  • Visitor
  • Thank you received: 0
Licenses:

well, this is bit tricky because this behavior cant be changed.. or you hack the code like I explained here www.jomsocial.com/forum/translations/365...h-translation#174670

Moderators: Piotr Garasiński
Powered by Kunena Forum

Join 180,000 websites creating Amazing communities

JomSocial is the most complete, easy-to-use addon that turns Joomla CMS into a
full -fledged, social networking site

TRY NOW BUY NOW