Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 05-21-2017, 05:40 AM   #136
Nicolas F
Groupie
Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.
 
Posts: 161
Karma: 1842
Join Date: Jan 2016
Device: Kobo Glo HD
Quote:
Originally Posted by DiapDealer View Post
That would be great! Since it's set up now, I'll wait a bit to see if any others want to contribute a translation before releasing a new version. The .pot file is available from the github repository (link in first post of this thread), that can be used to create the editable .po files.

If you can't contribute via Github, just let me know what I need to provide for you and I'll get it to you. I've no idea if people are used to creating their own .po files and compiling them to .mo file themselves, or what? I can provide .po files for the target languages and compile the completed ones if necessary. Whatever works best.

I just need to come up with a scripted workflow to update the existing .po files whenever I change things for a new release (when the changes require the translators to revisit them). Shouldn't be too difficult. That way people can submit pull requests on Github, or email me updated files and I'll script something that compiles them all to .mo files when I make a new release of the plugin.
Good idea for the .po and .pot files, you're right they don't need to be in the final plugin, but I wasn't really sure how to filter them out...

For the creation of the .POT and .PO files I used Poedit. And apparently I didn't configure it properly so the update isn't working as intended... I did it again it should work this time, I will push it to github.

Actually you just have to click on update in the toolbar or you can use update from POT file when you are in the PO file. (to configure the source you need to go to catalogue -> properties -> sources paths and add the path to the .py files to translate, but I've done it)

And the MO files are automatically created by Poedit so I think the translators can produce it easily enough.

For future updates I can update the translations if you like (I will follow this thread but feel free to PM me here or on github). The easiest thing is probably to update the .po files so that translators just have to add the missing strings.

Last edited by Nicolas F; 05-21-2017 at 06:29 AM.
Nicolas F is offline   Reply With Quote
Old 05-21-2017, 06:29 AM   #137
Terisa de morgan
Grand Sorcerer
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 6,233
Karma: 11768331
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
Quote:
Originally Posted by DiapDealer View Post
That would be great! Since it's set up now, I'll wait a bit to see if any others want to contribute a translation before releasing a new version. The .pot file is available from the github repository (link in first post of this thread), that can be used to create the editable .po files.

If you can't contribute via Github, just let me know what I need to provide for you and I'll get it to you.
I've already downloaded the pot file, and I've created es.po and es.mo (it's a work in progress at this moment). I'll try to make a push at some moment in the next week, but I'm not sure when. If I have some problem I'll tell you.

Quote:
Originally Posted by DiapDealer View Post
I just need to come up with a scripted workflow to update the existing .po files whenever I change things for a new release (when the changes require the translators to revisit them). Shouldn't be too difficult. That way people can submit pull requests on Github, or email me updated files and I'll script something that compiles them all to .mo files when I make a new release of the plugin.
I'm not sure if the first step is really necessary. I think you only need to change the Trad.pot and, later, everybody can update the po file from that, and translate the new strings (it's like I usually do, and the plugins I check usually follow this pattern).
Terisa de morgan is online now   Reply With Quote
Advert
Old 05-21-2017, 06:34 AM   #138
Terisa de morgan
Grand Sorcerer
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 6,233
Karma: 11768331
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
Quote:
Originally Posted by Nicolas F View Post
Actually you just have to click on update in the toolbar or you can use update from POT file when you are in the PO file. (to configure the source you need to go to catalogue -> properties -> sources paths and add the path to the .py files to translate, but I've done it)
This small script generates the new Trad.pot file automatically, so it can be included without having to open poedit all the times:

Code:
ls *.py > salida
xgettext -f salida
rm salida
if [ -f messages.po ]
then
	mv messages.po translations/Trad.pot
fi
Quote:
Originally Posted by Nicolas F View Post
For future updates I can update the translations if you like (I will follow this thread but feel free to PM me here or on github). The easiest thing is probably to update the .po files so that translators just have to add the missing strings.
I think everybody can do this from poedit if the pot file is updated, no need you modify all of them, but as you prefer.

Last edited by Terisa de morgan; 05-21-2017 at 06:37 AM.
Terisa de morgan is online now   Reply With Quote
Old 05-21-2017, 07:18 AM   #139
Nicolas F
Groupie
Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.
 
Posts: 161
Karma: 1842
Join Date: Jan 2016
Device: Kobo Glo HD
Quote:
Originally Posted by Terisa de morgan View Post
This small script generates the new Trad.pot file automatically, so it can be included without having to open poedit all the times:

Code:
ls *.py > salida
xgettext -f salida
rm salida
if [ -f messages.po ]
then
	mv messages.po translations/Trad.pot
fi


I think everybody can do this from poedit if the pot file is updated, no need you modify all of them, but as you prefer.
No no, if you can script it it's easier for everyone! Did you check if your script gives the same .pot file? I don't know what I did the first time, but the number of each ligne changed when I updated from source again (I don't know if it's important acutally?)
And if you think it's not necessary for the po files, I won't bother

Last edited by Nicolas F; 05-21-2017 at 07:22 AM.
Nicolas F is offline   Reply With Quote
Old 05-21-2017, 08:36 AM   #140
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,547
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
My plan was to auto generate the .pot file with xgettext (similar to Teresa's suggestion), and then update any existing .po files with msgmerge. That way, translators would only need to open their .po file and verify that nothing new needs to be addressed. But you guys are the ones doing the work, so if you tell me the second step is unnecessary, I'll surely listen.

The source-code line-numbers in the .po files aren't necessarily critical to make things work, but if they can stay accurate with a little scripting (which will include the added bonus of not requiring translators to regenerate their .po file from the template each time), then that's what I'd probably prefer.

I can also script the compilation of the .mo files, so there's no real need for translators to provide those.

Last edited by DiapDealer; 05-21-2017 at 08:49 AM.
DiapDealer is offline   Reply With Quote
Advert
Old 05-22-2017, 04:01 AM   #141
Terisa de morgan
Grand Sorcerer
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 6,233
Karma: 11768331
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
Quote:
Originally Posted by DiapDealer View Post
I can also script the compilation of the .mo files, so there's no real need for translators to provide those.
If you use poedit, it's almost automatic (I don't know if it always generates it when you save the file, or it's my setup )
Terisa de morgan is online now   Reply With Quote
Old 05-22-2017, 04:35 AM   #142
Nicolas F
Groupie
Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.
 
Posts: 161
Karma: 1842
Join Date: Jan 2016
Device: Kobo Glo HD
Quote:
Originally Posted by Terisa de morgan View Post
If you use poedit, it's almost automatic (I don't know if it always generates it when you save the file, or it's my setup )
The mo file is also generated automatically on save for me, so it must be default behaviour
Nicolas F is offline   Reply With Quote
Old 05-22-2017, 09:45 AM   #143
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,547
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
I may set up the github repository to ignore .mo files in that case. They don't really need to be a part of the source. They can be generated when preparing a release of the plugin. Translators will still be able to test locally using the .mo files they generate if they like (and if they use github), but git just won't track them.
DiapDealer is offline   Reply With Quote
Old 05-22-2017, 10:18 AM   #144
Terisa de morgan
Grand Sorcerer
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 6,233
Karma: 11768331
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
OK, I'm going to test the translation this evening at home and I hope to push it tonight or tomorrow morning.
Terisa de morgan is online now   Reply With Quote
Old 05-22-2017, 10:41 AM   #145
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,547
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Thanks. Nicolas made one small change that I need to pull in yet, but it shouldn't really matter. In fact, it might make a good opportunity for me to update the .pot ... merge the changes into the existing .po files and see if the workflow makes sense.
DiapDealer is offline   Reply With Quote
Old 05-22-2017, 10:51 AM   #146
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,547
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Probably overkill. I really don't foresee the translatable strings changing all that much. But I like to be prepared.
DiapDealer is offline   Reply With Quote
Old 05-22-2017, 10:57 AM   #147
Terisa de morgan
Grand Sorcerer
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 6,233
Karma: 11768331
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
Quote:
Originally Posted by DiapDealer View Post
Probably overkill. I really don't foresee the translatable strings changing all that much. But I like to be prepared.
I totally understand
Terisa de morgan is online now   Reply With Quote
Old 05-23-2017, 10:16 AM   #148
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,547
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Thanks for the Spanish translation file, Teresa. Nicolas' latest update modified the template a tiny bit (mostly source-code line-numbers), but I was able to merge those changes into your .po file with msgmerge. I haven't pushed that change yet, but when I do ... that will explain why the .po file in the repo is slightly different than yours.

So from this point on ... I'll take responsibility for updating the template, merging any changes into the .po files, and then compiling the .mo files. I'm also going to delete any .mo files from the repo and tell git not to track that file-type.

We should be good to go now. I'll let you know if there's ever new translatable strings, or if any existing ones need updated.

New .po files can be generated from the template, and existing ones should be edited directly.

Thanks again!

Last edited by DiapDealer; 05-23-2017 at 10:27 AM.
DiapDealer is offline   Reply With Quote
Old 05-23-2017, 11:27 AM   #149
Nicolas F
Groupie
Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.
 
Posts: 161
Karma: 1842
Join Date: Jan 2016
Device: Kobo Glo HD
Ah yes, I should have deleted those since you said you were going to script it...
But I don't think it will matter.

Thanks for your work!
Nicolas F is offline   Reply With Quote
Old 05-23-2017, 11:44 AM   #150
Terisa de morgan
Grand Sorcerer
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 6,233
Karma: 11768331
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
Yes, thank you for your work, @DiapDealer and @Nicolas F
Terisa de morgan is online now   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sample Plugin for the Editor DiapDealer Editor 77 12-10-2014 07:16 AM
Diaps Editing Toolbag.zip Index Error phossler Editor 2 10-01-2014 08:05 PM
Editor plugin question DiapDealer Development 2 07-28-2014 10:23 PM
japi - a text editor capable of editing ePub directly hekkel ePub 5 02-20-2009 08:46 AM


All times are GMT -4. The time now is 03:36 PM.


MobileRead.com is a privately owned, operated and funded community.