lenmus icon indicating copy to clipboard operation
lenmus copied to clipboard

French translation

Open fred555547 opened this issue 5 years ago • 57 comments

I'm working on the french translation of lenmus. Is there a way to see the result of the translation with lenmus ?

fred555547 avatar Apr 17 '20 09:04 fred555547

I'm working on the french translation of lenmus

Glad to know. Thank you very much !!! . To see the results of your translation:

  • For the GUI, first, you have to generate the lenmus_fr.mo file from the lenmus_fr.po file. Then replace the file lenmus_fr.mo with the new one in: Linux: /usr/local/share/lenmus/5.6.1/locale/fr/lenmus_fr.mo Windows: C:\Program Files\lenmus\locale\fr\lenmus_fr.mo

  • For the eBooks it is more complex and I have nothing ready to be used by translators. So please send me the po file for any eBook at any stage and I will return you in short time the translated eBook. Yo have to replace the new eBook in: Linux: /usr/local/share/lenmus/5.6.1/locale/fr/books/ Windows: C:\Program Files\lenmus\locale\fr\books<new-translated-book>

The translation process for eBooks is not simple. The eBooks are written in English as XML files. See for instance, the TheoryHarmony book:     https://github.com/lenmus/lenmus/tree/master/books/src/TheoryHarmony

