Language constants - suggestion for new

Discussion corner for Developers of Serendipity.
Post Reply
Don Chambers
Regular
Posts: 3657
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Language constants - suggestion for new

Post by Don Chambers »

Our current language files have constants for entry meta info.... for instance, meta info for an entry might be:

Posted by: john doe on date (or at time) in category1, category2, etc.

So the constants are {$CONST.POSTED_BY}, {$CONST.ON}, {$CONST.AT} and {$CONST.IN}.

The assumption is that the info always flows as author, date/time, categories.

But if you look at a template like bulletproof, where these pieces of information can be shown/hidden, or even split apart, you can see how limiting these current variables are... if I turn off the author, we lose the "Posted by"... so instead, we either we see just the word "in", or that is turned off as well.

What I am suggesting are a few new ones that a template designer can incorporate without the need to have the template itself define these variables:

Code: Select all

@define('BY', 'By');
@define('POSTED_IN', 'Posted in');
@define('POSTED_ON', 'Posted on');
@define('POSTED_AT', 'Posted at');
Thoughts? Is it worth adding to the core?
=Don=
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Language constants - suggestion for new

Post by garvinhicking »

Hi!

The "By" variable is IMHO to global, at least for german the "by" has many variants ("von, vom, durch") which all depend on the verb before "By".

Posted In, Posted On and Posted At look alright to me, but I'm wondering if this should go into the global s9y language file or the template specific one. As for impact, I'd say to put it into bulletproof as long as no other templates make use of it. As soon as other templates would utilize that, we could merge it into core?

The language files are already quite large, so I think it could be generally worth a look on how to optimize those....

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Don Chambers
Regular
Posts: 3657
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Post by Don Chambers »

This is why I typically try to avoid recommendations on language file additions! :wink: I only read and speak English, but other languages will have multiple variations for something that English does not... same with gender specific words.....

Let's avoid the issue for now. Its not that big of a deal. I can work it in at a template level. I might play with it for a bit, and it it looks really worthwhile, I can add it to BP. If it has further proof there, then we can revisit the matter at a global level because it would be ridiculous to have to translate multiple templates with these variables if they could have simply been contained at the global level. Sound good?
=Don=
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Full Ack. :)

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply