Home Forums Wiki Doc Install Extras Screenshots Source Code Projects Blog Users Groups Register
Glx-Dock / Cairo-Dock List of forums Applets | Applets Translator (formally doCkranslator)
The latest stable release is the *3.4.0* : How to install it here.
Note: We just switched from BZR to Git on Github! (only to host the code and your future pull requests)
Applets | Applets

Subjects Author Language Messages Last message
Translator (formally doCkranslator)
Page : 1 2 3 4 5
Eduardo Mucelli English 84 Guest [Read]
05 June 2018 à 07:24

fabounet, Friday 14 January 2011 à 13:20 | Quote


Subscription date : 30 November 2007
Messages : 17118
woot, that's nice !
what about using some html markups to emphasize the categories ?
like <b>verb</b>

you can do that with PopupDialog by adding the key
"use-markup" : true
in the dialog attributes.

Eduardo Mucelli, Friday 14 January 2011 à 14:16 | Quote


Subscription date : 05 August 2009
Messages : 285
At first, I was trying to do that, but did not accomplish because I realized now that the text is already bold, therefore, I thought it was not working. I defined an italic style -- updated the picture. Thanks.

fabounet, Friday 14 January 2011 à 15:27 | Quote


Subscription date : 30 November 2007
Messages : 17118
probably your dialog font which is bold ?
for people who don't have this, it would be nice to have those words bold too

Eduardo Mucelli, Saturday 15 January 2011 à 00:46 | Quote


Subscription date : 05 August 2009
Messages : 285
Yea. I just pushed a version with Italic markup. Well, thats a matter of style -- and I'm not the reference to this subject

Eduardo Mucelli, Sunday 16 January 2011 à 16:49 | Quote


Subscription date : 05 August 2009
Messages : 285
Added the translate web page capability. Enter a URL and the translated version will be loaded in a new tab of the current browser.

fabounet, Monday 17 January 2011 à 15:23 | Quote


Subscription date : 30 November 2007
Messages : 17118
is it possible to drop the url on the applet ?

Eduardo Mucelli, Monday 17 January 2011 à 17:38 | Quote


Subscription date : 05 August 2009
Messages : 285
Yes, in the branch I pushed 1 second ago Thanks for the suggestion.

fabounet, Monday 17 January 2011 à 18:02 | Quote


Subscription date : 30 November 2007
Messages : 17118
how fast ! love this applet !

fabounet, Sunday 13 February 2011 à 04:44 | Quote


Subscription date : 30 November 2007
Messages : 17118
I've made several changes to this applet
(cf the log of bzr, basically moved to the Python interface, added comments, and added some options in the config)
I hope you don't hate me now for breaking your code

if you don't mind, I'll probably port the other applet to the interfaces next week, except if you want to do it or if you are currently working on them.

thanks to all the beta-testers of the extras applets for testing them

Eduardo Mucelli, Sunday 13 February 2011 à 19:24 | Quote


Subscription date : 05 August 2009
Messages : 285
fabounet: Is there a code pattern to be followed in third-party applets? Because there is a lot of changes, but mainly in code style, and thats does not help too much the third-party coders. If there is, a documentation would help third-party developers. I know you are in a hurry trying to compatibilize third-party applets with the bzr version of CD, but changing code style make harder to the third-party developers to keep understanding "their" code.

I could not use the third-party interface yet in order to port the codes since I'm using Jaunty and Weekly PPA, that is in version 2.2.1~0alpha0.

Cheers.

fabounet, Monday 14 February 2011 à 15:21 | Quote


Subscription date : 30 November 2007
Messages : 17118
yes I'm sorry it breaks your code layout, I should have done it before
the interfaces are designed to prevent breaking the code in the future (because now the applet does not use Dbus any more)
the doc has been updated, please take a look here:
http://www.glx-dock.org/ww_page.php?p=Documentation&lang=en#4-Write%20simply%20an%20applet%20in%20your%20favorite%20language

Using Dbus is still working but should be available.
Basically you have the same variables as before (same functions and signals names, self.icon and self.subicon params)

you just write a class that derives from the CDApplet class.
then you call run() on it and you're done, which removes all the tedious part (you just have to overload the functions begin(), get_config(), on_click(), etc in your class)

Eduardo Mucelli, Tuesday 15 February 2011 à 10:00 | Quote


Subscription date : 05 August 2009
Messages : 285
Will 2.3.0 be packaged in PPA for Jaunty?

matttbe, Tuesday 15 February 2011 à 12:01 | Quote


Subscription date : 24 January 2009
Messages : 12573
@ Eduardo:
No I can't because Jaunty is no longer supported

But you can compile it with a script => From BZR
Or install Ubuntu Maverick

Eduardo Mucelli, Wednesday 16 February 2011 à 20:29 | Quote


Subscription date : 05 August 2009
Messages : 285
@fabounet: I made some fixes in the Translator applet, using the version that already uses the applet interface. Anyway, there is some points I disagree with you in the previous changes.

  • Use the complete language name as Quick-info is longer, yes, but is totally meaningful, something that abbreviation isn't at all. We, as translators, coders, and stuff know what those abbreviations means in terms of languages, but the end-user certainly not. I'm really thinking about undo this change. If another users could discuss it also would be better. Since it is not a technical issue, why show a kind of crypt information to the user?
  • Why it is necessary to control the dialog type with that variable
    self.dialog_type
    ?.
  • Why was necessary to change the menu indexation I was doing, using the tight limit of the necessary list of languages? Since it was working properly I do not understand why. Now the applet is using some huge indexes such as
    SOURCE_INDEX = 1000
    SWITCH_INDEX = 2000
    CLIPBOARD_INDEX = 3000
  • Suggestion: Create a constant CDApplet.MAIN_MENU_ID (or, to keep the name compatibility MENU_MAIN_MENU_ID) instead of keep using the "0".
  • Issue: When I set the emblem in the icon, and after that I use the PopupDialog, the icon in the pop up appears with the emblem also. In the documentation, the PopupDialog method says that if you do not overwrite the key 'icon', it will be the default icon, but instead it takes in consideration and plot together the current emblem.


I will push this version soon. And I will ask sometime to compatibilize the applets I started with the interface. Wait for me.

matttbe, Wednesday 16 February 2011 à 23:48 | Quote


Subscription date : 24 January 2009
Messages : 12573
@ Eduardo: thank you for this comment! It's interesting to have your point of vue and to know what's wrong (and not just to have a comment like "Ok, I guess you're right" )

fabounet, Thursday 17 February 2011 à 14:05 | Quote


Subscription date : 30 November 2007
Messages : 17118
yep, thanks for the feedback, very nice !

1) actually the languages will be written as the icon's label if no label is defined.
this is the default behavior in the .conf file (before, it was written "Translator", so old users won't have it by default, but I guess it's ok since the applet is quite recent)
indeed the short quick-info is not really understandable if you don't know what it is. (if you know it's the short name of the language, it becomes more obvious though).
so maybe we should drop the quick-info or add an option to display it or not.
I was also thinking to display the flags on the icon as emblems; that could be really cool, if these icons already exist on the system or if we can find them and ship the package with them.

2) self.dialog_type is needed because there are 2 kinds of dialogs: the one popped by the user (on click or on shortkey) and the one popped by the applet (the result). we need to distinguish both, to answer the user actions on the buttons correctly.

3) I found it easier than having to compute indexes.
the index is just an ID used to know which menu entry has been selected; it could be some text. their value doesn't matter.
with this method you can separate easily the different sub-menus (if you think one day we can have more than 1000 languages supported, we can use 10000 ranges)

4) absolutely, that makes great sense!

5) I guess someone is wrong here (the doc or the code, that's my fault anyway )
actually in the C code, you use the key word "same icon" to specify that you want the same icon as in the dock. if yo uprovide an image, it is used. Probably we should use the same way here, and therefore use the default icon if nothing is specified (so the doc would be correct).

let me know what you think about all of this

Eduardo Mucelli, Thursday 17 February 2011 à 14:39 | Quote


Subscription date : 05 August 2009
Messages : 285
1) I thought about the flags, and tried to use them, actually I've coded a version with flags. The main problem is to find icons that have the same pattern, and the bigger problem for me is that there is some languages that are spoken in more than one country. For instance, which flag should we use for Portuguese For instance, this image shows the many flags of countries that speak Portuguese. Being practical, there is some countries more well-known than others, and those could be chosen to be the simbol.