The translation is done by using the PO files for each eBook:

  1. The eBook sources in XML are processed by LenMus tool 'langtool' (https://github.com/lenmus/langtool).
  2. 'langtool' program extracts the strings to translate and creates the PO file for the eBook.
  3. The PO file is sent to the translator.
  4. When the translated PO file is received back, the MO file is generated and the eBook is again processed by 'langtool' to generate the translated book.

Why to translate the eBooks using PO files instead of just translating the XML files? The point is that it is relatively simple to do a translation when you have to translate everything in a document. The difficult part comes when you have to maintain your work. Detecting which parts did change and need to be updated is tiring, error-prone and highly unpleasant.

Think about a typical review scenario for a translator:

  1. Compare the previous English file with the new one.
  2. Identify the changes.
  3. Identify where theses changes must be introduced in the translated document.
  4. Finally, do the real translation work.

Steps 1 to 3 are tedious and unpleasant. But by using PO files and 'langtool', the computer does these steps for you.

As said, send me at any time the po file for any eBook at any translation stage and I will return you as soon as possible the translated eBook to be tested.

Thank you!

cecilios avatar Apr 17 '20 12:04 cecilios

I didn't realize that I have not updated the lenmus_fr.po file after the last release so the lenmus_fr.po file in the repo do not contain the latest strings. But po files for eBooks are still valid as there were no changes to the eBooks. I have updated the lenmus_fr.po file and it is now uploaded to the repo. Please download it from https://github.com/lenmus/lenmus/tree/master/locale/fr

If you already have started reviewing lenmus.po, please sent it to me. I will update it an return it to you so you don't lose the work done so far.

Thank you.

cecilios avatar Apr 18 '20 08:04 cecilios

Thank you Cecilios ! I've installed the v5.6.2 from Ubuntu snap : in the Gui, the translation was partial. You must notice that the files are in /usr/share/lenmus/... Now, I have compiled and installed from the sources : lenmus takes my translation, except some entries are missing ... I double check with the link you provided and keep you informed.

fred555547 avatar Apr 18 '20 20:04 fred555547

Hi Cecilios, PoEdit cannot open the po files. The content of the po files is identical to the mo files ...

fred555547 avatar Apr 18 '20 20:04 fred555547

Hi Cecilios, I also tried to build the langtool tool but I got a fatal error :Building LenMus langtool Scanning dependencies of target langtool [ 18%] Building CXX object CMakeFiles/langtool.dir/src/command.cpp.o [ 18%] Building CXX object CMakeFiles/langtool.dir/src/dlg_compile_book.cpp.o [ 27%] Building CXX object CMakeFiles/langtool.dir/src/ebook_processor.cpp.o [ 36%] Building CXX object CMakeFiles/langtool.dir/src/help_processor.cpp.o In file included from /home/fred/project/langtool/src/ebook_processor.cpp:44:0: /home/fred/project/langtool/packages/wxXml2/include/wx/xml2.h:38:10: fatal error: libxml/xmlmemory.h: Aucun fichier ou dossier de ce type #include <libxml/xmlmemory.h> ^~~~~~~~~~~~~~~~~~~~ compilation terminated. CMakeFiles/langtool.dir/build.make:110: recipe for target 'CMakeFiles/langtool.dir/src/ebook_processor.cpp.o' failed make[2]: *** [CMakeFiles/langtool.dir/src/ebook_processor.cpp.o] Error 1 make[2]: *** Attente des tâches non terminées.... In file included from /home/fred/project/langtool/src/help_processor.cpp:44:0: /home/fred/project/langtool/packages/wxXml2/include/wx/xml2.h:38:10: fatal error: libxml/xmlmemory.h: Aucun fichier ou dossier de ce type #include <libxml/xmlmemory.h> ^~~~~~~~~~~~~~~~~~~~ compilation terminated. CMakeFiles/langtool.dir/build.make:134: recipe for target 'CMakeFiles/langtool.dir/src/help_processor.cpp.o' failed make[2]: *** [CMakeFiles/langtool.dir/src/help_processor.cpp.o] Error 1 CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/langtool.dir/all' failed make[1]: *** [CMakeFiles/langtool.dir/all] Error 2 Makefile:83: recipe for target 'all' failed make: *** [all] Error 2

fred555547 avatar Apr 18 '20 21:04 fred555547

Do you have the "libxml2-dev" package installed ?

trebmuh avatar Apr 18 '20 22:04 trebmuh

PoEdit cannot open the po files. The content of the po files is identical to the mo files ...

Please download the PO file from here https://github.com/lenmus/lenmus/blob/master/locale/fr/lenmus_fr.po You do not need to download the MO file. lenmus_fr.po is 161 KB and lenmus_fr.mo is 62,3 KB. They are different. PO files are plain text and MO files are just the same content but in binary and with indexes for quick access.

If you try to see the MO file at GitHub using the web browser, probably it will be downloaded and opened in your computer using poEdit (or the po editor you have) and it will look the same as if you has opened the po file. But they are different. You must not edit the MO files.

cecilios avatar Apr 19 '20 08:04 cecilios

As commented by @trebmuh you need to install the "libxml2-dev" package.

Langtool is a mess. At first, I used HTML, then XML, also some markup language. But I never cleaned the program for third party use. When you run the program you will see some pop up windows for debugging and trace. It is not ready for general use but it works.

cecilios avatar Apr 19 '20 08:04 cecilios

@fred555547

I've installed the v5.6.2 from Ubuntu snap

I have not created a snap package !!!

You must notice that the files are in /usr/share/lenmus/...

I've re-checked and it should be installed in /usr/local/share/lenmus/... (!).

Could you please give me the link to the snap page from which you downloaded LenMus?

cecilios avatar Apr 19 '20 08:04 cecilios

How to use langtool to generate the translated eBook

When the PO file is translated, verify, generate the MO file and leave it in 'langtool/locale/xx'

Now run langtool. You will see this screen: image

Close the pop up. Then another pop-up appears: image

Close it or move it to left or right: image

Now, choose menu 'eBook > Compile eBook'. The program ask for the source XML file and the desired languages. Chose French. An choose the folder containing the sources for the eBook to translate, for instance: image

langtool will then translate the eBook, generate the compiled eBook file (.LMB) and leave it in folder 'lenmus\locale\xx'. When it finishes with the translation it display the last element translated and a pop-up window with the last string translated, something like this: image

If there are crashes the most probably cause is a string with un-paired tags in the PO file translation.

A mess!

cecilios avatar Apr 19 '20 09:04 cecilios

@cecilios

Do you have the "libxml2-dev" package installed ? I'm using Xubuntu 18.04 LTS low latency Yes I did ... But there might be an issue with the CMake configuration. I also installed CMake and performed with the following : source code : /home/fred/project/langtool binaries : /home/fred/project/langtool/z_bin Generator for the project : Unix Makefiles Use default native compilers Configure : /home/fred/project/langtool/z_bin LIBXML2_LIBRARIES => /usr/lib/x86_64-linux-gnu/libxml2.so wxWidgets => -L/usr/lib/x86_64-linux-gnu-pthread-lwx_gtk2u_aui-3.0-lwx_baseu-3.0-lwx_gtk2u_gl-3.0-lwx_baseu_net-3.0-lwx_gtk2u_richtext-3.0-lwx_baseu_xml-3.0-lwx_gtk2u_xrc-3.0-lwx_gtk2u_core-3.0-lwx_gtk2u_adv-3.0-lwx_gtk2u_html-3.0 SRC_DIR => /home/fred/project/langtool/src WXXML2_DIR => /home/fred/project/langtool/packages/wxXml2 wxWidgets libraries => -L/usr/lib/x86_64-linux-gnu-pthread-lwx_gtk2u_aui-3.0-lwx_baseu-3.0-lwx_gtk2u_gl-3.0-lwx_baseu_net-3.0-lwx_gtk2u_richtext-3.0-lwx_baseu_xml-3.0-lwx_gtk2u_xrc-3.0-lwx_gtk2u_core-3.0-lwx_gtk2u_adv-3.0-lwx_gtk2u_html-3.0 LibXml2 libraries => /usr/lib/x86_64-linux-gnu/libxml2.so Configuring done Generating done And then, as I'm not a geek, I don't known how to proceed ...

I you have some ideas.

fred555547 avatar Apr 19 '20 09:04 fred555547

@cecilios : I grabbed the po file with wget but the content is a mo file. wget https://github.com/lenmus/lenmus/blob/master/locale/fr/lenmus_fr.po But I got it in raw format and firefox ;-)

I've installed the v5.6.2 from Ubuntu snap

I have not created a snap package !!! I'm sorry : I downloaded the deb file and the installation was done by "Logiciel", and Ubuntu tool.

fred555547 avatar Apr 19 '20 10:04 fred555547

To build, the simples approach is to open a command window and do:

cd <my/projects/folder>/langtool
mkdir mybuild
cd mybuild
cmake -DLIBXML2_LIBRARIES=/usr/lib/x86_64-linux-gnu/libxml2.so.2 ..
make

Change /usr/lib/x86_64-linux-gnu/libxml2.so.2 by the path to your libxml2.so library. Do not forget the two dots at the end of the cmake command, for pointing to parent folder.

This will create the executable at ../z_build. To run it:

cd ../z_build
./langtool

cecilios avatar Apr 19 '20 10:04 cecilios

If you do

wget https://github.com/lenmus/lenmus/blob/master/locale/fr/lenmus_fr.po

This will download the HTML page not the file!

To download the file you need to download the raw content (what you see when clicking on button [Raw] in previous page). Do

wget https://raw.githubusercontent.com/lenmus/lenmus/master/locale/fr/lenmus_fr.po

cecilios avatar Apr 19 '20 10:04 cecilios

I did the following cmake -DLIBXML2_LIBRARIES=/usr/lib/x86_64-linux-gnu/libxml2.so.2 -DLIBXML2_INCLUDE_DIR=/usr/include/libxml2/libxml .. I always get the same error ` -- LIBXML2_LIBRARIES => /usr/lib/x86_64-linux-gnu/libxml2.so.2 -- wxWidgets => -L/usr/lib/x86_64-linux-gnu-pthread-lwx_gtk2u_aui-3.0-lwx_baseu-3.0-lwx_gtk2u_gl-3.0-lwx_baseu_net-3.0-lwx_gtk2u_richtext-3.0-lwx_baseu_xml-3.0-lwx_gtk2u_xrc-3.0-lwx_gtk2u_core-3.0-lwx_gtk2u_adv-3.0-lwx_gtk2u_html-3.0 -- SRC_DIR => /home/fred/project/langtool/src -- WXXML2_DIR => /home/fred/project/langtool/packages/wxXml2 -- wxWidgets libraries => -L/usr/lib/x86_64-linux-gnu-pthread-lwx_gtk2u_aui-3.0-lwx_baseu-3.0-lwx_gtk2u_gl-3.0-lwx_baseu_net-3.0-lwx_gtk2u_richtext-3.0-lwx_baseu_xml-3.0-lwx_gtk2u_xrc-3.0-lwx_gtk2u_core-3.0-lwx_gtk2u_adv-3.0-lwx_gtk2u_html-3.0 -- LibXml2 libraries => /usr/lib/x86_64-linux-gnu/libxml2.so.2 -- Configuring done -- Generating done -- Build files have been written to: /home/fred/project/langtool/mybuild fred@fred:~/project/langtool/mybuild$ make [ 9%] Building CXX object CMakeFiles/langtool.dir/src/ebook_processor.cpp.o In file included from /home/fred/project/langtool/src/ebook_processor.cpp:44:0: /home/fred/project/langtool/packages/wxXml2/include/wx/xml2.h:38:10: fatal error: libxml/xmlmemory.h: Aucun fichier ou dossier de ce type #include <libxml/xmlmemory.h> ^~~~~~~~~~~~~~~~~~~~ compilation terminated. CMakeFiles/langtool.dir/build.make:110: recipe for target 'CMakeFiles/langtool.dir/src/ebook_processor.cpp.o' failed make[2]: *** [CMakeFiles/langtool.dir/src/ebook_processor.cpp.o] Error 1 CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/langtool.dir/all' failed make[1]: *** [CMakeFiles/langtool.dir/all] Error 2 Makefile:83: recipe for target 'all' failed make: *** [all] Error 2

`

fred555547 avatar Apr 19 '20 12:04 fred555547

It seems there is an issue with the path /usr/include/libxml2. I attached CmakeCache.txt that seems OK.

I when a little bit further when giving the full path of xmlmemory.h in ~/project/langtool/packages/wxXml2/include/wx/xml2.h #include <libxml/xmlmemory.h> replaced by #include </usr/include/libxml2/libxml/xmlmemory.h> Next error was with the file xmlversion.h

CMakeCache.txt

fred555547 avatar Apr 19 '20 13:04 fred555547

In my computer I do not have libxml2-dev installed, only libxml2. After investigating how can I build without libxml2-dev (the headers) the answer is that langtool uses wxXml2, a wxWidgets wrapper for libxml2. And the sources include the headers for libxml2, that I did'nt uploaded to the repo. It is not clear if wxXml2 is currently maintainded.

I have to review the build process for langtool. There are several things to do:

  • Fix the cmake module for finding libxml2
  • Check to build using libxml2-dev package
  • Check the maintenace state of wxXml2 or, better, replace it to have less dependencies.

As this will take me some time, I have uploaded to the repo the libxml2 headers that wxWxml2 uses (works in my computer). Update your local copy of langtool. Then try to build with:

cd /home/fred/project/langtool
mkdir mybuild
cd mybuild
cmake -DLIBXML2_LIBRARIES=/usr/lib/x86_64-linux-gnu/libxml2.so ..
make

You don't need to specify -DLIBXML2_INCLUDE_DIR=/usr/include/libxml2/libxml

Tell me this still fails. Remember that before trying a new build you have to clear the build forder:

cd /home/fred/project/langtool/mybuild
rm -rf *        # be sure your are in the right folder before doing this !!!!
cmake [.......]

cecilios avatar Apr 19 '20 13:04 cecilios

Ok, now CMakeList.txt is fixed. You no longer need the headers I uploaded a few minutes agoo. I have removed them. Download the latest version of CMakeList.txt and try again:

cd /home/fred/project/langtool
mkdir mybuild
cd mybuild
cmake ..
make

You don't need to specify anything in cmake command. Please tell me if this still fails. Remember that before trying a new build you have to clear the build forder:

cd /home/fred/project/langtool/mybuild
rm -rf *        # be sure your are in the right folder before doing this !!!!
cmake ..
make

cecilios avatar Apr 19 '20 14:04 cecilios

Ah! and you need to install libxml2-dev:

sudo apt-get install libxml2-dev

cecilios avatar Apr 19 '20 14:04 cecilios

Hi, I fixed the problem. In theCMakeLists.txt file, I added the line /usr/include/libxml2 in the include_directories section. And now it's OK and I'm happy CMakeLists.txt

fred555547 avatar Apr 19 '20 14:04 fred555547

:thumbsup: Yes, that was the solution. But the right way of including the path is not as some constant path because then it only works in your platform. You have to include the path found when looking for libxml2. Look at how I did it: https://github.com/lenmus/langtool/commit/bd6857a86ecbf93df1e588e09c809fd6b44958e3

cecilios avatar Apr 19 '20 14:04 cecilios

This the first time I fix a bug ! Anyway, your way is the best, for sure. Now, I'm going the improve the french translation, using langtool. The reason is that, as in spannish, adverbs have a gender. For exemple augmented can translated to 'augmenté' when dealing with 'un intervalle augmenté' or augmentée if dealing with 'une quarte aumentée '.

fred555547 avatar Apr 19 '20 15:04 fred555547

That is going to be difficult to fix for now. The only solution I can think to solve this is to not split sentences. That is, translate full sentences: "augmented second", "augmented third", etc. instead of a list "second", "third" ... and a few adjectives "augmented", "diminished", etc. than later are combined in the program. This is going to be more work for translators but the translation will be better. I'm afraid this can not be done in short time as this change requires to review the source code to locate all strings and make the appropriate changes.

I have opened issue #105 for this.

cecilios avatar Apr 19 '20 15:04 cecilios

There is another way : the translation of the english eBooks ... Anayway, let's go in the usual way, we will see if we need to improve it later. This gives me time to see and analyse the résult

fred555547 avatar Apr 19 '20 16:04 fred555547

There is another way : the translation of the english eBooks

I have doubts, as for eBooks the translation units should be full sentences. I see the problem in the exercises (lenmus_xx.po file) not in the texts for the eBooks.

cecilios avatar Apr 19 '20 16:04 cecilios

I founded some spanish sentences in the lenmus_fr.po. Acorde completo. Contiene todas las notas (en todo caso, elidir la 5ª) what is the meaning of 'completo' and 'elidir la 5ª'

fred555547 avatar Apr 19 '20 19:04 fred555547

Sorry. If you find any other one in Spanish (I don't think so) forget about those sentences. Those are messages not yet used that I didn't know how to translate into English. The approximate meaning is "Full chord. Contains all the notes (in any case, supress the 5th)" but I have doubts about English musical terms, such as Spanish 'elidir' (suppress?, elide?), or 'acorde completo' (full chord? complete chord?)

cecilios avatar Apr 19 '20 21:04 cecilios

This is interesting. Without the context (I have to read the exercise book I guess), a full chord is a triad : dominant, major third and fifth. So if you remove the fifth ... I might be wrong ... The best is to give an exemple so I can compare to french. For some translations, I use the lilypond glossary. It seems the term Reload, in the File menu, is not in the lenmus_fr.po. Could you confirm ?

fred555547 avatar Apr 20 '20 19:04 fred555547

a full chord is a triad : dominant, major third and fifth. So if you remove the fifth ...

Yes, that is the meaning of Acorde completo. But I don't know how is it named in English, probably full chord but I need to confirm. An in certain cases, in harmony, the fifth of the chord is removed. That is a chord with _la 5ª elidida" (in English, supressed? removed? elided?). But that string is not necessary. Is part on some exercises for studying chord progressions that are not yet finished. Forget about that translation.

It seems the term Reload, in the File menu, is not in the lenmus_fr.po. Could you confirm ?

I've been checking and ... good catch!. In the code, the word "Reload" (used in the File menu) is not marked for translation and, thus, it is not included in the PO file. I have fixed the code but, in any case, it is impossible to translate for current binary packages. Once your translation is ready and I receive your PO file I will update it and fix the translation. What is the French translation for it, Recharger?

cecilios avatar Apr 20 '20 21:04 cecilios

Perfecto ! Eso es la palabra en francés (sorry I've a french keyboard)

fred555547 avatar Apr 20 '20 21:04 fred555547