[ABD] TimeAgo timestamps

Any abandoned Extensions will be moved to this forum.

WARNING: Extensions in this forum are not currently being supported or maintained by the original Extension author. Proceed at your own risk.
Forum rules
IMPORTANT: Extension Development Forum rules

WARNING: Extensions in this forum are not currently being supported nor updated by the original Extension author. Proceed at your own risk.
User avatar
k0nsl
Registered User
Posts: 88
Joined: Mon Mar 25, 2013 11:17 pm
Location: Scandinavia
Name: Eduard Drehner
Contact:

Re: [DEV] TimeAgo timestamps

Post by k0nsl » Tue Aug 11, 2015 4:06 pm

A minor suggestion, use lower-case characters, like this:

Code: Select all

5 months 4 days ago
I think that looks better.

Best wishes,
-k0nsl
I'm a programmer, server administrator, designer, spokesman and factotum of a wide-variety of web pages.

pitur
Registered User
Posts: 69
Joined: Mon Mar 16, 2015 2:04 am

Re: [DEV] TimeAgo timestamps

Post by pitur » Tue Aug 11, 2015 4:21 pm

I second the lower-case better look. :)

User avatar
DevMakoto
Registered User
Posts: 65
Joined: Tue Jun 23, 2015 3:38 pm
Name: Carlos Mayorga
Contact:

Re: [DEV] TimeAgo timestamps

Post by DevMakoto » Tue Aug 11, 2015 5:50 pm

3Di wrote:
DevMakoto wrote:"ago" translate?
at a certain time in the past
no no, "ago" no view in files language u_u

svennson
Registered User
Posts: 60
Joined: Wed Jun 01, 2005 4:54 pm
Location: Belguim
Contact:

Re: [DEV] TimeAgo timestamps

Post by svennson » Tue Aug 11, 2015 6:10 pm

MuhClaren wrote: Indeed I misunderstood the issue, thanks for clarifying, I understand now. I'll give some thought on how I might wish to approach a solution. You're correct, it's simply a matter of adjusting the plurals conditionally.
Yes, I think david63 already pointed out the problem; I forgot that minutes are "minuten" but 1 minute is "minuut". Ill wait for your next update, in any case thanks for your help & making this extension !

On the positive side, the checkbox now appears on my example.com/forum/ :!:

Thx !

User avatar
MuhClaren
Registered User
Posts: 126
Joined: Sat Feb 21, 2015 5:23 am

Re: [DEV] TimeAgo timestamps

Post by MuhClaren » Wed Aug 12, 2015 9:43 am

k0nsl wrote:A minor suggestion, use lower-case characters, like this:

Code: Select all

5 months 4 days ago
I think that looks better.

Best wishes,
-k0nsl
Your wish is my command. It will be adjusted in the next release. Thanks for the feedback. ;)
svennson wrote: Yes, I think david63 already pointed out the problem; I forgot that minutes are "minuten" but 1 minute is "minuut". Ill wait for your next update, in any case thanks for your help & making this extension !

On the positive side, the checkbox now appears on my example.com/forum/ :!:

Thx !
I've worked this out using the proper rules for plurals. The next release will have 4 levels of plural definitions per period type in order to compensate for languages with more complex plurality syntax. Thank you for helping to make this extension better, and properly handle international language support. Glad to hear that the checkbox is playing nicely now. ;)
DevMakoto wrote:no no, "ago" no view in files language u_u
It will be fixed in the next package release today or tomorrow. Thanks for your feedback! ;)

User avatar
MuhClaren
Registered User
Posts: 126
Joined: Sat Feb 21, 2015 5:23 am

Re: [DEV] TimeAgo timestamps

Post by MuhClaren » Wed Aug 12, 2015 11:46 am

Version 1.2.0 is available for download.

Change log:
  • Add support for 4 levels of plural rules to language files
  • Add language file definition for 'ago'
  • Adjust capitalization of unit labels
  • Re-wrote / cleaned up core function, and added better method documentations
Greetz: Marc, Nicofuma, Elsensee for their support in IRC. A big THANK YOU to the language translators, and the community members helping with suggestions, and providing testing feedback.

User avatar
k0nsl
Registered User
Posts: 88
Joined: Mon Mar 25, 2013 11:17 pm
Location: Scandinavia
Name: Eduard Drehner
Contact:

Re: [DEV] TimeAgo timestamps

Post by k0nsl » Wed Aug 12, 2015 11:55 am

You forgot to lower-case "year/s" :P

Best wishes,
-k0nsl
I'm a programmer, server administrator, designer, spokesman and factotum of a wide-variety of web pages.

User avatar
MuhClaren
Registered User
Posts: 126
Joined: Sat Feb 21, 2015 5:23 am

Re: [DEV] TimeAgo timestamps

Post by MuhClaren » Wed Aug 12, 2015 12:00 pm

k0nsl wrote:You forgot to lower-case "year/s" :P

Best wishes,
-k0nsl
:oops: fixed! :lol:

svennson
Registered User
Posts: 60
Joined: Wed Jun 01, 2005 4:54 pm
Location: Belguim
Contact:

Re: [DEV] TimeAgo timestamps

Post by svennson » Wed Aug 12, 2015 12:23 pm

This is working nicely, just a quick question is it needed to have a 0 translation ? I don't think it will show 1 year 0 months 0 days ...

(working on translation, seems Belgium is different from NL, tho there is no nl-be language in phpBB)

User avatar
MuhClaren
Registered User
Posts: 126
Joined: Sat Feb 21, 2015 5:23 am

Re: [DEV] TimeAgo timestamps

Post by MuhClaren » Wed Aug 12, 2015 12:34 pm

svennson wrote:This is working nicely, just a quick question is it needed to have a 0 translation ? I don't think it will show 1 year 0 months 0 days ...

(working on translation, seems Belgium is different from NL, tho there is no nl-be language in phpBB)
I have the 0 unit definition in there for the case when the output string is less than one second, which doesn't happen in the cloud, but does when it's a local transaction, like on localhost or intranet. It shouldn't cause any issues, however, in either case.

I'm happy to update the langs as soon as they are ready. :D

svennson
Registered User
Posts: 60
Joined: Wed Jun 01, 2005 4:54 pm
Location: Belguim
Contact:

Re: [DEV] TimeAgo timestamps

Post by svennson » Wed Aug 12, 2015 12:39 pm

This is the Dutch translation (technical it is nl-be) Another enhancement you could make is a similar rule for

Code: Select all

'TA_AGO' => 'ago',
while in dutch its correct to use either "geleden" or "terug", in 'general' when the number is 1 we use "terug" while otherwise we use "geleden", but it also depends on the length of the period. Maybe in other languages its a deal-breaker (?) , i'm not sure; In any case, for me this is production-ready :D

Code: Select all

<?php
/**
 * TimeAgo - NL LANGUAGE FILE
 *
 * This file contains the (Dutch - NL) language definitions for
 * the labels used in the ACP extensions tab. Translation provided by
 * SvennD
 *
 * PHP Version 5.4
 *
 * @category    PHP
 * @package     timeago
 * @author      MuhClaren
 * @copyright   2015 (c) MOP
 * @license     GNU General Public License v2
 */
/**
 * DO NOT CHANGE
 */
