Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
what is the better way of generating an Exception Message?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  12 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
kavith Thiranga  
View profile  
 More options Sep 27 2012, 1:56 am
From: kavith Thiranga <rc404m...@gmail.com>
Date: Wed, 26 Sep 2012 22:56:32 -0700 (PDT)
Local: Thurs, Sep 27 2012 1:56 am
Subject: what is the better way of generating an Exception Message?

Hi all,

What is most preferred way of generating an exception? In a previous thread
<https://groups.google.com/d/msg/joomla-dev-platform/gsozoo4B2Jw/2Ob2w...>,
I was told that JText shouldn't be used.

Thank you.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Elin Waring  
View profile  
 More options Oct 1 2012, 8:08 am
From: Elin Waring <elin.war...@gmail.com>
Date: Mon, 1 Oct 2012 05:08:40 -0700 (PDT)
Local: Mon, Oct 1 2012 8:08 am
Subject: Re: what is the better way of generating an Exception Message?

We're just using plain quoted text (you can't use JText because you can't
count on it being available). You can use sprintf.  here's an example:
https://github.com/joomla/joomla-platform/blob/staging/libraries/joom...

Elin


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Donald Gilbert  
View profile  
 More options Oct 1 2012, 9:26 am
From: Donald Gilbert <dilbert4l...@gmail.com>
Date: Mon, 1 Oct 2012 08:26:04 -0500
Local: Mon, Oct 1 2012 9:26 am
Subject: Re: [jplatform] Re: what is the better way of generating an Exception Message?

Why can't you count on JText being available? This is in the joomla
platform, where JText IS available. If you're talking about for long term -
are there plans to deprecate JText? If so, what is going to be used for
translations of interface elements and language within the platform / cms?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Babker  
View profile  
 More options Oct 1 2012, 9:29 am
From: Michael Babker <mbab...@flbab.com>
Date: Mon, 01 Oct 2012 08:28:57 -0500
Local: Mon, Oct 1 2012 9:28 am
Subject: Re: [jplatform] Re: what is the better way of generating an Exception Message?

The goal is to separate the packages to leave as few dependencies as
possible.  If JText were used for all of the exceptions, then you would
always require the Language package from the platform.  For the project
you're building, you may not need it.

From:  Donald Gilbert <dilbert4l...@gmail.com>
Reply-To:  <joomla-dev-platform@googlegroups.com>
Date:  Monday, October 1, 2012 8:26 AM
To:  <joomla-dev-platform@googlegroups.com>
Subject:  Re: [jplatform] Re: what is the better way of generating an
Exception Message?

Why can't you count on JText being available? This is in the joomla
platform, where JText IS available. If you're talking about for long term -
are there plans to deprecate JText? If so, what is going to be used for
translations of interface elements and language within the platform / cms?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Babker  
View profile  
 More options Oct 1 2012, 9:34 am
From: Michael Babker <mbab...@flbab.com>
Date: Mon, 01 Oct 2012 08:34:32 -0500
Local: Mon, Oct 1 2012 9:34 am
Subject: Re: [jplatform] Re: what is the better way of generating an Exception Message?

I guess a good example would be the upgrade check application I built to
help check system requirements for CMS 3.0.
https://github.com/mbabker/J30UpgradeCheck/tree/master/libraries ­ Notice
how there's a lot of folders missing from the cms, joomla, and legacy trees.
I removed everything that I didn't need to make this package as light-weight
as possible.

From:  Michael Babker <mbab...@flbab.com>
Reply-To:  <joomla-dev-platform@googlegroups.com>
Date:  Monday, October 1, 2012 8:28 AM
To:  <joomla-dev-platform@googlegroups.com>
Subject:  Re: [jplatform] Re: what is the better way of generating an
Exception Message?

The goal is to separate the packages to leave as few dependencies as
possible.  If JText were used for all of the exceptions, then you would
always require the Language package from the platform.  For the project
you're building, you may not need it.

