Forum › Forums › antiX-development › Translations › yad-updater to translate
- This topic has 39 replies, 4 voices, and was last updated Mar 31-12:32 am by marcelocripe.
-
AuthorPosts
-
March 28, 2023 at 3:25 pm #103444Member
PPC
::@Wallon – no. You should get everything in French.
I just booted into antiX 23beta1 live, selected “French” (not belgian french) and booted. I ran my script, I got everything in the updated completly in french.
From what you are describing, it seems that there is no french belgian localization yet available for this script, in the beta, so you get the original english version. Please try to boot into “fr” and not “fr_be”, to check if the script works for you.
Before, the script did not work in french, I fixed in a way that I boot antiX in french and it works. If it works for me in french, it should work for everyone, in french…EDIT: I just booted into antiX 23 beta 1 in fr_be- the script works correctly. anticapitalista has not yet made available localization files for previous versions of the updater in antiX 22 or older).
P.
- This reply was modified 1 month ago by PPC.
- This reply was modified 1 month ago by PPC.
March 28, 2023 at 3:47 pm #103448Member
Wallon
::Dear Master PPC,
I have imported the translation from Transifex, I have converted the *.po file to a *.mo file.
I copied the new yad-update.mo file to the /usr/share/locale/en_Be directory and miraculously everything works. Everything is in French.
I had done some research on the internet which showed that there were problems with French in some programming languages.
For example, I also translate VLC into French in Transifex. If I have to write a word with an apostrophe, I have to put an anti slash.
For example, “for the love of antiX”pour l\'amour d\'antiXAs you can see on the screenshots, I didn’t put inverted commas in the French translation anymore to eliminate some bugs.
I think it’s better not to modify the translations anymore. I really worked hard to translate yad-updater into French because it was not going well.
Thanks a lot for modifying your programming. I was going crazy about it.
Can you tell me what your programming language is? Is it bash shell? We could know if we have to use a special code for the special characters to put directly in the translations of Transifex as I do for VLC.Now I will test the second button, “Automatic update”.
Best regards,
WallonAttachments:
March 28, 2023 at 4:20 pm #103453Member
Wallon
::Dear Master PPC,
The automatic update also works.
I did this on an extended partition with several logical partitions. The whole procedure was in French.wallon@dell:~ $ lsblk -f NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINT mmcblk0 ├─mmcblk0p1 ├─mmcblk0p5 ext4 1.0 boot1antix23 cbd203c2-f329-4f4a-a597-a4ebeb08fc9e ├─mmcblk0p6 swap 1 swap1antiX23 76c9de40-48f0-422a-bf28-eb4b7b2cb1c0 [SWAP] ├─mmcblk0p7 f2fs 1.15 root1antiX23 3e02bf2f-e441-4966-b1ce-ff58bf6a984c ├─mmcblk0p8 vfat FAT32 LINUXDATA 8806-3C53 ├─mmcblk0p9 ext4 1.0 boot2antix22 198c5b99-2b88-4a4c-baa0-2fef122fc204 258,4M 27% /boot ├─mmcblk0p10 swap 1 swap2antix22 9e4d0234-e71e-4209-8428-c50cbb6a92df [SWAP] └─mmcblk0p11 f2fs 1.14 root2antix22 c2870479-ded8-4fca-af6c-fe1a6906a953 32,3G 15% /So, for me, everything is fine. I validate your program. Anticapitalista can put the new translation and your new program on github, in the iso of antiX 23 and send an update of your package for all installations.
This is really a great day for both of us.
Thanks again for your support.
Best regards,
WallonAttachments:
March 28, 2023 at 4:21 pm #103455MemberPPC
::Is it bash shell?
Yes. I only know bash. I use a small program called yad, that helps create GUI’s for my scripts. I used some python routines, in one script (but I just copied and pasted what I needed).
The French version failed to work because the text in the error message had an apostrophe… and that part of the script, that invoques the terminal, to run sudo apt upgrade, is inside apostrophes. So, the script read the first apostophe, read the second one, inside the french text and “assumed” the command finished there- this is what cause the error. I edited the script so that the text on the error message had any apostrophe converted to a similar sign, not to confuse the script. It’s a dirty hack, but solves this particular bug.
Ideally there should be used another character instead of the regular apostrophe, to avoid this problem, and what you report in VLC…Edit: I just now read your previous post. I’m glad this script now works in fr!
If everything works for you, let me know, so I warn anticapitalista to update the official yad-updater script…P.
- This reply was modified 1 month ago by PPC.
March 28, 2023 at 5:28 pm #103466Member
Wallon
::Dear PPC,
I would like to do another test.
I have noticed in your file that you have transformed the French word “s’est” into “s`est” which is not French. This is not a problem for me, but I would like to go further in the tests.
You have corrected a procedure but there are other apostrophes in my French texts.
The French language is made like that and I don’t know how to modify it.
I put a special character “\” in front of each apostrophe in my *.po file.
It doesn’t work when I want to convert the *.po file to a *.mo file.
So I changed and put the special character “/” in front of each apostrophe.
The conversion from *.po to *.mo works.
I also commented out your line in your file that converts the ‘ character to a ` character.
I retested your modified file, it tells me that my system is up to date in French. But I can’t get the window with the 2 buttons to do updates because my system is up to date.
So, I have to redo an installation to be able to do updates and retest your file with my “/” character in front of the apostrophes.
This would be safer, because you and I would know that everything would work in all calls to terminal commands.Is it good for you?
Best regards,
WallonMarch 28, 2023 at 6:02 pm #103467Member
marcelocripe
::So, I have to redo an installation to be able to do updates and retest your file with my “/” character in front of the apostrophes.
Wallon, with the amount of RAM you have, you don’t need to do another antiX install. Test with a LiveUSB with antiX 22 or the beta version of antiX 23.
Just don’t forget to save the test files on your storage device (USB, hard disk, SSD, etc.)
I’m glad to hear that it’s now working and that PPC has intervened in this case from the “yad-updater” program.– – – – –
So, I have to redo an installation to be able to do updates and retest your file with my “/” character in front of the apostrophes.
Wallon, com a quantidade de memória RAM que você possui, você não precisa fazer outra instalação do antiX. Faça os testes com um LiveUSB com o antiX 22 ou com a versão beta do antiX 23.
Só não esqueça de guardar os arquivos dos testes no seu dispositivo de armazenamento (USB, disco rígido, SSD, etc.)
Eu fico contente em saber que agora começou a funcionar e que o PPC interveio neste caso do programa “yad-updater”.March 28, 2023 at 6:13 pm #103470MemberPPC
::Dear Wallon – sorry, the changes I made were the best I could do. Maybe someone else, like Robin can try tweaking the script so it works with the existing localization.
Yes, you can try adding a \ before the apostrophe, in your localization, and see if that works for you, but I think the result of my tweak seems close enough to an apostrophe, so close, in fact that, at first, even after being warned that I replaced that graphical sign, you at first noticed nothing wrong. I did my best, I can’t spend any more time on this subject… I assume that’s best to have a “strange” apostrophe in French than having the text in English. Quoting you, I’m “Shocked” by the fact that it’s not French 🙂
Ideally all localization should be perfect, I know… But sometimes, I have to know when to quit.Since you said that the script worked fine, I already posted, on antiX 23’s thread, a warning that anticapitalista should update the script to this revised version.
P.
March 28, 2023 at 7:02 pm #103480Member
Wallon
::Dear PPC,
I can’t find it.
According to the documentation, one should neutralise the apostrophe by starting the line with ” and put the character \ before the apostrophe, and close the line with “.
So for example in French, “L\’hiver”.
But this does not work here, it is impossible to convert the *.po file into a *.mo file.
The bash shell is not practical with languages that use the apostrophe. It’s really not easy for developers and translators.For now, your solution is the best.
Thank you very much for your help.Best regards,
WallonMarch 29, 2023 at 12:21 am #103499MemberRobin
::So for example in French, “L\’hiver”.
But this does not work here, it is impossible to convert the *.po file into a *.mo file.Yes, this is true. Please use
\\'
instead, and write it this way:
L\\'hiverThe reason is: The Backslash \ itself is a special character also in bash, and needs to be escaped to remain the bash handling. If only a single of them is used here, bash eats it up, before it could perform its masking task in the place where it is needed. So you have to mask the backslash \ to \\ in order to make bash unaware of it, so it eats up the first \ as mask for the second, and delivers finally the \’ to the string where it is needed. Pretty queer way of thinking needed, I admit.
So, this double mask will allow to convert the po file again (and at least on both my systems: antiX 22 full 32bit and antiX 23 full 64 bit this works). As said, proper masking of quoting characters is a really tricky task. In each situation another masquerading is needed. Please check out whether this allow you to keep the proper french apostrophe.
P.S.: You’ll recollect probably some other translation resources needed the use of \\n or \\t instead of \n and \t for the very same reason.
Windows is like a submarine. Open a window and serious problems will start.
March 29, 2023 at 6:50 am #103518Member
Wallon
::Dear Robin,
You know a lot.
As soon as I have time, I will test this.
If it works, it will save PPC a lot of time.
But French is not the only language that uses apostrophes.
It’s really strange this Bash behaviour with French apostrophes.Thanks for the tip Robin.
Kind regards,
WallonMarch 29, 2023 at 3:39 pm #103557MemberRobin
::It’s really strange this Bash behaviour with French apostrophes.
It behaves all the same for the English apostrophe, when the ASCII representation is used instead of the tyographic UTF-8 replacements. The single difference is: The English speaking programmers don’t have to translate their own programs to English language, so they are not aware of all the pitfalls in their code. Otherwise it would have been improved long ago already.
Just keep in mind always: All the characters (maybe I’ve overlooked some)
Greater than > Less than < Equal sign = Vertical bar | Ampersand & Semicolon ; Comma , Percent sign % Backtick (Grave) Double Quoting " Single Quoting/apostrophe 'have special meaning in one or more programming languages. Whether they need to be masked or replaced by typographical UTF-8 characters is subject of the specific code. Only the programmer can know which of them will break his program or script on execution when used in translated strings and therefore should write exactly this piece of information into his developer notes.
The quoting characters are critical in particular, since they do signal to the program or to bash that what is included between a pair of them is to be interpreted as a literal string, causing all the other special characters within not to be treated as such, but used as simple characters instead (and also commands included not to be executed, keywords not to be recognised as such)
So, when you now add an additional quoting sign meant as an apostrophe to your text, it will be interpreted by e.g. bash (and other programs as well, depending on the programming language used) as end marker of the string, cutting the rest of the string off at this position, and causing all following special characters to be treated by their special meaning in the programming language again. Moreover the program interpreter doesn’t know what to do with the meaningless rest of the cut of string, which doesn’t represent any executable code (since it was meant as a literal string originally). No wonder the program is confused at best, stops working properly or even crashes at worst. And all this just for a single character used by a translator…So I consider it a really bad idea to use the problematic ASCII characters in the original strings already, causing trouble when the strings are copied 1:1 to the translation. And no translator can guess what the programmer knows about his code, as long the programmer doesn’t alert people about all the pitfalls by means of his developer notes. https://www.antixforum.com/forums/topic/antix-23-beta1-runit-full-64bit-for-testing/page/11/#post-103378
Try yourself on console, e.g. in roxterm:
Assume you want to print the sentence “Peter’s nice green bike” including the quoting characters by using the echo command.
$ echo '"Peter s nice green bike"' "Peter s nice green bike"(this was just to make sure it works basically without the apostrophe)
$ echo '"Peter's nice green bike"' >It will fail horribly, causing execution to stop and wait for further input. There is actually no way of masking the apostrophe by the backslash escape masquerading to make it work. (but you can end it by entering another ‘ and pressing enter, or simply abort by ctrl+c). Try:
$ echo '"Peter\'s nice green bike"' > $ echo '"Peter\\'s nice green bike"' > $ echo '"Peter\\\'s nice green bike"' >None of them works, but waits forever for additional input. Single thing you can do is: Add some more qoutings within your string.
$ echo '"Peter'"'"'s nice green bike"' "Peter's nice green bike"Yes, that looks pretty funny, but actually solves the issue in this case. Maybe the translation string in french we are talking about also needs this kind of masquerading. The developer should know which way literal apostrophes and qoutings in each of his strings must be masked properly and write about this in his developer’s notes, which are transported automatically from the program/script code # comments via .pot file to transifex.
As a translator at transifex you’ll only see the part of the string
Peter's nice green bike
for translation and never guess you’ll have to use
Peter'"'"'s nice green bike
to make it work in translation in cases like this example, if no developer’s note says so.Windows is like a submarine. Open a window and serious problems will start.
March 29, 2023 at 3:50 pm #103558MemberPPC
::Your warning about those “special characters”! is spot on, but sometimes there’s less complex ways to do what we wnat:
echo “Peter’s nice green bike”
Works.
I’ve been thinking if there’s a way to parse all the localization files and make sure no ofending characters are present, but it all on a per case basis – for example, in most line of my scripts an apostrophe does nothing wrong, but some times it’s inside single quotes (like in yad-updater’s part that invoques the terminal) and only then is problematic…
We are living in a computer world that was mostly created by english speaking persons , for english speaking persons…P.
- This reply was modified 1 month ago by PPC.
March 29, 2023 at 3:59 pm #103559MemberRobin
::echo “Peter’s nice green bike”
Works.
It works, for sure, but please post it’s output. Is it actually
"Peter's nice green bike"
or rather only
Peter's nice green bike
what comes back, lacking of the double quotes?And the translator at transifex can’t know whether your code uses
echo "\"Peter's nice green bike\""
or
echo '"Peter'"'"'s nice green bike"'
both of which require different methods of masquerade.We are living in a computer world that was mostly created by english speaking persons , for english speaking persons…
Unfortunately you are true, at least for the last few decades. But slowly, very slowly, things change again.
Windows is like a submarine. Open a window and serious problems will start.
March 29, 2023 at 4:10 pm #103561MemberPPC
::Sorry, Robin, the forum software seems to have changed the characters I used: it works if using the double quotes that are just 2 small parallel vertical lines- like the first output line from your previous post, sorry, I don’t know what that symbol is really called.
Try running echo on the text from that output. It works here in antiX 22… It’s the way I usually do, when I’m testing some bash script… I always use those quotes, they are in key 2 in the portuguese keyboard, if that helps…
I tried editing my previous post, I can’t make it accept the quotes I want!!!
P.
- This reply was modified 1 month ago by PPC.
March 29, 2023 at 4:10 pm #103562MemberRobin
::I’ve been thinking if there’s a way to parse all the localization files and make sure no ofending characters are present
I consider this as impossible, having pondered about this possibility myself already some time.
Windows is like a submarine. Open a window and serious problems will start.
-
AuthorPosts
- You must be logged in to reply to this topic.


