Changing digits

Hi,

I’ve translated RT for Persian, but the numbers are still printed out
with English digits. Is there anywhere in the code that I can convert
all the digits?

Cheers,
Mostafa

Hi Mostafa,

I’ve translated RT for Persian, but the numbers are still printed out
with English digits. Is there anywhere in the code that I can convert
all the digits?

…that’s something I’ve never actually dealt with in app development.
Can you point me at how some other opensource projects do this?

Dear All,

Is there IDE for mason like Eclipse SDK for perl or Epic can work with mason also.

Please advise me.

Best wishes,

Shaekir,

Send and receive email from all of your webmail accounts.

Hello Shaekir,

Depends on what you’re waiting from IDE. Do you need syntax
highlighting? Some hints? Autocompletion? Most RT developers probably
use vim/emacs. Padre (http://padre.perlide.org/) is probably
interresting thing to look at. It’s under active development and
developers are very interested in feedback, so even if it’s not what
you’re looking for then anyway you can send them your usecase and why
padre is not suitable for you.On Thu, Aug 20, 2009 at 8:33 PM, shaker Khzymshakerramses@hotmail.com wrote:

Dear All,
Is there IDE for mason like Eclipse SDK for perl or Epic can work with
mason also.
Please advise me.
Best wishes,
Shaekir,


Send and receive email from all of your webmail accounts - right from your
Hotmail inbox!


List info: The rt-devel Archives

Best regards, Ruslan.

I accidentally sent it to the wrong address. Sending again.From: Mostafa Hajizadeh mostafa.h@gmail.com
Date: Thu, Aug 20, 2009 at 12:15 PM
Subject: Re: [Rt-devel] Changing digits
To: Jesse Vincent jesse@bestpractical.com
Cc: rt-devel-request@lists.bestpractical.com

Hi Jesse,

In some applications, everything’s done at the module that loads
translations and renders variables into messages. We usually add a few
lines of code to that section. (In Perl it’s just tr/0-9/۰-۹/)

The part that renders variables into messages (like %1 in “%1
tickets”) checks for the language and if it’s “fa” changes the digits
of the number variables from default to Persian.

I guess that’s the way that it should be done for RT too, but since RT
is using a templating system I don’t know where all these things
happen. I tried changing digits at Interface::Web::loc, but it doesn’t
change all the numbers because some numbers aren’t passed to
the loc. (They’re just numbers, no text.)

FYI, there was a game which had 10 messages for “0” to “9” that would
be translated by the translator! I don’t remember exactly, but I guess
it was Frozen Bubble!

Mostafa

Hi Jesse,

In some applications, everything’s done at the module that loads
translations and renders variables into messages. We usually add a few
lines of code to that section. (In Perl it’s just tr/0-9/۰-۹/)

The part that renders variables into messages (like %1 in “%1
tickets”) checks for the language and if it’s “fa” changes the digits
of the number variables from default to Persian.

I guess that’s the way that it should be done for RT too, but since RT
is using a templating system I don’t know where all these things
happen. I tried changing digits at Interface::Web::loc, but it doesn’t
change all the numbers because some numbers aren’t passed to
the loc. (They’re just numbers, no text.)

FYI, there was a game which had 10 messages for “0” to “9” that would
be translated by the translator! I don’t remember exactly, but I guess
it was Frozen Bubble!

It’s a fascinating problem. Locale::Maketext::Lexicon is the right level
to fix this, rather than loc() in RT::Interface::Web. But you’re right.
we don’t currently localize output of all integers. I’d take patches
toward improving that. I’m sorry it hasn’t ever come up before :confused:

In the meantime, would you be up for submitting your base translations
to rosetta? I’m betting that an all-but-numbers transation is better
than no translation.

Best,

Jesse

The part that renders variables into messages (like %1 in “%1
tickets”) checks for the language and if it’s “fa” changes the digits
of the number variables from default to Persian.

I guess that’s the way that it should be done for RT too, but since RT
is using a templating system I don’t know where all these things
happen. I tried changing digits at Interface::Web::loc, but it doesn’t
change all the numbers because some numbers aren’t passed to
the loc. (They’re just numbers, no text.)

It’s a fascinating problem. Locale::Maketext::Lexicon is the right level
to fix this, rather than loc() in RT::Interface::Web. But you’re right.
we don’t currently localize output of all integers. I’d take patches
toward improving that. I’m sorry it hasn’t ever come up before :confused:

I’m glad that you care that much about i18n. I don’t have any concrete
idea about what to do with the numbers, but I’ll try to find things
out and see if I could do something. I will surely send you a patch if
I came up with anything useful.

In the meantime, would you be up for submitting your base translations
to rosetta? I’m betting that an all-but-numbers transation is better
than no translation.

Sure thing, but my translation isn’t finished yet. I was planning to
submit it after I’ve finished all the messages. It’s almost done now
and I’ll submit in a few days.

Also, I’ve done a few other things that I’d like to submit, if they’re
useful to anyone and could be accepted by RT:

  1. Persian (like Arabic and Hebrew) is a right-to-left script and
    displaying RTL scripts in a LTR manner isn’t acceptable. I made a new
    theme, named ‘web2-rtl’ that’s a RTL version of the default theme.

  2. I added a new date format, named Persian, and added a new file,
    Date_Local.pm, with the Persian function that would show Persian
    dates. I also changed CalPopup.html so that it’ll draw Persian
    calendar if the date format is set to ‘Persian’. By clicking on any
    date it’ll insert it’s equivalent Gregorian in the related text box.

Also I’m planning on adding a direction (LTR, RTL) button to the
WYSIWYG editor, but I’ve not done that yet.

BR,
Mostafa

  1. Persian (like Arabic and Hebrew) is a right-to-left script and
    displaying RTL scripts in a LTR manner isn’t acceptable. I made a new
    theme, named ‘web2-rtl’ that’s a RTL version of the default theme.

How different does it need to be? could we embed code in the theme that
looks at the locale and outputs RTL markers conditionally?

  1. I added a new date format, named Persian, and added a new file,
    Date_Local.pm, with the Persian function that would show Persian
    dates.

I’d take that as a patch to the existing date stuff.

I also changed CalPopup.html so that it’ll draw Persian
calendar if the date format is set to ‘Persian’. By clicking on any
date it’ll insert it’s equivalent Gregorian in the related text box.

Cool. Is it possible, using the persian date stuff, to have persian
dates in the text boxes “just work”?

Also I’m planning on adding a direction (LTR, RTL) button to the
WYSIWYG editor, but I’ve not done that yet.

I believe that support is already there. But if not, I’d be much
happier pulling from upstream than forking :wink:

Thanks! I’m looking forward to this

Jesse