From:  Donald Gilbert <dilbert4l...@gmail.com>
Reply-To:  <joomla-dev-platform@googlegroups.com>
Date:  Monday, October 1, 2012 8:26 AM
To:  <joomla-dev-platform@googlegroups.com>
Subject:  Re: [jplatform] Re: what is the better way of generating an
Exception Message?

Why can't you count on JText being available? This is in the joomla
platform, where JText IS available. If you're talking about for long term -
are there plans to deprecate JText? If so, what is going to be used for
translations of interface elements and language within the platform / cms?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Donald Gilbert  
View profile  
 More options Oct 1 2012, 9:42 am
From: Donald Gilbert <dilbert4l...@gmail.com>
Date: Mon, 1 Oct 2012 08:42:08 -0500
Local: Mon, Oct 1 2012 9:42 am
Subject: Re: [jplatform] Re: what is the better way of generating an Exception Message?

Ok, but the point of a platform is how well the pieces work together. I can
understand decoupling JText, since you may or may not need it if you use
the platform for something besides the CMS, but what then are you going to
use for translations?

How far does this goal reach? Removing all class inter-dependency within a
development platform seems ludicrous to me, because it (very often) breaks
the DRY principle.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Niels Braczek  
View profile  
 More options Oct 1 2012, 11:36 am
From: Niels Braczek <nbrac...@bsds.de>
Date: Mon, 01 Oct 2012 17:36:43 +0200
Local: Mon, Oct 1 2012 11:36 am
Subject: Re: [jplatform] Re: what is the better way of generating an Exception Message?
Am 01.10.2012 15:26, schrieb Donald Gilbert:

> Why can't you count on JText being available? This is in the joomla
> platform, where JText IS available.

*If* it is available. You can't rely on anything from the Framework or
CMS being working during Exceptions.

Regards,
Niels

--
| http://barcamp-wk.de   ·   2. Barcamp Westküste    Frühjahr 2013 |
| http://www.bsds.de   ·   BSDS Braczek Software- und DatenSysteme |
| Webdesign · Webhosting · e-Commerce · Joomla! Content Management |
 ------------------------------------------------------------------


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Babker  
View profile  
 More options Oct 1 2012, 12:44 pm
From: Michael Babker <mbab...@flbab.com>
Date: Mon, 01 Oct 2012 11:44:37 -0500
Local: Mon, Oct 1 2012 12:44 pm
Subject: Re: [jplatform] Re: what is the better way of generating an Exception Message?

All of the exceptions were converted to static text.  This ensures that the
message isn't dependent on a language string being available.  If my project
doesn't need translations, then it's as simple as not including the Language
package (if all other dependencies are broken from it).  If I need
translations, I'll use the Language package and JText since it's a tested
system and works.

As far as breaking all dependencies, I doubt it will happen.  But where
other solutions are available, we're moving in that direction.  There's been
a few commits to the Platform replacing calls to JFile::exists with PHP's
native is_file, for example.  Some things are simple to replace, others need
some work.  In the end though, I think it will improve the overall code
quality of the Platform.

From:  Donald Gilbert <dilbert4l...@gmail.com>
Reply-To:  <joomla-dev-platform@googlegroups.com>
Date:  Monday, October 1, 2012 8:42 AM
To:  <joomla-dev-platform@googlegroups.com>
Subject:  Re: [jplatform] Re: what is the better way of generating an
Exception Message?

Ok, but the point of a platform is how well the pieces work together. I can
understand decoupling JText, since you may or may not need it if you use the
platform for something besides the CMS, but what then are you going to use
for translations?

How far does this goal reach? Removing all class inter-dependency within a
development platform seems ludicrous to me, because it (very often) breaks
the DRY principle.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Louis Landry  
View profile  
 More options Oct 1 2012, 1:11 pm
From: Louis Landry <louislan...@gmail.com>
Date: Mon, 1 Oct 2012 10:11:04 -0700
Local: Mon, Oct 1 2012 1:11 pm
Subject: Re: [jplatform] Re: what is the better way of generating an Exception Message?

