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

List:       koffice-devel
Subject:    I18n in koffice scripts
From:       Dag Andersen <danders () get2net ! dk>
Date:       2008-12-04 9:28:40
Message-ID: 200812041028.40341.danders () get2net ! dk
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi,
On kde-i18n-doc@kde.org we have been discussing internationalization of 
strings originating in scripts. Eg I have a python script with:
self.dialog = self.forms.createDialog("Busy Information Import")
where the string pops up in a dialog and should be translated.
We have been around the standard python way _() and the python bindings in 
kdebindings, but as Burkard points out it would be best to avoid dependency on 
kdebindings.
Looking at the code, afaics there are two possibilities:
1) Translation via Kross. It seems it provides interface to the qt tr() 
function. It also seems that there is a desire to *not* depend on kdelibs, so 
i18n* is ruled out, or?
2) Providing access to i18n via KoKross in koffice libs. I tested adding a 
translate() method in KoScriptingModule, and was then able to get strings 
translated by calling KPlato.translate( "text") in my script if "text" existed 
in krossmodulekplato.mo.

Imvvho 2) seems to be the way to go. Opinions? Is there simpler/better way?

Anyhow, we need a eay to mark strings for translation that enables us to 
extract them with extractrc or extractattr.
-- 
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;">Hi,<br> On kde-i18n-doc@kde.org we have been \
discussing internationalization of strings originating in scripts. Eg I have a python \
script with:<br> self.dialog = self.forms.createDialog("Busy Information Import")<br>
where the string pops up in a dialog and should be translated.<br>
We have been around the standard python way _() and the python bindings in \
kdebindings, but as Burkard points out it would be best to avoid dependency on \
kdebindings.<br> Looking at the code, afaics there are two possibilities:<br>
1) Translation via Kross. It seems it provides interface to the qt tr() function. It \
also seems that there is a desire to *not* depend on kdelibs, so i18n* is ruled out, \
or?<br> 2) Providing access to i18n via KoKross in koffice libs. I tested adding a \
translate() method in KoScriptingModule, and was then able to get strings translated \
by calling KPlato.translate( "text") in my script if "text" existed in \
krossmodulekplato.mo.<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>Imvvho 2) seems to be the way to go. \
Opinions? Is there simpler/better way?<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>Anyhow, we need a eay \
to mark strings for translation that enables us to extract them with extractrc or \
                extractattr.<br>
-- <br>
Mvh.<br>
Dag Andersen</p></body></html>



_______________________________________________
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