Skip Menu |

This queue is for tickets about the DateTime-Format-Natural CPAN distribution.

Report information
The Basics
Id: 62541
Status: open
Priority: 0/
Queue: DateTime-Format-Natural

People
Owner: Nobody in particular
Requestors: sharyanto [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.90
Fixed in: (no value)



Subject: Language module currently limited to EN
I'm currently hacking on DateTime::Format::Natural::Lang::ID. There is a regex check qr!^(?:en)$!i in _init_check() in DateTime/Format/ Natural.pm which prevents loading another language module. Perhaps change this to qr!^\w{2}$! or something? Thanks.
On Fri Oct 29 02:08:16 2010, SHARYANTO wrote: Show quoted text
> I'm currently hacking on DateTime::Format::Natural::Lang::ID.
As I don't speak Indonesian, I was thinking whether a plugin based grammar module inclusion would be suitable now. That ought to be considered definitely at some point since it probably would increase maintenance independence and likely bring code enhancements, too. In order to improve the metadata handling, report the obstacles you encounter while authoring the Indonesian grammar class. Show quoted text
> There is a regex check qr!^(?:en)$!i in _init_check() in DateTime/Format/ > Natural.pm which prevents loading another language module. Perhaps change > this to qr!^\w{2}$! or something?
This literal change would allow for language codes without an according grammar module to bypass the validation, but would fail later due to the module missing. I'd suggest simply changing it to qr!^(?:en|id)$!i for now.
On Fri Oct 29 11:25:54 2010, SCHUBIGER wrote: Show quoted text
> On Fri Oct 29 02:08:16 2010, SHARYANTO wrote:
> > I'm currently hacking on DateTime::Format::Natural::Lang::ID.
> > As I don't speak Indonesian, I was thinking whether a plugin based > grammar module inclusion would be suitable now. That ought to be > considered definitely at some point since it probably would increase > maintenance independence and likely bring code enhancements, too. > > In order to improve the metadata handling, report the obstacles you > encounter while authoring the Indonesian grammar class.
You're right, I did encounter some difficulties and quite a bit of English-ishms (like plural handling, word order, ordinals) as well as things like how there doesn't seem to be an easy way to customize dayframe, etc. So much that I abandoned this approach for now. Show quoted text
> > There is a regex check qr!^(?:en)$!i in _init_check() in DateTime/
Format/ Show quoted text
> > Natural.pm which prevents loading another language module. Perhaps
change Show quoted text
> > this to qr!^\w{2}$! or something?
> > This literal change would allow for language codes without an
according Show quoted text
> grammar module to bypass the validation, but would fail later due to
the Show quoted text
> module missing. I'd suggest simply changing it to qr!^(?:en|id)$!i
for now. Please disregard my previous request and do not add the 'id' to the regex. Sorry for the noise. Regards, Steven