IUP deb and pet packages for use with small Lua interpreter

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Message
Author
wiak
Posts: 2040
Joined: Tue 11 Dec 2007, 05:12
Location: not Bulgaria

IUP deb and pet packages for use with small Lua interpreter

#1 Post by wiak »

IMPORTANT: See also post three of this thread for optional extension iupluacontrols module deb and dotpet downloads.
-----

Lots of learn Lua related links, tutorials, and IDE information, in these thread posts:

http://www.murga-linux.com/puppy/viewto ... 625#988625

http://www.murga-linux.com/puppy/viewto ... 238#988238

iuplua-core-xenialdog64-gtk2 64-bits deb package (size 344 KiBytes) for Xenial 64bits OS google drive download link here (IUPLUA has liberal tecgraf-MIT opensource licence so is fully GPL compatible). Just two small packages to install for sophisticated GUI programming environment (you will NOT need any devx to be loaded): i.e. apt-get install lua5.3 and then download and install uiplua-core deb package from google drive link here:

64-bit Deb on google-drive here:

https://drive.google.com/open?id=1ggyc3 ... ZE87_S5U2W

64-bit Dotpet on google-drive here:

A dotpet of iuplua-core, which I tested on Slacko64 v6.9.9.9 (kernel 4.9) here:

https://drive.google.com/open?id=1-CHe7 ... OfPzuMEmSh

That dotpet should also work in Puppy Xenial64 and Quirky Xenial64 and likely also fine for any 64-bit Artful or 64-bit Bionic builds.

Deb for xenialdog32/bionicdog32 and dotpet for 32bit Pups (slacko32 ver 6.9.9.9 should be okay as should XenialPup32 or Artful/BionicPup32 or any 32-bit version of Quirky Xerus). Won't work on slacko32 ver 6.3.2 cos too old libs and repository:

32-bit Deb on google-drive here:

https://drive.google.com/open?id=19UaHn ... APEGiRlUMI

32-bit Dotpet on google-drive here:

https://drive.google.com/open?id=1bYe_9 ... 0atDbJndVf

For Puppy system use you first need to install Lua version 5.3.x from the Puppy Package Manager (IT HAS TO BE VERSION 5.3 FOR THIS IUPLUA LIBRARY). In Slacko64 ver. 6.9.9.9 that was from slackware 14.2 official repo. Note that in Puppy the command to run lua is 'lua' rather than the default 'lua5.3' in the Dogs.

Then simply try out the examples linked to in second post of this thread (explanation of howto run them given in detail below if you need it).

The above gtk2-compiled uiplua-core deb package along with official apt-get installed lua deb package (104 kB download; 379 kB installed) is all you need for programming basic (simple widgets) GUI apps and utilities in Lua script-interpreting programming language. Note that the alternative version of iuplua system libs provided on tecgraf iup download site (google it...) are compiled for gtk3. I have here recompiled for gtk2 in case more useful on Puppy/Dogs.

Lua with IUP is a very powerful GUI app-building combination, with a small install size. IUP offers far more functionality than gtkdialog or yad and I find it even easier to build GUIs with it than either of those others (just look at the dotlua scripts example code in the links provided in post two below...).

Lua itself is actually much easier to program in than in bash (though many on the forum are already quite fluent in bash of course so may doubt my statement...) and is actually a very full-featured, yet tiny, programming language (interpreter). You can also run bash commandline utilities (such as sed) from within Lua, and more particularly if you add-on a lua-module such as maybe lua-sh by Serge Zaitsev (google it later). Learning to program the GUI part is almost trivial (certainly easier than learning gtkdialog for the first time) - just run and then read the simple program examples in the second post of this thread to see how to do it. Later you'll want to learn a bit more Lua of course.