Just to follow up on what Niels and Michael have said here, the direction
is not to copy/paste code all over the place un-DRY-ing everything.  The
idea is that separate parts should be separate.  Quite a bit of the
platform was written to bridge gaps in PHP.  Either bridging from PHP4 to
PHP5 (eg. JObject, JSimpleXML) or just filling in things we found as holes
here and there.  In a few places we tried to bridge the gap between PHP
installations such as JFTP, which is designed to use the native FTP methods
if present and fall back on our own implementation if they are not present.
 Not all hosts have the FTP extension installed, and we felt it was
necessary at the time to make things less painful for lots of new users.
 As these things become less necessary we will re-evaluate their lease on
life.

With respect to Exception messages, I am strongly against having
translation within those messages.  The reality of the situation is that
exception messages are for developers, not users.  A well built application
will catch exceptions, inspect them, and then either direct or message the
user gracefully.  As pointed out we don't know if the exception may have
occurred within the mechanism to translate the message, or some dependency
of that translation mechanism.  As a project we are certainly committed to
internationalization and localization, but I don't see the reward vs the
risk on translating exception messages ... especially at the point where
they are thrown.

Lastly, with respect to separation of platform packages, this is something
we want to work towards.  It isn't an absolute, but it is a principle.
 Similarly, DRY is a principle.  Sometimes it is just insane not to repeat
a block of code somewhere else.  Other times it is insane to do so.  One of
our goals is to build the platform in such a way that we can only select
the packages we actually need for a project.  We'll continue to work
towards that end, and also continue to work towards not repeating
ourselves.  When those two principles conflict we will have to assess, make
a judgement call, and move forwards.

I hope that helps.

- Louis


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Donald Gilbert  
View profile  
 More options Oct 1 2012, 1:24 pm
From: Donald Gilbert <dilbert4l...@gmail.com>
Date: Mon, 1 Oct 2012 12:23:46 -0500
Local: Mon, Oct 1 2012 1:23 pm
Subject: Re: [jplatform] Re: what is the better way of generating an Exception Message?

That helps a lot actually. Thanks for clarifying.

This may be a discussion for another thread, as we (I) kind of hijacked the
thread, but the question has been answered, so that's good.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
kavith Thiranga  
View profile  
 More options Oct 2 2012, 3:13 am
From: kavith Thiranga <rc404m...@gmail.com>
Date: Tue, 2 Oct 2012 12:43:25 +0530
Local: Tues, Oct 2 2012 3:13 am
Subject: Re: [jplatform] Re: what is the better way of generating an Exception Message?

hi all,

Got the answer with some great explanations. Thank you all.

On Mon, Oct 1, 2012 at 10:53 PM, Donald Gilbert <dilbert4l...@gmail.com>wrote:

> That helps a lot actually. Thanks for clarifying.

> This may be a discussion for another thread, as we (I) kind of hijacked
> the thread, but the question has been answered, so that's good.

--
Kavith Thiranga Lokuhewage,
Undergraduate,
BSc (Hons) Software Engineering,
Staffordshire University, UK.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
JM Simonet  
View profile  
 More options Oct 5 2012, 4:31 am
From: JM Simonet <infograf...@gmail.com>
Date: Fri, 5 Oct 2012 10:31:05 +0200
Local: Fri, Oct 5 2012 4:31 am
Subject: Re: [jplatform] Re: what is the better way of generating an Exception Message?

I have no issue with not translating Exception messages.
What would be handy though is to get regularly the list of JLIB
strings we can safely take off from the .ini files.
This would greatly help new Transators as they would not have to
translate these.

JM

--
>Please keep the Subject wording in your answers

This e-mail and any attachments may be confidential. You must not
disclose or use the information contained in this e-mail if you are
not the
intended recipient. If you have received this e-mail in error, please
notify us immediately and delete the e-mail and all copies.
-----------------------------------------------------------
Jean-Marie Simonet  /  infograf768
Joomla Production Working group
Joomla! Translation Coordination Team

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »