Xdialog strange behavior [SOLVED]

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

Xdialog strange behavior [SOLVED]

#1 Post by Argolance »

Bonsoir,

Code: Select all

#!/bin/sh

export TEXTDOMAIN=yapi_test
export OUTPUT_CHARSET=UTF-8

 MSG1="$(gettext 'YaPI (Yet another Puppy Installer) supports 3 alternative installation types and mounts your drives seeking every installable Pup iso:')"
 MSG2="$(gettext '(1) FRUGAL*****
   The files vmlinuz, initrd.gz and pup_xxx.sfs (plus, as needed, sfs files starting with an a, f, y, or z) are copied to a chosen partition.
   This partition will retain, undisturbed, all existing information currently held in the form of directories and files.
   This can be any type of partition, for example: MSDOS, Windows (FAT, NTFS) or Linux (EXT2, EXT3, EXT4 or REISERFS).
   THIS IS RECOMMENDED AS THE BEST OPTION for most users. IT IS ALSO THE SAFEST as with this method nothing is overwritten.')\n\n
 $(gettext 'or, (2) SUPERFLOPPY (simple but destructive without care and needs a special process if wanting to return the drive to normal use)
   Wnich takes over the entire storage device. It has neither MBR, master boot record, nor PARTITIONS and only a SINGLE file system.
   It uses part of the storage device space for its frugal installation and the remaining space is used for data storage.')"
 MSG3="$(gettext 'or, (3) FULL (may also be destructive if there is any mistake in the drive chosen for installation, either before or during the process)
   A full installation, taking over an entire partition. This is the traditional Linux hard drive installation.
   It requires the partition to have a Linux filesystem (EXT2, EXT3, EXT4 or REISERFS).')"
 MSG4="$(gettext 'THE TYPE OF DEVICE (hard drive, USB flash drive, etc.), partition format, will also determine what type of install(s) may be offered.
   Some devices cannot accept all three types of installion. So,
   the installer will automatically offer to select any of the alternative installations which are actually available to you.')"
 MSG5="$(gettext 'TO BOOT Puppy:
   Depending upon the device(s) available and how Puppy is installed.
   It may be also necessary to install a boot loader or to amend one if there is enough space left to add yet another FRUGAL Pup.')"
 MSG6="$(gettext 'However, you will get full advice on implementing all your available options as you use YaPI.')"

Xdialog --left --msgbox "$MSG1\n\n $MSG2\n\n $MSG3\n\n $MSG4\n\n $MSG5\n\n $MSG6" 0 0
English script works fine.
I built a mo file (using poeditor) and the last paragraph is truncated if I shorten the first line I can lengthen the last line. Also vice versa. :shock:
Any idea?
Thanks.
Cordialement.
Attachments
French_pot_po_mo.tar.gz
(8.57 KiB) Downloaded 91 times
Last edited by Argolance on Fri 31 Aug 2018, 22:14, edited 1 time in total.

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#2 Post by don570 »

Xdialog has a limit to number of characters it will accept in a box.
I once came across this problem :roll:

Translations from English to a foreign language typically require a few
more characters. You seem to be right on the limit.

I would try reducing the size of translation. Leave out articles (le la) and punctuation.
_______________________________________________

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#3 Post by don570 »

I did a check and it is possible to add more characters by adding an extra
option to Xdialog
Xdialog --left --backtitle "\n$(gettext 'Conversion factor\nUnit A to Unit B')" --msgbox "$MSG1\n\n $MSG2\n\n $MSG3\n\n $MSG4\n\n $MSG5\n\n $MSG6" 0 0
Using the 'backtitle' option more lines are possible.

User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

#4 Post by Argolance »

Bonsoir,
don570 wrote:Using the 'backtitle' option more lines are possible.
Thanks for the trick!
I solved this problem by using yad which has another strange behavior: text is wrapped by default and the no-wrapp option doesn't seem to work or exist... It still offers many more possibilities especially for text formatting!

Cordialement.

Post Reply