[Freeipa-devel] resend: internationalization of kid templates

Masato Taruishi taruishi at redhat.com
Fri Feb 1 15:33:24 UTC 2008


2008-01-31 (木) の 14:59 -0500 に Rob Crittenden さんは書きました:
> Masato Taruishi wrote:
> > Ah, I'm very sorry about my late reply.
> > I missed your reply.
> 
> No worries.
> 
> > 
> >> Masato Taruishi wrote:
> >>> Hi,
> >>>
> >>> I wrote a patch to internationalize kid templates. In addition
> >>> to the general internationalization, the patch also includes
> >>> the japanese po file. Please see the attached screenshots.
> >>> Of cource, this patch supports the content negotiation feature
> >>> so you can see the English page, too.
> >>>
> >>> I haven't internationalize javascript and python messages yet
> >>> because it requires utf-8 safe. I guess it's a next work for
> >>> i18n related tasks. 
> >>>
> >>> I hope this would help internationalization support of freeipa.
> >>>
> >>> Thanks
> >>> Best regards
> >>
> >> Hi. I'm reviewing your patch now and it looks ok, I just have a couple
> >> of question.
> >>
> >> What do we need to do on an ongoing basis to be sure that the messages
> >> stay up-to-date? Will we need to run something every time we make a
> >> change to a kid file?
> > 
> > You can collect the template pot file by running the following command:
> > 
> > ~/ipa-server/ipa-gui$ tg-admin i18n collect
> > 
> > which creates locales/messages.pot. However, unfotunately, the above
> > command doesn't work correctly for .kid files unless you apply the
> > following patch:
> > 
> > --- /usr/lib/python2.5/site-packages/turbogears/command/i18n.py
> > 2007-07-22 05:08:37.000000000 +0900
> > +++ i18n.py     2008-01-31 01:02:13.000000000 +0900
> > @@ -251,7 +251,12 @@
> >                  if self.options.loose_kid_support or el.get('lang',
> > None):
> >                      tag = re.sub('({[^}]+})?(\w+)', '\\2', el.tag)
> >                      ents = []
> > -                    if el.text: ents = [el.text.strip()]
> > +                    if el.text and not ( el.text.strip() in keys):
> > +                        if el.tag == "script":
> > +                            ents = [el.text.strip()]
> > +                        else:
> > +                            messages.append((tag, fname,
> > el.text.strip()))
> > +                            keys.append(el.text.strip())
> >                      if el.attrib: ents.extend(el.attrib.values())
> >                      for k in ents:
> >                          key = None
> 
> How often would we be expected to run this? I assume that ideally we 
> should do it with any update to the kid files, just to keep things in 
> sync, right?

right.

> > 
> >> The .po files have a header. Currently the translator field is empty. Is
> >> it common for this to be the default, FULL NAME <EMAIL at ADDRESS>?
> > 
> > Ah, I forgot to change that to my name. Can you change it
> > to my name?
> 
> Sure.
> 
> > 
> >> It pulled in some pure code in some cases. It looks like:
> >>
> >> +#: ipagui/templates/ipapolicyshow.kid:td
> >> +msgid "${ipapolicy.get(\"ipasearchtimelimit\")}"
> >> +msgstr ""
> >>
> >> Should we leave these in there or remove them?
> > 
> > Or use py:content for the code in the td tag.
> 
> And I assume this is something we could go back to and fix later?

Yes.

> One last question. How would you recommend packaging? Would we want a 
> separate package that contained the .pot file(s) for each language?

No. We don't need to several packages because it's not large.

Thanks

> thanks
> 
> rob




More information about the Freeipa-devel mailing list