if (defined('IN_PHPBB') === FALSE)
{
	exit;
}
if (empty($lang) || is_array($lang) === FALSE)
{
	$lang = [];
}
$lang = array_merge(
	$lang,
	[
		# this is a belgium nl translation (http://taaladvies.net/taal/advies/vraag/511/)
		'TA_SECOND'                   => [0 => 'seconden', 1 => 'seconde', 2 => 'seconden', 3 => 'seconden', 4 => 'seconden',],
		'TA_MINUTE'                   => [0 => 'minuten', 1 => 'minuut', 2 => 'minuten', 3 => 'minuten', 4 => 'minuten',],
		'TA_HOUR'                     => [0 => 'uren', 1 => 'uur', 2 => 'uur', 3 => 'uur', 4 => 'uur',],
		'TA_DAY'                      => [0 => 'dagen', 1 => 'dag', 2 => 'dagen', 3 => 'dagen', 4 => 'dagen',],
		'TA_WEEK'                     => [0 => 'weken', 1 => 'week', 2 => 'weken', 3 => 'weken', 4 => 'weken',],
		'TA_MONTH'                    => [0 => 'maanden', 1 => 'maand', 2 => 'maand', 3 => 'maand', 4 => 'maand',],
		'TA_YEAR'                     => [0 => 'jaren', 1 => 'jaar', 2 => 'jaar', 3 => 'jaar', 4 => 'jaar',],
		'TA_DECADE'                   => [0 => 'decennia', 1 => 'decennium', 2 => 'decennia', 3 => 'decennia', 4 => 'decennia',],
		'TA_AGO'                      => 'geleden',
		'TA_OFF'                      => 'Uit',
		'TA_SHORT'                    => 'Kort (1 jaar geleden)',
		'TA_MEDIUM'                   => 'Gemiddeld (1 jaar 2 maand geleden)',
		'TA_FULL'                     => 'Volledig (1 jaar 2 maand 3 dagen geleden)',
		// general settings
		'TA_GENERAL_SETTINGS'         => 'Algemene Instellingen',
		'TA_GENERAL_SETTINGS_EXPLAIN' => 'Configurerbare TimeAgo instellingen',
		'TA_DISPLAY_SETTINGS'         => 'TimeAgo Formaat Opties',
		'TA_CAT'                      => 'index.php',
		'TA_CAT_EXPLAIN'              => 'Activeerd TimeAgo op de category forum lijst voor "Laatste Post"',
		'TA_VIEWFORUM'                => 'viewforum.php',
		'TA_VIEWFORUM_EXPLAIN'        => 'Activeerd TimeAgo op de lijst van topics in forum view',
		'TA_VIEWTOPIC'                => 'viewtopic.php',
		'TA_VIEWTOPIC_EXPLAIN'        => 'Activeerd TimeAgo in elke post',
		'TA_EXTENDED'                 => 'Uitgebreid',
		'TA_EXTENDED_EXPLAIN'         => 'Voeg de standaard phpBB tijdnotatie toe aan het eind van TimeAgo.',
		'TA_EXTENDED_EXAMPLE'         => '(BV. 9 uur geleden (12 Aug 2015 08:07))',
		'TA_DETAIL'                   => 'Gedetaileerd niveau',
	]
);
Thanks for your work!

User avatar
MuhClaren
Registered User
Posts: 126
Joined: Sat Feb 21, 2015 5:23 am

Re: [DEV] TimeAgo timestamps

Post by MuhClaren » Wed Aug 12, 2015 12:55 pm

svennson wrote:This is the Dutch translation (technical it is nl-be) Another enhancement you could make is a similar rule for

Code: Select all

'TA_AGO' => 'ago',
while in dutch its correct to use either "geleden" or "terug", in 'general' when the number is 1 we use "terug" while otherwise we use "geleden", but it also depends on the length of the period. Maybe in other languages its a deal-breaker (?) , i'm not sure; In any case, for me this is production-ready :D
I have noted the clause for "ago" and will keep it in mind. If other languages have the same requirement, I will revisit the code with a solution.

NL translation is updated in the package now. 8-)

Thank you for your contribution!!


User avatar
Dragosvr92
Registered User
Posts: 1450
Joined: Sat Sep 12, 2009 7:27 am
Location: Romania
Name: Dragos Valentin Rădulescu
Contact:

Re: [DEV] TimeAgo timestamps

Post by Dragosvr92 » Wed Aug 12, 2015 7:16 pm

Could you please provide an option to reverse this:

1 Day 2 Hours ago (11 Aug 2015, 19:21) To this?
11 Aug 2015, 19:21 (1 Day 2 Hours ago )

I prefer to have the calculated date between ()

Also, i think it may be easy enough to enable / disable uppercase on the first letter of a word, by using ucfirst() and figure a way to enable, disable that. If you consider the option may be useful. :)
Formerly known as TheKiller
3.0| Avatar on Memberlist 1.0.3

User avatar
MuhClaren
Registered User
Posts: 126
Joined: Sat Feb 21, 2015 5:23 am

Re: [DEV] TimeAgo timestamps

Post by MuhClaren » Wed Aug 12, 2015 7:19 pm

Hello friend. Thank you for your effort. I'd like to make one small request, and that is to modify the file to use the current nested array format which was changed to support plurality requirements of various languages. See the change here: https://github.com/MuhClaren/timeago/bl ... hp#L35-L42

Thank you for your consideration in this.

Locked

Return to “Abandoned Extensions”