Lua used to be provided in some early Pups, by the way, in the form of Murga-Lua by John Murga, which was a (discontinued?) mod of Lua with bindings to modified FLTK graphical toolkit. However, IUP has the advantage of using native widgets (GTK in Linux and Windows API widgets in Windoze) rather than the unique widgets FLTK draws itself (which some say don't look good alongside native widgets). Note that you can also program your GUIs in C as an alternative to Lua, but, as I said above, with what is provided here, no devx is additionally required for Lua programming, and Lua is a logical simple-to-learn language for beginners too:
Serge wrote:Lua is one of my favourite languages. It's tiny, it's fast, it has simple grammar and is very easy to learn.
...
I had an experience in the past when Bash script became hard to maintain. Then we moved to Lua, and it was a big relief. Logic became transparent, code became more readable. However, we had to wrap shell command invocations into hand-written functions to make them look nice. So I made a library that brings the joy of shell scripting into Lua.

INSTALLATION AND USAGE STEPS


If it's Puppy (xenial or bionic anyway), just install the dotpets, else if its a Dog:

1. Using IUPLUA via iuplua-core-xenialdog64-gtk2 installation only requires lua5.3 (104 kB download; 379 kB installed) to first be installed, which you can install on XenialDog with:

Code: Select all

apt-get update && apt-get install lua5.3
IUPLUA also requires libfreetype runtime library to be installed and findable on your system, but that is already done in XenialDog pristine iso.EDIT: I have now tested on pristine XenialDog64 install and all worked fine.

2. Then install the attached iuplua-core-xenialdog64-gtk2 deb package (in pcmanfm on XenialDog you just need to right click it and choose to install.debs).

3. Running provided example lua scriptsE:

a. Links to a whole host of example scripts, that are tested as working with iuplua-core-xenialdog64-gtk2, are provided in the second post of this thread linked below along with some documentation for IUPLUA. Please let me know if any don't run afterall and I'll re-test:

http://www.murga-linux.com/puppy/viewto ... 612#987612

Note that these example scripts just produce the sample GUIs - extra code would need to be added to them to complete their functionality.

To try these examples, simply click on the particular example link and the lua script text will appear in your webbrowser. Then save the page thus displayed, in any directory you like on your system, with the filename as provided at the end of the link (for example "alarm.lua"). To then run the example, simply open a terminal at the download directory and enter the command:

Code: Select all

lua5.3 <filename> (e.g. lua5.3 alarm.lua)
b. Alternatively, you can edit the lua script (which is a simple text file) and insert the following line at the top of the script (assuming lua5.3 executable was installed in that path, which it was on XenialDog64):

Code: Select all

#!/usr/bin/lua5.3
c. Save the edited file and then, make the script executable with:

Code: Select all

chmod +x <filename>
d. Then you can just run the file from the terminal with command:

./<filename> (e.g. ./alarm.lua) just as you would were it an executable bash script... On my XenialDog64 system no exec nor lib paths environment variables needed to be changed.

That's it! Should hopefully all be working for simple GUI Lua programming now. What follows is for more complex GUI building and additional functionality, which will require additional iuplua modules to be installed as described.
----------

Note that the other more complex GUIs examples (yet still easy to program), such as matrix(*).lua, provided at:

https://webserver2.tecgraf.puc-rio.br/iup/examples/Lua/

generally 'require' the additional iup libraries provided by iupluacontrols-xenialdog64-gtk2_3.24_amd64, which I am providing as a single (399 KiBytes) deb package in post three below. Note that some of these other examples require even more iuplua library modules (such as libiup-plot.so and libiuplua-plot53.so for plotting graphs), some of which I will attach as deb packages to later posts.

Soonish/later, however, I want to create some examples that show how to interface with bash shell commands such as sed, and general shell pipeline commands so I can experiment with converting existing bash/gtkdialog scripts as exemplars of using Lua with IUP. I will also try to make XenialDog32 bit deb versions and also dotpets for Puppy Xenial sometime in nearish future, but any developer could probably easily manage to convert the attached deb packages to dotpets anyway (but for 32 bit systems, iuplua will need re-compiled so DO NOT attempt to use the 64 bit debs on 32 bit Linux...). Getting this far was a lot of work so I'm intending to take a bit of a rest just now albeit whilst continuing to play/experiment with this iuplua system... ;-)

I also intend to make same gtk2-based IUPLUA packages for Ubuntu Bionic (debs and dotpets) some time after BIONIC becomes stable. I do not guarantee any support for other distributions or earlier Puppies at this stage. The usual disclaimers apply to what is provided.

Some of you may also be interested in seeing my murga-forum development thread for IUPLUA compiling/packaging here (which is basically a scratchpad of reminders for my own use):

http://www.murga-linux.com/puppy/viewtopic.php?t=113013

Regarding UIP and Lua more generally for bigger apps like painting/image-manipulation:

https://webserver2.tecgraf.puc-rio.br/i ... rial4.html

http://compasstech.com.au/TNS_Authoring ... rials.html

http://compasstech.com.au/TNS_Authoring ... _tut7.html

wiak
Last edited by wiak on Mon 30 Apr 2018, 00:16, edited 30 times in total.

wiak
Posts: 2040
Joined: Tue 11 Dec 2007, 05:12
Location: not Bulgaria

Example code and docs

#2 Post by wiak »

Some relevant IUP, CanvasDraw (cd), and Lua documents

https://sourceforge.net/projects/iup/fi ... f/download
https://sourceforge.net/projects/canvas ... f/download
http://www.lua.org/manual/5.3/manual.html
https://webserver2.tecgraf.puc-rio.br/i ... uplua.html

Lightweight small footprint IDE for Lua programming:
https://studio.zerobrane.com/

Note that, once installed, the applications name is zbstudio. On my XenialDog64 system it installed into directory /usr/bin/zbstudio with its desktop file in "/usr/local/share/applications/ZeroBrance Studio"

IDE for Lua programming if you want it. The zbrane download actually comes with its own versions of lua but should set to the one you want to use, for example, /usr/bin/lua5.3. To do that, start zbstudio and Edit --> Preferences. In the resulting user.lua window add the code (seems to fix things to work using zbstudio IDE, but only just tested):

Code: Select all

path.lua = '/usr/bin/lua5.3'
https://studio.zerobrane.com/doc-lua-quick-start-guide

Now I'm away to learn Lua programming with the above for creating the GUIs... ;-)
-----------------------------

There follows links to example Lua scripts that should work with only lua5.3 and iuplua-core-xenialdog64-gtk2 deb package installed

Simplest way to run them is just to download them as a text file with same name as in link and run them from command line with lua5.3 interpreter. For example:

Code: Select all

lua5.3 alarm.lua

lua5.3 getfile.lua

lua5.3 hbox.lua

lua5.3 menu.lua

lua5.3 sample.lua

lua5.3 tree1.lua

lua5.3 notepad.lua

etc...
These particular lua GUI scripts DO NOT 'require' installation of the iupluacontrols deb provided in my next thread post:

https://webserver2.tecgraf.puc-rio.br/i ... /alarm.lua
https://webserver2.tecgraf.puc-rio.br/i ... button.lua
https://webserver2.tecgraf.puc-rio.br/i ... onsole.lua
https://webserver2.tecgraf.puc-rio.br/i ... dialog.lua
https://webserver2.tecgraf.puc-rio.br/i ... iledlg.lua
https://webserver2.tecgraf.puc-rio.br/i ... review.lua
https://webserver2.tecgraf.puc-rio.br/i ... a/fill.lua
https://webserver2.tecgraf.puc-rio.br/i ... /fonts.lua
https://webserver2.tecgraf.puc-rio.br/i ... /frame.lua
https://webserver2.tecgraf.puc-rio.br/i ... etfile.lua
https://webserver2.tecgraf.puc-rio.br/i ... a/hbox.lua
https://webserver2.tecgraf.puc-rio.br/i ... a/idle.lua
https://webserver2.tecgraf.puc-rio.br/i ... /image.lua
https://webserver2.tecgraf.puc-rio.br/i ... a/item.lua
https://webserver2.tecgraf.puc-rio.br/i ... /label.lua
https://webserver2.tecgraf.puc-rio.br/i ... a/list.lua
https://webserver2.tecgraf.puc-rio.br/i ... dialog.lua
https://webserver2.tecgraf.puc-rio.br/i ... a/mdi1.lua
https://webserver2.tecgraf.puc-rio.br/i ... a/mdi2.lua
https://webserver2.tecgraf.puc-rio.br/i ... a/menu.lua
https://webserver2.tecgraf.puc-rio.br/i ... essage.lua
https://webserver2.tecgraf.puc-rio.br/i ... _clone.lua
https://webserver2.tecgraf.puc-rio.br/i ... agedlg.lua
https://webserver2.tecgraf.puc-rio.br/i ... tiline.lua
https://webserver2.tecgraf.puc-rio.br/i ... lizer1.lua
https://webserver2.tecgraf.puc-rio.br/i ... lizer2.lua
https://webserver2.tecgraf.puc-rio.br/i ... otepad.lua
https://webserver2.tecgraf.puc-rio.br/i ... /radio.lua
https://webserver2.tecgraf.puc-rio.br/i ... sample.lua
https://webserver2.tecgraf.puc-rio.br/i ... /scanf.lua
https://webserver2.tecgraf.puc-rio.br/i ... arator.lua
https://webserver2.tecgraf.puc-rio.br/i ... ubmenu.lua
https://webserver2.tecgraf.puc-rio.br/i ... a/text.lua
https://webserver2.tecgraf.puc-rio.br/i ... hlight.lua
https://webserver2.tecgraf.puc-rio.br/i ... /timer.lua
https://webserver2.tecgraf.puc-rio.br/i ... toggle.lua
https://webserver2.tecgraf.puc-rio.br/i ... a/tray.lua
https://webserver2.tecgraf.puc-rio.br/i ... /tree1.lua
https://webserver2.tecgraf.puc-rio.br/i ... /tree2.lua
https://webserver2.tecgraf.puc-rio.br/i ... /tree3.lua
https://webserver2.tecgraf.puc-rio.br/i ... _attrs.lua
https://webserver2.tecgraf.puc-rio.br/i ... a/vbox.lua
https://webserver2.tecgraf.puc-rio.br/i ... a/zbox.lua

wiak
Last edited by wiak on Thu 12 Apr 2018, 06:11, edited 8 times in total.

wiak
Posts: 2040
Joined: Tue 11 Dec 2007, 05:12
Location: not Bulgaria

optional additional module iupluacontrols

#3 Post by wiak »

Optional additional module iupluacontrols

Note that the other more complex GUIs examples (yet still easy to program), such as matrix(*).lua, provided at:

https://webserver2.tecgraf.puc-rio.br/iup/examples/Lua/

generally 'require' the additional iup libraries provided by iupluacontrols-xenialdog64-gtk2_3.24_amd64, which I am for now providing as a single (399 KiBytes) XenialDog 64bit deb package and XenialPup dotpet via the following google-drive links:

Deb pkg for XenialDog64 (also worked on BionicDog64).

64-bit deb on google-drive here:

https://drive.google.com/open?id=1dfAWx ... 4zRtlGLI8k

Dotpet pkg tested on Slacko64 v6.9.9.9 and should work in Quirky Xenial, and probably any 64-bit Puppy Artful64 and Bionic64 if ever built.

64-bit dotpet on google-drive here:

https://drive.google.com/open?id=1sX4AV ... XE_fVYabxh

32-bit Deb on google-drive here:

https://drive.google.com/open?id=1_NlIf ... tZ7bUAoxib

32-bit Dotpet on google-drive here:

https://drive.google.com/open?id=1uAVsH ... B4GUYEwHOL

Above should work on Slacko32 ver 6.9.9.9 but not version 6.3.2. Should also work on 32-bit versions of XenialPup, ArtfulPup and BionicPup and on any 32-bit Quirky Xerus (if there is such a version).

wiak
Last edited by wiak on Tue 10 Apr 2018, 10:53, edited 10 times in total.

wiak
Posts: 2040
Joined: Tue 11 Dec 2007, 05:12
Location: not Bulgaria

#4 Post by wiak »

Some optional technical details relating to more advanced IUP GUI programming. Includes links to how to use IUP with not only Lua, but also with C, Perl, Ruby, Go, FreeBASIC, ScriptBASIC, Component Pascal, and more:

https://webserver2.tecgraf.puc-rio.br/iup/en/guide.html

In particular, note that the way the gtk dialog GUI is constructed is similar to Puppy's favourite old gtkdialog (vbox, hbox inside frames etc). Thankfully, IUP doesn't use pseudo xml constructs, however (which are easily messed-up, when doing by hand, and add a lot of bulk and indenting complexity):
IUP controls are never positioned in a specific (x,y) coordinate inside the dialog. The positioning is always calculated dynamically from the abstract layout hierarchy. So get used to the IupFill, IupHbox and IupVbox controls that allows you to position the controls in the dialog.
wiak
Last edited by wiak on Wed 04 Apr 2018, 12:13, edited 6 times in total.

wiak
Posts: 2040
Joined: Tue 11 Dec 2007, 05:12
Location: not Bulgaria

#5 Post by wiak »

reserved

wiak
Posts: 2040
Joined: Tue 11 Dec 2007, 05:12
Location: not Bulgaria

#6 Post by wiak »

reserved

wiak
Posts: 2040
Joined: Tue 11 Dec 2007, 05:12
Location: not Bulgaria

IUP deb packages for use with small Lua interpreter

#7 Post by wiak »

IUPLUA graphical toolkit programming environment deb files. This first release (GTK2 compilation) is for Ubuntu Xenial 64-bit system (such as XenialDog64). Whether it would work on any other recent 64-bit Linux system I do not know. I intend to compile 32-bit versions later and hopefully also produce some dotpets. Links to simple example GUI code is provided in second post of thread.

Find the small google-drive download near the top of the first post of this thread:

http://www.murga-linux.com/puppy/viewtopic.php?t=113082

wiak

User avatar
Keef
Posts: 987
Joined: Thu 20 Dec 2007, 22:12
Location: Staffordshire

#8 Post by Keef »

This looks to be working well in Quirky Xerus64 - just had to install Lua 5.3 via petget. Tried a few of the examples and no problems so far.

I did try it on Fatdog also - it only has Lua 5.2 available but simple enough to download and compile 5.3. Had to manually install the deb, but got a 'undefined symbol' error.
Attachments
uip.jpg
(92.45 KiB) Downloaded 1157 times

wiak
Posts: 2040
Joined: Tue 11 Dec 2007, 05:12
Location: not Bulgaria

#9 Post by wiak »

Keef wrote:This looks to be working well in Quirky Xerus64 - just had to install Lua 5.3 via petget. Tried a few of the examples and no problems so far.

I did try it on Fatdog also - it only has Lua 5.2 available but simple enough to download and compile 5.3. Had to manually install the deb, but got a 'undefined symbol' error.
Thanks for the report Keef. Good to know it works on Quirky Xerus64. Later I plan to work on a compile-build system to make it easy for me to rebuild specifically for different platforms. Compiling iuplua proved very tricky for me first time round, but mainly because there were several dependency parts to it all. I was pleasantly surprised at how powerful just using the iup and iuplua libs (in core) proved to be in around half a MB compressed download total including Lua. I'm not myself a Lua programmer, but I now intend to learn - doesn't look too difficult.

Hopefully someone can try the existing debs on Xenial Pup too.

wiak

EDIT: Attached is a screenshot of one of IUPLUA examples running (notepad.lua).. Not a bad little lua text notebook written in only 164 lines of code. It isn't just a GUI in this example; it all actually works. Note that '--' signifies comment lines in Lua. You can get the extra HELP menu (and submenu) to display by deleting the shown -- comments in notebook.lua code shown below in iup.submenu{}, though there seems to be an error in that part of the code so probably why it is currently commented-out...
Attachments
screenshot_notepad_lua_in_action.jpg
lua5.3 notebook.lua
(60.1 KiB) Downloaded 1183 times

wiak
Posts: 2040
Joined: Tue 11 Dec 2007, 05:12
Location: not Bulgaria

#10 Post by wiak »

Code: Select all

apt-get update && apt-get install lua5.3

along with installing iuplua-core-xenialdog64-gtk2.deb

and (optionally): iupluacontrols-xenialdog64-gtk2.deb
Above also works fine with the examples from posts 2 and 3 above in BionicDog64. I am pretty the packages will also work fine in Puppy Xenial as long as Lua5.3 installed there via its package manager.

wiak

wiak
Posts: 2040
Joined: Tue 11 Dec 2007, 05:12
Location: not Bulgaria

IUPLUA dotpets for recent pups uploaded now

#11 Post by wiak »

IUPLUA dotpets for iuplua-core-gtk2 and iupluacontrols-gtk2
have now been uploaded following some testing on Slacko64. Should work on XenialPup64, Quirky Xenial64 and any 64bit versions of Artful or Bionic I think.

See first post for some installation details concerning Lua itself (which needs to be installed too and it MUST BE Lua version 5.3.x).

Slacko64 lua5.3 (from slackware 14.2 repo) expected the iuplua libs to be in /usr/local/lib rather than /usr/lib/ so instead of requiring users to set PATH env variables to sort that out, I just added appropriate symlinks into the dotpets. From Keef's report above, probably won't work in FatDog64 without a recompile.

Any other reports of successes or failures would be appreciated. If enough interest I may compile 32bit versions though personally I always use 64bit Linux nowadays.

Regarding UIP and Lua more generally for bigger apps like painting/image-manipulation:

https://webserver2.tecgraf.puc-rio.br/i ... rial4.html

http://compasstech.com.au/TNS_Authoring ... rials.html

wiak

wiak
Posts: 2040
Joined: Tue 11 Dec 2007, 05:12
Location: not Bulgaria

32bit iuplua dotpets now also provided above

#12 Post by wiak »

1. uiplua-core Debian package for 32-bit Xenial (also works on BionicDog32) also now added to first post of this thread.

2. Optional uipluacontrols Debian package for 32-bit XenialDog (also works on BionicDog32) also now added to third post of this thread.

3. uiplua-core Dotpet package for 32-bit XenialPup now added to first post of this thread. Should also work on 32-bit Bionic or Artful Pups and also in slacko32 ver 6.9.9.9 (but not, I think, in older slacko32 ver 6.3.2).

4. Optional uipluacontrols Dotpet package for 32-bit Xenial now added to third post of this thread. Should also work on 32-bit Bionic or Artful Pups and also in slacko32 ver 6.9.9.9 (but not, I think, in older slacko32 ver 6.3.2).

Again, these will only work with Lua version 5.3, which you need to download from package repository.

PLEASE NOTE WELL that I will only be providing these packages for a short time on my google-drive account, so get them while you can... If anyone has a reliable repository to store them for later, that would be good. They were quite tricky to compile so I'm unlikely to repeat that in a hurry.

EDIT: Also note, that more iuplua modules are available for the likes of matrixes, plotting graphs, handling images and so on. Let me know if you get into this and reach the stage when you want these. I currently have them all compiled, but not packaged, which would take me a lot of time so I'm not planning on that unless there is significant feedback and interest.

Lightweight small footprint IDE for Lua programming:
https://studio.zerobrane.com/

Note that, once installed, the applications name is zbstudio. On my XenialDog64 system it installed into directory /usr/bin/zbstudio with its desktop file in "/usr/local/share/applications/ZeroBrance Studio"

IDE for Lua programming if you want it. The zbrane download actually comes with its own versions of lua but should set to the one you want to use, for example, /usr/bin/lua5.3. To do that, start zbstudio and Edit --> Preferences. In the resulting user.lua window add the code (seems to fix things to work using zbstudio IDE, but only just tested):

Code: Select all

path.lua = '/usr/bin/lua5.3'
https://studio.zerobrane.com/doc-lua-quick-start-guide

Now I'm away to learn Lua programming with the above for creating the GUIs... ;-)
-----------------------------

Attempty to 'learn' Lua in 15 minutes:

http://tylerneylon.com/a/learn-lua/
https://gist.github.com/tylerneylon/5853042

https://webserver2.tecgraf.puc-rio.br/i ... rial4.html

http://compasstech.com.au/TNS_Authoring ... rials.html

https://www.lua.org/pil/contents.html

https://en.wikibooks.org/wiki/Lua_Programming

https://www.tutorialspoint.com/lua/index.htm

http://lua-users.org/lists/lua-l/2007-04/msg00085.html

https://stackoverflow.com/questions/967 ... turn-value

https://stackoverflow.com/questions/tagged/lua

http://www.lua.org/lua-l.html

http://www.capgo.com/Resources/Software ... tRef51.pdf

https://foicica.com/lua/download/lua_qu ... xcerpt.pdf

http://www.lua.org/manual/

http://notebook.kulchenko.com/programmi ... ugly-parts

https://www.youtube.com/watch?v=4NKMtazVNe8

https://www.youtube.com/watch?v=iMacxZQMPXs

https://www.youtube.com/watch?v=yI41OL0-DWM

https://www.youtube.com/watch?v=GVnIRt77ePk

https://www.youtube.com/watch?v=emnHx52S-Xk

Maybe not for beginners this one:

https://www.youtube.com/watch?v=S4eNl1rA1Ns

May or may not find the following useful:

https://github.com/zserge/luash
https://www.gammon.com.au/scripts/doc.p ... os.execute
https://github.com/torch/sys

The tecgraf iuplua examples again:

https://webserver2.tecgraf.puc-rio.br/iup/examples/Lua/

And maybe about time Puppy development work went truly 'Cutting Edge'. Check this out:

http://torch.ch/

wiak

wiak
Posts: 2040
Joined: Tue 11 Dec 2007, 05:12
Location: not Bulgaria

bash/yad GUI translated to IUP/Lua

#13 Post by wiak »

As I've said elsewhere in Announcements, I'm working on a translation of fredx181's gifenc-yad script into gifenc-iup.lua (just as a practice exemplar) and have basically completed the main gui part of the code as shown below (note that this is older version of gifenc-yad; it has had some extra functionality added since). Been too busy to complete everything today (maybe tomorrow) but thought I'd publish the current result at least. Obviously, next part is to interface to ffmpeg line, though I think I can do that with Lua5.3 io.popen command though I've yet to try that (and have never before programmed in Lua...). Most of the code here is from iup.Getparam() function example from tecgraf:

https://webserver2.tecgraf.puc-rio.br/i ... tparam.lua

Further info on iup.Getparam() function itself is here:

https://webserver2.tecgraf.puc-rio.br/i ... param.html

Code: Select all

-- gifenc-iup.lua 
-- as yet incomplete translation of fredx181's gifenc-yad script

require( "iuplua" )

function param_action(dialog, param_index)
  if (param_index == iup.GETPARAM_OK) then
    print("OK")
  elseif (param_index == iup.GETPARAM_INIT) then
    print("Map")
  elseif (param_index == iup.GETPARAM_CANCEL) then
    print("Cancel")
  elseif (param_index == iup.GETPARAM_HELP) then
    print("Help")
--  elseif (param_index == 1) then
--    return 0
  else
    local param = iup.GetParamParam(dialog, param_index)
    print("PARAM"..param_index.." = "..param.value)
  end
  return 1
end

-- set initial values
SIZE = 100
START = 0
DURATION = 0  
pboolean = 1

ret, SIZE, START, DURATION, pboolean = 
      iup.GetParam("GifenC-iuplua", param_action,
                  "Convert (portion of) short video to animated gif%t\n"..
                  "The new .gif will be in the same folder as the video%t\n"..
                  "   Please set the desired .gif size%t\n"..
                  "Size: %i[0,2000,10]\n"..
                  "   Set start time and duration: %t\n"..
                  "Start at (seconds): %r[0,20000,.01]\n"..
                  "Duration (seconds) (0=all): %r[0,20000,.01]\n"..
                  "Do not loop (just once): %b\n",
                  SIZE, START, DURATION, pboolean)
if (not ret) then
  return
end

if (iup.MainLoopLevel()==0) then
  iup.MainLoop()
end
Note that as the code stands above, the GUI will exit if Cancel button pressed, but not if OK button pressed.
Fred's complete gifenc-yad script follows for comparison purposes:

Code: Select all

#!/bin/bash

if [ -z "$(which ffmpeg)" ]; then
yad --width=300 --title "No ffmpeg found" --center --text "  No ffmpeg found, please install ffmpeg  \n  Press Close to exit  " --button="gtk-close:0"
exit
fi

# ffmpeg -i try.mkv -vf "setpts=(1/6)*PTS" output.mp4

SETUP=`yad --width=400 --title="GifenC" --center --text=" Convert (portion of) short video to animated gif \n The new .gif will be in the same folder as the video \n     \tPlease set the desired .gif size" \
--window-icon="folder-system" --form  \
--field=" Size: :NUM" "100!20..2000!10" \
--field="     \tSet start time and duration: :LBL" "" \
--field=" Start at (seconds): :NUM" "0!0..20000!0.010!3" \
--field=" Duration (seconds) (0=all): :NUM" "0!0..20000!0.010!3" \
--field=" Do not loop (just once):CHK" "FALSE" \
--button="gtk-cancel:1" --button="gtk-ok:0"`
ret=$?
[[ $ret -ne 0 ]] && exit 1
echo $SETUP

export SIZE=$(echo $SETUP | cut -d "|" -f 1 | cut -f1 -d".")
export START=$(echo $SETUP | cut -d "|" -f 3)
export DUR=$(echo $SETUP | cut -d "|" -f 4)
export LOOP=$(echo $SETUP | cut -d "|" -f 5)
echo $SIZE
echo $START
echo $DUR
echo $LOOP

if [ "$LOOP" = "TRUE" ]; then
export NUM=1
else
export NUM=0
fi
echo $1
if [ -z "$1" ]; then
yad --title "No Input" --center --text "  No input video provided  \n  Press Close to exit  " --button="gtk-close:0"
exit
fi 
export vid=$1

run_xterm () {
palette="/tmp/palette.png"

filters="fps=10,scale=$SIZE:-1:flags=lanczos"

ffmpeg -ss $START -t $DUR -v warning -i $vid -loop $NUM -vf "$filters,palettegen" -y $palette
ffmpeg -ss $START -t $DUR -v warning -i $vid -i $palette -loop $NUM -lavfi "$filters [x]; [x][1:v] paletteuse" -y ${vid%.*}.gif 
sleep 3
}
export -f run_xterm

xterm -T "GifenC" -e /bin/bash -c run_xterm
Fredx181's most recent release of gifenc-yad (with more functionality) is nicely illustrated and described at this link:

http://murga-linux.com/puppy/viewtopic. ... 267#981267

wiak
Attachments
Screenshot_gifenc-yad.jpg
Screenshot fred's gifenc-yad
(27.19 KiB) Downloaded 919 times
Screenshot_gifenc-iuplua.jpg
Screenshot gifenc-iup.lua
(28.98 KiB) Downloaded 919 times

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#14 Post by fredx181 »

Hi wiak, nice !!

I know your script is not finished yet, but just mentioning that I got error message first (see pic below), and when I click Continue I see the gifenc GUI.
What I did was install iuplua-core deb (32bit) that you provided and installed lua5.3 with apt-get on Xenialdog32.
And put on top of script: #!/usr/bin/lua5.3

Exactly the same I did on StretchDog, btw, and got the same result.

EDIT: Complete error message:

Code: Select all

/mnt/sda7/01-repos/gifenc-iup.lua:20: attempt to index a nil value (local 'param')
stack traceback:
	/mnt/sda7/01-repos/gifenc-iup.lua:20: in function 'param_action'
	[C]: in function 'iuplua.GetParam'
	/mnt/sda7/01-repos/gifenc-iup.lua:32: in main chunk
	[C]: in ?
EDIT2:
wiak wrote:Fredx181's most recent release of gifenc-yad (with more functionality) is nicely illustrated and described at this link:

http://murga-linux.com/puppy/viewtopic. ... 267#981267
Also here (weX thread), see EDIT5 (and attached scripts):
http://murga-linux.com/puppy/viewtopic. ... 724#948724

Fred
Attachments
2018-04-13-174036_550x344_scrot.png
lua error
(27.22 KiB) Downloaded 917 times

wiak
Posts: 2040
Joined: Tue 11 Dec 2007, 05:12
Location: not Bulgaria

#15 Post by wiak »

fredx181 wrote:Hi wiak, nice !!

I know your script is not finished yet, but just mentioning that I got error message first (see pic below), and when I click Continue I see the gifenc GUI.
Yes, I get the same (I think same issue in tecgraf example getparam.lua?). Commenting out (with --) the following line gets rid of the error.

Code: Select all

--    print("PARAM"..param_index.." = "..param.value)
Lua doesn't seem to like the ..param.value (.. is way to concatenate strings I think, so guess param.value doesn't make sense somehow). EDIT: But the line is needed currently to get print out of slider control values. I think the 'error' must just be that param is not initialised prior to first use - not sure how to do that... I suspect Lua just notices that param not initialised at that stage, prior to actually first creating the dialog with iup.GetParam(). So likely just a warning that can somehow be suppressed?