I will give you a practical example in this flag usage. Here, in ElementSpeak, the flag for Portuguese is the one from Portugal. Portuguese is spoken by more than 240 million people. In Brazil alone, there are 200 million people. Therefore, 83% of speakers are in Brazil, but the flag that is used here is from Portugal. I'm not complaining or anything, I'm just showing how complicated it is.

edit: I will keep working and thinking about this flag stuff.

2) Ok. It was not necessary before, or am I missing something?

3) Yes, it is really easier.

4) I will take care of it in the Ruby Interface, if you want, I can change the Python one also.

5) I pointed that because if I have to show an emblem indicating that some task is in progress, the pseudocode would looks like:

inform_start_of_waiting_process() # here the icon is changed because an emblem was added
icon.PopupDialog ("everything was done, here is the result") # here the icon shown appears with the emblem, a clock indicating task in progress, but since the Popup is intended to say "We've done!", this does not make sense appers with the emblem.
# To workaround this I have to use the PopupDialog with overwriting the 'icon' key with the default icon file
# icon.PopupDialog({'icon':os.path.abspath("icon")},{})
self.inform_end_of_waiting_process()


For me it is ok, I was just asking because I thought the it was not corresponding to the documentantion.

  • Question: In order to erase the emblem, the best option is to replot the icon using SetIcon? Or there is something better?

Eduardo Mucelli, Thursday 17 February 2011 à 15:06 | Quote


Subscription date : 05 August 2009
Messages : 285
First attempt http://dl.dropbox.com/u/1433190/doCkranslator/Translator_flag_try.png
Maybe for the user it would be obvious that the applet is going to translate from Portuguese to French. Anyway, the fish could be used. For instance, the fish is pointing in the Brazilians's flag direction, and thefere, the translation would be from French to Portuguese. Just a brainstorm.

fabounet, Thursday 17 February 2011 à 17:37 | Quote


Subscription date : 30 November 2007
Messages : 17118
I don't know what other people think about it, but that looks nice to me !
I think it's quite clear that you will translate from left to right because I'm used to read this way.
not sure if Arabic people will understand it this way though. maybe a smal arrow as a bottom-center emblem ? (there is no bottom-center position, but we could add it).

Question: In order to erase the emblem, the best option is to replot the icon using SetIcon?

at the moment yes. the emblem is printed on the icon directly.

about 5, I'll fix it to match the documentation

Eduardo Mucelli, Thursday 24 February 2011 à 14:35 | Quote


Subscription date : 05 August 2009
Messages : 285
@fabounet: I guess we are struggling to keep our code formats in the Translator applet. Why is it necessary to change variables name if there is no a code style stablished, or rules regarding coding style in third-party applets? For me, it just looks like you are forcing your code style. If you have any consideration to make regarding my code style, we can, for sure talk about. If the applet was not working, OK, but it is working, you are just changing my code style by yours, e.g., variables' name based on nothing since there is no rule about it in CD third-party coding.

Curiously, in the last review I removed the self.interjections = [] array because it was not being used anymore, but in the new version it reappeared, I'm wondering why, I guess you did not pulled the last version and just pushed your own over it.

I discussed my point about the destination languages' name abbreviation in the Translator label, and the things looked clear, but you changed it again. I'm almost giving up to put my efforts in third-party coding for Cairo-Dock. You are the biggest contributor here, and if we can not agree, I will not keep my eforts in something that is not fitting another contributors wills.

Sincerely.

Applets | Applets

Subjects Author Language Messages Last message
Translator (formally doCkranslator)
Page : 1 2 3 4 5
Eduardo Mucelli English 84 Guest [Read]
05 June 2018 à 07:24

Post a message

Anti-spam filter 8 (*) times (*) 6 =
            
Did you know ? You can easily create a link to a user profile by using the tag : [[u:NAME]]


Glx-Dock / Cairo-Dock List of forums Applets | Applets Translator (formally doCkranslator) Top

Online users :

Powered by ElementSpeak © 2007 Adrien Pilleboue, 2009-2013 Matthieu Baerts.
Dock based on CSS Dock Menu (Ndesign) with jQuery. Icons by zgegball
Cairo-Dock is a free software under GNU-GPL3 licence. First stable version created by Fabounet.
Many thanks to TuxFamily for the web Hosting and Mav for the domain name.