qgis / QGIS-Website

QGIS-Website
129 stars 285 forks source link

The QGIS website in French is not working properly #1210

Closed agiudiceandrea closed 6 months ago

agiudiceandrea commented 7 months ago

Description

After changing the language setting to "Français", the setting combo box incorrectly displays the item "English" instead of "Français" and it is not possible to subsequently set the language setting to any other language. Moreover, the popup window that usually shows up after clicking on the Download button doesn't show up anymore.

This is due to the fact that in the French translation QGIS est gratuit et le restera toujours s'il est téléchargé à partir de QGIS.org. there is an apostrophe char (U+0027 ' APOSTROPHE) which messes up the javascript code.

In order to fix the issues, the U+0027 ' APOSTROPHE must be removed from the French translation or substituted with the char U+2019 ’ RIGHT SINGLE QUOTATION MARK.

Page URL: https://qgis.org/fr/site/index.html

DelazJ commented 7 months ago

I reworded to avoid the use of the apostrophe. But I find it weird that the fix is to avoid that character which as far as I can say is quite common in French. And IMHO it is different from single quotation mark. Does javascript dislike that character or do we miss some formatting/libraries/functions in our scripts that would have covered this situation?

agiudiceandrea commented 7 months ago

The U+0027 ' APOSTROPHE is used as text delimiter in the javascript code, so using it in the text messes up the code with translated text:

else if (currentPage.match(/site\/forusers\/(download|alldownloads)\.html/g)){
            $($('body')[0]).append('<div id="thankyou"> <div id="thankyoucontent">'+
            '<h2>Merci !</h2> <p/>'+
            '<div class="container"><div class="span8">'+
            '<p><b>Votre copie fraîchement préparée de QGIS est en cours de téléchargement.</b></p>'+
            '<p>QGIS est gratuit et le restera toujours s'il est téléchargé à partir de QGIS.org.</p>'+
        '<p>Si vous souhaitez supporter le projet et les personnes qui développent le logiciel, vous pouvez contribuer en faisant <a href="https://donate.qgis.org/">une petite donation pour soutenir</a> nos efforts. Que vous choisissiez de contribuer ou non, nous espérons que vous apprécierez notre travail de passionnés et vous encourageons à partager et diffuser votre copie téléchargée à tous vents, pour que d’autres puissent également l’apprécier. Avec nos cordiales salutations!</p>'+
            '<p>L’Equipe QGIS</p>'+
            '</div><div class="container">'+
            '<div class="span4"><p><a class="btn btn-large btn-success btn-flat" href="https://donate.qgis.org/">Faites un don à QGIS</a></p><p class="muted"></p></div>'+
            '<div class="span5"><p><a id="closethankyou"class="btn btn-large btn-success btn-flat" href="#">Fermer ce message</a></p><p class="muted"></p></div>'+
            '</div>'+
            '<br/><p><img src="../_static/images/splash.png"/></p></div>');

The U+2019 ’ RIGHT SINGLE QUOTATION MARK is already used in the subsequent phrases pour que d’autres puissent également l’apprécier and L’Equipe QGIS without breaking the code.

I don't know how to avoid such issue while using the U+0027 ' APOSTROPHE.

The same issue already occurred 4 years ago: https://github.com/qgis/QGIS-Website/issues/680.

rduivenvoorde commented 7 months ago

Can we change to the use of " as string delimiters in that (very old) javascript of mine?

agiudiceandrea commented 7 months ago

The QGIS website in French is now correctly working.