EDIT2: Putting the function param_action() after iup.GetParam() block seems to fix the Lua run error message (presumably cos iup.GetParam() correctly initialises param before function param_action() is first called. EDIT3: No, that doesn't work, cos then function param_action() isn't seen and the PARAM value messages don't then get printed to the terminal... But in finished program wouldn't want to print param.value messages in function param_action() anyway, so actually not important so current run-time error can be ignored I'd say.

Maybe this will help work out how the param_actions stuff works (?):

https://webserver2.tecgraf.puc-rio.br/i ... ambox.html

GetParamParam() function seems to be described in above link.
-----

You can use an os.exit() in the param_action statements for when OK button is pressed to exit the program for that action. Or better still, put os.exit() just before the last if statement in the program, perhaps with a Message or some other code. For example, this worked for me (but I'm totally guessing how to do things just now...):

Code: Select all

iup.Message("IupGetParam",
            "Boolean Value: "..pboolean.."\n"..
            "Integer: "..SIZE.."\n"..
            "Real 1: "..START.."\n"..
            "Real 2: "..DURATION.."\n"
)

os.exit(0)

if (iup.MainLoopLevel()==0) then
  iup.MainLoop()
end
As I've said, I don't know Lua yet nor IUP details, so have a bit of learning to do! Like I suggested, I expect io.popen() and os.execute(), which is like system() in C, to be useful for interfacing with underlying OS and shell. If these aren't adequate then additional Lua module called LuaPosix sounds useful as does luash module I mentioned earlier.

http://lua-users.org/wiki/OsLibraryTutorial

https://github.com/luaposix/luaposix

https://github.com/zserge/luash

I'll probably be a while trying all these possibilities out, but clearly it can be done.

EDIT: By the way, if you replace line:

Code: Select all

"Size: %i[0,2000,10]\n".. 
with

Code: Select all

"Size: %a[0,2000,10]\n".. 
i.e. use %a instead of %i, you get a spin-type volume control instead of slider.

wiak
Last edited by wiak on Sat 14 Apr 2018, 05:33, edited 6 times in total.

wiak
Posts: 2040
Joined: Tue 11 Dec 2007, 05:12
Location: not Bulgaria

#16 Post by wiak »

IUP documentation is quite reasonable. Here are just a few useful function reference links (you can search for others). A bit technical but not hard to understand if you've done some programming before. But best way into it all is just to try things... Often it is actually quite simple and understanding comes from just "doing it" - getting it to 'work' as intended.

This first hint/tip link is quite well illustrated:

https://www.fhug.org.uk/wiki/wiki/doku. ... s_and_tips

A good starting point tutorial, though some of the info may be out-of-date:

https://webserver2.tecgraf.puc-rio.br/i ... index.html

https://webserver2.tecgraf.puc-rio.br/iup/en/guide.html

https://webserver2.tecgraf.puc-rio.br/i ... uplua.html

Some tecgraf manual pages:

Most of the official tecgraf docs can be accessed from the left hand menu here:

http://webserver2.tecgraf.puc-rio.br/iup/

For example: http://webserver2.tecgraf.puc-rio.br/iu ... alogs.html


Some pages from the IUP manual:

https://webserver2.tecgraf.puc-rio.br/i ... ialog.html

The following tutorials are for C with IUP, but much of the IUP control discussion remains relevant to Lua with IUP:

https://webserver2.tecgraf.puc-rio.br/i ... orial.html

It's also worth noting that Tables are the only container type in Lua (so just that to learn!):

http://lua-users.org/wiki/TablesTutorial

Note that there are several ways to access the contents of tables, but check out the LuaRocks style guide near foot of this post for preferred way.


Yes, you can refresh/re-draw a dialog easily it seems:

https://webserver2.tecgraf.puc-rio.br/i ... fresh.html

and create popups:

https://webserver2.tecgraf.puc-rio.br/i ... popup.html

and a probably very useful function for developers to check out the hierarch of elements in their designed dialog:

https://webserver2.tecgraf.puc-rio.br/i ... ialog.html

and a bit info on how it all hangs together:

https://webserver2.tecgraf.puc-rio.br/i ... guide.html

There is not a lot of difference in understanding how to build GUIs with IUP if you use FreeBASIC 'talking to' Lua/IUP via a stack, so worth looking at dialog examples there too:

https://www.freebasic.net/forum/viewtopic.php?t=14869

And a consistent coding style is always important:

https://github.com/luarocks/lua-style-guide

Lua books and manual:

http://nova-fusion.com/2012/08/27/lua-f ... rs-part-1/

https://www.lua.org/pil/contents.html

https://www.lua.org/manual/5.3/

Lua WIKI IS GREAT FOR CODE PATTERN HOWTO DO STUFF IN LUA:

http://lua-users.org/wiki/

http://lua-users.org/wiki/OsLibraryTutorial

Lua unofficial FAQ:

http://www.luafaq.org/

Lua quick reference card (again):

http://www.capgo.com/Resources/Software ... tRef51.pdf

Lua in 15 minutes (again):

http://tylerneylon.com/a/learn-lua/

There is a lot of info above, but truth is I haven't read hardly any of it yet and, per usual, find easier to just to copy a few exemplars and pick things up on the way. Bottom line is that , if there is something you want in your GUI, menu, tabs, popups, there is probably some existing control/function that easily allows you to do it in IUP with Lua, and in terms of portability it is generally cross-platform usable (in most all UNIXes and in Windoze).

Like most 'languages', the key to learning IUP with Lua is just to use the controls you need for the purpose you want (hence me starting with very versatile iup.GetParam() control (along with iup.Message()) , since its use reminded me so much of yad-type dialogs).

wiak
Last edited by wiak on Sun 15 Apr 2018, 12:07, edited 2 times in total.

wiak
Posts: 2040
Joined: Tue 11 Dec 2007, 05:12
Location: not Bulgaria

Lua to shell commands

#17 Post by wiak »

Now that I have GUI constructed for fredx181's gifenc program, I need to appropriately execute ffmpeg program to finish the job... Aside from the iuplua GUI, the following is actually my first Lua program, to find out how easy it is to run shell commands from Lua using os.execute() function. Run the following Lua program and you should immediately realise how easy it is:

Code: Select all

Lua_arg1 = "echo Hello World; "
Lua_arg2 = "ls -al /root | grep 'P'; "
any_name_will_do = "ls -al /root | wc"
commandstring = Lua_arg1 .. Lua_arg2 .. any_name_will_do --concatenating the strings with Lua .. syntax
runstatus = os.execute(commandstring)
print(runstatus)
IT IS WORTH BEARING IN MIND, HOWEVER:

That a lot of stuff we typically use shell commands for can better (and faster) be done by Lua functions instead... But, if it 'works', it works...

Note how I've used semicolons in the above for the sake of bash (as you know a semicolon is used to tell bash where the end of a commandline is, assuming all commands written on same line). I used grep for capital letter P, but you can grep whatever you like...

Now I want to find out how io.open() can be used instead (hopefully) since I feel that might be even more useful (?). Note that os.execute() is like system() call in C.

EDIT: Okay here is a small Lua script example of using io.popen() that seems to work (you can call the variables, such as wiak_control, anything you like of course - as long as not Lua keywords I suppose). I've just hacked this together so best you check proper Lua style guide on how such code should better be written...:

Code: Select all

 wiak_command = "ls -al | wc -l;"
 wiak_command2 = 'echo This seems to work!'
 wiak_command = wiak_command .. "date;" .. wiak_command2
-- above concatenates the strings with Lua .. syntax
 wiak_filepointer1 = assert (io.popen (wiak_command))
  
 for line in wiak_filepointer1:lines() do
   print(line)
 end -- for loop
   
 wiak_filepointer1:close()
So above should give me enough control to finish off that gifenc-iup.lua program... If I need more powerful shell command control, I suspect adding LuaPosix module would probably give a lot more functionality. Or maybe luash (see previous post for links to LuaPosix and luash optional extras). But for now, I doubt I'll need these extra 'batteries' (I think they call modules 'batteries' in Lua, which you load in with the 'require' keyword).

I'm using zerobrane IDE to enter and run these code snippets, by the way, though you can just use leafpad or geany if you like. Zerobrane gives lots of useful diagnostic messages though. If you use it, remember to Edit -> Preferences - Settings:System to contain the PATH to your lua execuatable. For example:

Code: Select all

path.lua = '/usr/bin/lua5.3'
Otherwise, just put the code sample in a text file, say test.lua, and run it from a terminal with: lua5.3 test.lua. Alternatively, in test.lua, you could add header line telling script where your Lua binary is. For example: #!/usr/bin/lua5.3, and then just run with. for example: ./test.lua. Zerobrane is great though and very helpful.

If you can already script in bash, you can be up and running programming Lua in minutes. Easiest, I've found, is just to read whatever you need from here:

http://lua-users.org/wiki/

In particular, you can find how to do most things you are used to doing in bash but in Lua in "LuaDirectory":

http://lua-users.org/wiki/LuaDirectory

You are likely to definitely find the following useful:

http://lua-users.org/wiki/OsLibraryTutorial

http://lua-users.org/wiki/IoLibraryTutorial

http://lua-users.org/wiki/FileSystemOperations

http://lua-users.org/wiki/StringsTutorial

wiak

wiak
Posts: 2040
Joined: Tue 11 Dec 2007, 05:12
Location: not Bulgaria

gifenc-iup.lua translation of early version of gifenc-yad

#18 Post by wiak »

The following is no more than an exemplar for Puppy/Dog developers on how to write small GUI utility apps using IUP/Lua.

The code below is for a working 'not quite exact' IUP/Lua translation of an early version of fredx181's gifenc-yad animated gif maker (code for Fred's original is also attached for code-writing comparison purposes).

To run gifenc-iup.lua, simply make it executable with chmod +x and then run it from the directory it is in with command:

Code: Select all

./gifenc-iup.lua <path_to_video_to_convert_to_gif>
Note that the Lua code function param_action() is not actually required here, but I left it in to illustrate how it can be used for additional logic.

In this version, I'm simply using system call via os.execute() to run the appropriate commandline utils (such as ffmpeg). Could instead have used io.popen() command to allow reading of command output into Lua.

Please note that I do not intend improving this gifenc version. If you want to use gifenc you should in practice therefore use the latest bash/yad version from Fred since it has additional functionality. Fred's latest is gifenc-sel, which you can download in first link below:

http://murga-linux.com/puppy/viewtopic. ... 724#948724
http://murga-linux.com/puppy/viewtopic. ... 267#981267
fredx181 wrote:Also here (weX thread), see EDIT5 (and attached scripts):
http://murga-linux.com/puppy/viewtopic. ... 724#948724
IUP/Lua version:

Note: Please do not think of the following code as good Lua programming style! You should definitely refer to the following for appropriate guidance with that:

https://github.com/luarocks/lua-style-guide

Code: Select all

#!/usr/bin/lua5.3
-- gifenc-iup.lua: translated by wiak from fredx181's early gifenc-yad version
require( "iuplua" )

-- set initial values
assert(os.setlocale('C'))
vid = arg[1]; SIZE = 100; START = 0; DUR = 0; NUM = 1

if os.execute("command -v ffmpeg >/dev/null")~=true then
  iup.Message("gifenc-iup.lua", "No ffmpeg found, please install ffmpeg")
  os.exit(1)
end

if (arg[1] == nil) then
  iup.Message("gifenc-iup.lua", "USAGE: ./gifenc-iup.lua  path_to_video_file")  
  os.exit(2)
end 

function do_convert()
  palette = "/tmp/palette.png"
  filters = "fps=10,scale="..SIZE..":-1:flags=lanczos"                
  ffmpeg_args1 = "-ss "..START.." -t "..DUR.." -v warning -i "..vid.." -loop "..NUM.." -vf ""..filters..",palettegen" -y "..palette
  result = os.execute("ffmpeg "..ffmpeg_args1)
  ffmpeg_args2 = "-ss "..START.." -t "..DUR.." -v warning -i "..vid.." -i "..palette.." -loop "..NUM.." -lavfi ""..filters.." [x]; [x][1:v] paletteuse" -y "..vid:match("(.+)%..+")..".gif"
  result = os.execute("ffmpeg "..ffmpeg_args2)  
  os.execute("xterm -T 'PLEASE WAIT FOR GIF ENCODE' -e sleep 3")
end

function param_action(dialog, param_index) --this function not actually required for gifenc
  if (param_index == iup.GETPARAM_OK) then
    print("OK pressed")
  elseif (param_index == iup.GETPARAM_CANCEL) then
    print("Cancel pressed")
    os.exit(3)
  end
  return 1
end

ret, SIZE, START, DUR, NUM =
      iup.GetParam("GifenC-iuplua", param_action,
                  "Convert (portion of) short video to animated gif%t\n"..
                  "The new .gif will be in the same folder as the video%t\n"..
                  "   Please set the desired .gif size%t\n"..
                  "Size: %i[0,2000,10]\n"..
                  "   Set start time and duration: %t\n"..
                  "Start at (seconds): %r[0,20000,.01]\n"..
                  "Duration (seconds) (0=all): %r[0,20000,.01]\n"..
                  "Do not loop (just once): %b\n",
                  SIZE, START, DUR, NUM)
         
result = do_convert()
iup.Message("gifenc-iup.lua", vid:match("(.+)%..+")..".gif has been created")
os.exit(0)
if (iup.MainLoopLevel()==0) then
  iup.MainLoop()
end
fredx181's original early version:

Code: Select all

#!/bin/bash

export LC_ALL=C

if [ -z "$(which ffmpeg)" ]; then
yad --width=300 --title "No ffmpeg found" --center --text "  No ffmpeg found, please install ffmpeg  \n  Press Close to exit  " --button="gtk-close:0"
exit
fi

# ffmpeg -i try.mkv -vf "setpts=(1/6)*PTS" output.mp4

SETUP=`yad --width=400 --title="GifenC" --center --text=" Convert (portion of) short video to animated gif \n The new .gif will be in the same folder as the video \n     \tPlease set the desired .gif size" \
--window-icon="folder-system" --form  \
--field=" Size: :NUM" "100!20..2000!10" \
--field="     \tSet start time and duration: :LBL" "" \
--field=" Start at (seconds): :NUM" "0!0..20000!0.010!3" \
--field=" Duration (seconds) (0=all): :NUM" "0!0..20000!0.010!3" \
--field=" Do not loop (just once):CHK" "FALSE" \
--button="gtk-cancel:1" --button="gtk-ok:0"`
ret=$?
[[ $ret -ne 0 ]] && exit 1
echo $SETUP

export SIZE=$(echo $SETUP | cut -d "|" -f 1 | cut -f1 -d".")
export START=$(echo $SETUP | cut -d "|" -f 3)
export DUR=$(echo $SETUP | cut -d "|" -f 4)
export LOOP=$(echo $SETUP | cut -d "|" -f 5)
echo $SIZE
echo $START
echo $DUR
echo $LOOP

if [ "$LOOP" = "TRUE" ]; then
export NUM=1
else
export NUM=0
fi
echo $1
if [ -z "$1" ]; then
yad --title "No Input" --center --text "  No input video provided  \n  Press Close to exit  " --button="gtk-close:0"
exit
fi
export vid=$1

run_xterm () {
palette="/tmp/palette.png"

filters="fps=10,scale=$SIZE:-1:flags=lanczos"

ffmpeg -ss $START -t $DUR -v warning -i $vid -loop $NUM -vf "$filters,palettegen" -y $palette
ffmpeg -ss $START -t $DUR -v warning -i $vid -i $palette -loop $NUM -lavfi "$filters [x]; [x][1:v] paletteuse" -y ${vid%.*}.gif
sleep 3
}
export -f run_xterm

xterm -T "GifenC" -e /bin/bash -c run_xterm
wiak
Attachments
Screenshot_gifenc_iuplua.jpg
Screenshot of UIP/Lua version
(28.05 KiB) Downloaded 530 times
Last edited by wiak on Mon 16 Apr 2018, 23:12, edited 4 times in total.

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#19 Post by fredx181 »

Hi wiak, works well your new gifenc lua script, lots of progress you made !
Only when I tested on my system with locale set to dutch it failed (can't remember why that happens exactly atm, something to with dot changed to comma in numeric value output).
I solved that in newer gifenc-yad by putting " export LC_ALL=C" on top of script (but maybe there's better way).

Fred

wiak
Posts: 2040
Joined: Tue 11 Dec 2007, 05:12
Location: not Bulgaria

#20 Post by wiak »

fredx181 wrote: Only when I tested on my system with locale set to dutch it failed (can't remember why that happens exactly atm, something to with dot changed to comma in numeric value output).
I solved that in newer gifenc-yad by putting " export LC_ALL=C" on top of script (but maybe there's better way).
Thanks for testing, Fred. I've added an os.setlocale() call to the top of the program I posted. Could you test it in dutch with that inserted.

Code: Select all

assert(os.setlocale('C'))
Lua info on locales here:

http://lua-users.org/wiki/LuaLocales

As far as possible gettext support is concerned, all I've found is:

https://www.gnu.org/software/gettext/ma ... e/Lua.html
https://www.gnu.org/software/gettext/ma ... 002dformat
https://gitlab.com/sukhichev/lua-gettex ... ADME.us.md
https://launchpad.net/~sukhichev/+archi ... ua-gettext
https://github.com/LubomirR/gettext-lua


The following i18n module from kikito seems to be used in some Lua projects:

https://luarocks.org/modules/kikito/i18n
https://github.com/kikito/i18n.lua
https://stackoverflow.com/questions/413 ... nalization

https://github.com/kaishiqi/I18N-Gettext-Supported

Another alternative?

https://luarocks.org/modules/damvgn/babel

Basically, I know nothing about this. Hopefully some of the Internationalisation experts on this forum can look into this?

wiak
Last edited by wiak on Mon 16 Apr 2018, 22:59, edited 14 times in total.

Post Reply