[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    Re: I18n in koffice scripts
From:       Dag Andersen <danders () get2net ! dk>
Date:       2008-12-17 10:14:27
Message-ID: 200812171114.27651.danders () get2net ! dk
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


On Mandag 15 december 2008 21:43:04 Albert Astals Cid wrote:
> A Dilluns 15 Desembre 2008, Dag Andersen va escriure:
> > Ok, I've been around the block a few times more, so I'll try to sum up my
> > findings.
> > First the premisses for this:
> > I want to have some scripts translated :)
> > These scripts are always run from within a koffice application (eg
> > kplato) and can be regarded as an extension/part of that applications
> > functionallity. This means that the user expects the language (and locale
> > in general) to be the same as the rest of the application.
> >
(snip)
>
> IMHO it makes much more sense to it to be in kross and not in kokross, any
> other program using kross will have the same problem than KPlato is facing
> now. kross core already depends on a load of kdelibs libs using KIcon,
> KUrl, KMimeType, KStandardDirs, i18n, etc.
Yes, ok, last attempt.
I have created a new module "kdetranslation" in kross/modules (not committed) 
that encapsulates the i18n* methods. Use in python:
import Kross
t = Kross.module("kdetranslation")
print t.i18n("This string can be translated")

This is implemented in kdelibs/kross/modules so it is availabale to all kde 
scripts, and it doesn't depend on core being kde, so if core i's moved later, 
no problem.
Why not just stuff it into the "forms" module? Well, I think this is cleaner.
Sebastian, is this ok with you?

Message extraction:
For python scripts, it seems we can use the keywords etc set up by 
extract-messages.sh, just adding ---language=Python. See attatched file. Since 
the full i18n* functionallity is available I thought all messages could go 
into the same pot file. Ok?

Ruby is not handled by xgettext so I don't know haw to do it. It has it's own 
gettext stuff but I haven't tested it.

>
> So even some might think dropping KDE from kross is a good idea i don't see
> it can happen easily as Qt does not have things to replace KMimeType or
> KStandardDirs for example.
>
> But then, i'm obviously not kross maintainer nor and the single patch i
> commited does not make me even a developer of it, so feel free to ignore my
> opinion :-D
I'm also not the maintainer ;)
>
> Albert
-- 
Mvh.
Dag Andersen

[Attachment #5 (text/html)]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" \
"http://www.w3.org/TR/REC-html40/strict.dtd"><html><head><meta name="qrichtext" \
content="1" /><style type="text/css">p, li { white-space: pre-wrap; \
}</style></head><body style=" font-family:'Sans Serif'; font-size:10pt; \
font-weight:400; font-style:normal;">On Mandag 15 december 2008 21:43:04 Albert \
Astals Cid wrote:<br> &gt; A Dilluns 15 Desembre 2008, Dag Andersen va escriure:<br>
&gt; &gt; Ok, I've been around the block a few times more, so I'll try to sum up \
my<br> &gt; &gt; findings.<br>
&gt; &gt; First the premisses for this:<br>
&gt; &gt; I want to have some scripts translated :)<br>
&gt; &gt; These scripts are always run from within a koffice application (eg<br>
&gt; &gt; kplato) and can be regarded as an extension/part of that applications<br>
&gt; &gt; functionallity. This means that the user expects the language (and \
locale<br> &gt; &gt; in general) to be the same as the rest of the application.<br>
&gt; &gt;<br>
(snip)<br>
&gt;<br>
&gt; IMHO it makes much more sense to it to be in kross and not in kokross, any<br>
&gt; other program using kross will have the same problem than KPlato is facing<br>
&gt; now. kross core already depends on a load of kdelibs libs using KIcon,<br>
&gt; KUrl, KMimeType, KStandardDirs, i18n, etc.<br>
Yes, ok, last attempt.<br>
I have created a new module "kdetranslation" in kross/modules (not committed) that \
encapsulates the i18n* methods. Use in python:<br> import Kross<br>
t = Kross.module("kdetranslation")<br>
print t.i18n("This string can be translated")<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;"><br></p>This is implemented in kdelibs/kross/modules so it is \
availabale to all kde scripts, and it doesn't depend on core being kde, so if core \
i's moved later, no problem.<br> Why not just stuff it into the "forms" module? Well, \
I think this is cleaner.<br> Sebastian, is this ok with you?<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;"><br></p>Message extraction:<br> For python scripts, it seems we \
can use the keywords etc set up by <br> extract-messages.sh, just adding \
---language=Python. See attatched file. Since the full i18n* functionallity is \
available I thought all messages could go into the same pot file. Ok?<br> <p \
style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; \
margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;"><br></p>Ruby is not handled by xgettext so I don't know haw to do \
it. It has it's own gettext stuff but I haven't tested it.<br> <p \
style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; \
margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;"><br></p>&gt;<br> &gt; So even some might think dropping KDE from \
kross is a good idea i don't see<br> &gt; it can happen easily as Qt does not have \
things to replace KMimeType or<br> &gt; KStandardDirs for example.<br>
&gt;<br>
&gt; But then, i'm obviously not kross maintainer nor and the single patch i<br>
&gt; commited does not make me even a developer of it, so feel free to ignore my<br>
&gt; opinion :-D<br>
I'm also not the maintainer ;)<br>
&gt;<br>
&gt; Albert<br>
-- <br>
Mvh.<br>
Dag Andersen</p></body></html>


["Messages.sh" (application/x-shellscript)]

#! /bin/sh
$EXTRACTRC *.ui *.rc > rc.cpp || exit 11
$EXTRACTATTR --attr=collection,text --attr=collection,comment --attr=script,text \
--attr=script,comment scripts/*.rc >> rc.cpp || exit 11 $XGETTEXT --force-po *.cpp -o \
$podir/krossmodulekplato.pot $XGETTEXT --language=Python --join scripts/*.py -o \
$podir/krossmodulekplato.pot



_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic