Re: [QGIS-Developer] translate plugin gui and log messages

2019-06-21 Thread C Hamilton
This seemed to work, but I have a question about translation. I first created the english .ts file. I assume that someone then does a translation of that file, but I notice in the XML that it has it tied to a line number. What happens when I make a change to the code and the line number changes?

Re: [QGIS-Developer] translate plugin gui and log messages

2019-06-20 Thread Roberta Fagandini
Hi all, following Jonas suggestion to use pylupdate5 script, I finally found a possible solution. I have created a .bat file with the following lines (probably are obvious for most of the dev community ;-)): @echo off call "C:\OSGeo4W64\bin\o4w_env.bat" call "C:\OSGeo4W64\bin\qt5_env.bat" call

Re: [QGIS-Developer] translate plugin gui and log messages

2019-06-20 Thread DelazJ
Hi > On Thu, Jun 20, 2019 at 9:11 AM matteo wrote: > >> > Hi Matteo, >> > thank you for the help, your solution works fine in linux. Do you know >> > if something similar exists for Windows? >> >> make transup and make transcompile just call bash scripts. not sure >> what the workaround

Re: [QGIS-Developer] translate plugin gui and log messages

2019-06-20 Thread Ismail Sunni
Hello, Perhaps it's overkill, but we can use Docker to run the script for managing the translation (update, compile, and see how many untranslated strings). You can find an example https://github.com/inasafe/inasafe/blob/develop/Makefile#L346 I find it easier even if I use Linux since I don't

Re: [QGIS-Developer] translate plugin gui and log messages

2019-06-20 Thread matteo
> Hi Matteo, > thank you for the help, your solution works fine in linux. Do you know > if something similar exists for Windows? make transup and make transcompile just call bash scripts. not sure what the workaround could be in Windows. Doesn't Windows have a kind of linux bash integrated?

Re: [QGIS-Developer] translate plugin gui and log messages

2019-06-19 Thread Jonas
You can just use the pylupdate5 script, its in %OSGeo4Win%\apps\Python37\Scripts It loads your .pro file and creates the .ts files which you can open in QtLinguist. After translating you release within QtLinguist to a .qm file. See:

Re: [QGIS-Developer] translate plugin gui and log messages

2019-06-19 Thread C Hamilton
I am also interested in how you do this on Windows because I had a request to add translation ability to the Shape Tools plugin, but these instructions don't seem to include anything for Windows. Thanks, Calvin On Wed, Jun 19, 2019 at 2:24 AM matteo wrote: > Hi Roberta, > > well the process

Re: [QGIS-Developer] translate plugin gui and log messages

2019-06-19 Thread Roberta Fagandini
Hi Matteo, thank you for the help, your solution works fine in linux. Do you know if something similar exists for Windows? Thanks Roberta Il giorno mer 19 giu 2019 alle ore 08:24 matteo ha scritto: > Hi Roberta, > > well the process is pretty easy and straightforward. > > I use the Makefile to

Re: [QGIS-Developer] translate plugin gui and log messages

2019-06-19 Thread matteo
Hi Roberta, well the process is pretty easy and straightforward. I use the Makefile to manage all the process [0]. Basically the steps are: * adding a list to locales in the Makefile, like: LOCALES = en it nl * always in the Makefile add all the paths to the files that contains the string you

Re: [QGIS-Developer] translate plugin gui and log messages

2019-06-18 Thread Jonas
Hi Roberta, You do not mention using the pylupdate program, you should use that to create the ts files, because only this way you extract the text strings from the python files. Qt Creator does not care about the python scripts at all. see

[QGIS-Developer] translate plugin gui and log messages

2019-06-18 Thread Roberta Fagandini
Hi all, I want to translate both the gui and all the log messages of my plugin in a certain language (e.g. Italian). I'm using Qt Creator and Qt Linguist. I created a plugin.pro file which contains all the file with text strings that have to be translated (i.e. my .ui and .py files). Then I used