inbo / INBOmd

An R package with a collection of RMarkdown styles and templates. Elaborate examples are available at https://github.com/inbo/INBOmd_examples
https://inbo.github.io/INBOmd
GNU General Public License v3.0
11 stars 2 forks source link

Add french styles #79

Closed ElsLommelen closed 2 years ago

ElsLommelen commented 2 years ago

This PR aims to fix a bug that occurs while building a report in language French. I tried adding French language for the different report formats, I am willing to expand it to other formats (poster, presentation, minutes,...) if the additions are appreciated.

I looked up the rules for international communication:

Basically I made French versions of the 'Flanders' report templates, in which I translated everything in the colofon that seemed appropriate. In the suggested citation I also translated 'reports of the Research Institute for Nature and forest', I don't know if this is appropriate? (Only for the report itself which is in French, I didn't change this for the reference list, so here references to reports will be in English.) I additionally made the french version link to the French website of the flemish government (INBO has no French site, so I kept the link to the English website there). Furthermore I adapted functions ebook(), gitbook() and report() in such way that option lang = "fr" would pass without errors and end in producing the right report.

ElsLommelen commented 2 years ago

@cecileherr Zou jij de vertalingen in commit 2523ba2 eens willen nakijken? Om het wat te situeren: het gaat hier over de vertaling van het INBOmd-sjabloon, dus dit zijn stukjes tekst die in de colofon van Franstalige INBO-rapporten komen. De eerste, wat langere tekst heb ik simpelweg door een vertaalrobot gehaald (dus best goed na te kijken), verder heb ik me deels laten inspireren door de colofon van een Franstalig boekje (dus minder letterlijk, maar meer gebruikelijke termen?). De vertaling van 'INBO' heb ik hier opgezocht, dus ik vermoed dat dit een officiële term is die we zo moeten gebruiken.

florisvdh commented 2 years ago

Great feature @ElsLommelen!

Just adding a note - this will apply to any non-Dutch language (including English). The bibliographic records of INBO reports, exported from PURE, have a series name "Rapporten van het Instituut voor Natuur- en Bosonderzoek" (same for "Mededelingen van ..." etc). So when generating bibliographies, a need to translate this would require customized bibliographic records. Same for the publisher, which is "Instituut voor Natuur- en Bosonderzoek". I'm not sure which approach we should suggest, or which is the minimum requirement. From a bibliographic point of view, a name is a fixed name (series name, publisher name), just like title.

CSL does support automated translation, but that applies to CSL terms, date formats and grammar rules, not to actual bibliographic data.

I should also add that we included a few custom language-specific CSL terms in our CSL style file (which INBOmd imports), i.e. to overrule a few of the CSL defaults, but that's currently only for Dutch and English. The style should probably be extended for French as well (after checking default behaviour) - suggestions for that are welcome in https://github.com/inbo/styles/issues. I'm happy to add this on my to-do list, but anyone is welcome to propose updates in a PR.

cecileherr commented 2 years ago

@ElsLommelen: oké, ik zal de vertaling in de loop van de week nakijken! @florisvdh: I must admit that I don't know the rules to translate CSL terms and other bibliographic elements into French (or any other language), but if you need a French speaking user to check translations or translate texts/elements: you know where to find me.

ElsLommelen commented 2 years ago

@florisvdh Good idea, thanks! I had noticed your addition, but I started the most notable things first last Friday... It looks rather straightforward if I only have to add to the xml, so I'll make a PR. @cecileherr Als je het toch aanbiedt... zou jij even de volgende suggesties willen bekijken (gebaseerd op wat rondsurfen, maar eigenlijk geeft enkel deze wikipagina een min of meer deftig overzicht):

florisvdh commented 2 years ago

so I'll make a PR

OK :+1:. Before hardcoding the ones you suggest, please check what CSL generates itself when language is set to French (Pandoc's lang variable, see tutorial). Some may be OK already. You'll need examples to check that; you can use the inbomd-examples repo for that.

ElsLommelen commented 2 years ago

As slides are more or less language independent (logo of Flanders shouldn't be translated, so only user added content determines the language), this PR basically adds the french language for style Flanders. For making a similar translation for style INBO, we need a French translation of the INBO logo. Please let me know if this translation is desired.

ElsLommelen commented 2 years ago

Concerning the failed check: apparently there is a new version of Roxygen, but it seems to mess up the double quotes in the documentation, at least in Windows. So maybe it should better be updated using a Linux OS?

florisvdh commented 2 years ago

@ElsLommelen regarding the .sty files, I believe these weren't maintained anymore during latest updates of the CSL style file, since we agreed to rely on CSL only IIRC. CSL is always used by Pandoc for non-PDF output, while for PDF there's choice (either TeX's natbib package or Pandoc's CSL processor) but we now favour CSL too in PDF, which gives more consistent results between formats and lowers maintenance. The approach also benefits the use of more standardized CSL-JSON or CSL-YAML formats, compared to BibTeX, to contain the bibliographic metadata, since these don't need to be converted for Pandoc's CSL processor (see also RStudio's VME citation tool). Some background information about that is given by https://retorque.re/zotero-better-bibtex/exporting/pandoc/#use-csl-not-bibtex-with-pandoc.

ElsLommelen commented 2 years ago

@florisvdh Eh, I'm not sure I understand you correctly, but to me the .sty files still seem to be in use. I don't find any colophon information in the CSL style file, and apparently my changes in the .sty files make the desired changes in the generated report (e.g. translation of words/expressions such as 'author', 'way of quoting' and 'cover photo' in the colophon into french). (As I remember well, @ThierryO had already prepared the addition of the colophon in previous updates, so maybe that's why he didn't have to change the .sty files for adding the colophon in the last update?)

As for the bibliography, I haven't changed anything: as you suggested, I first tested the default french style, and this seems fine: editor and edition are abbreviated as éd, and 'et al.' is the same as in English and Dutch. (I thought I had already added a comment mentioning that a PR in your repo wasn't needed, but apparently I forgot to submit it.)

florisvdh commented 2 years ago

.sty: Sorry, I was mistaken, should have checked better. What I said relates to .bst (BibTeX style), not .sty. So it's not applicable here.

Thanks for checking the French defaults! Maybe the nodate term still needs improvement?

ElsLommelen commented 2 years ago

Honestly I don't know, this case wasn't added to the examples. Maybe it would be a good idea to add an example with s.d. to the INBOmd-examples repo? Do you for any chance have a reference that could fit there? (Honestly I haven't worked with references for years, so it would take me quite some time to figure out how to add one myself.)

cecileherr commented 2 years ago
  • edition: éd.
  • no date: s.d.
  • et-al: et al.
  • editor: éd. (en dit gebruiken voor zowel enkelvoud als meervoud?)

Correct as far as I know (and éd. can indeed be used for the plural editors).

florisvdh commented 2 years ago

@ElsLommelen there's already a nodate-example. See https://inbo.github.io/inbomd_examples/citation_style/nl/index.html:

Databank Ondergrond Vlaanderen (s.d.). Bepalen Gemiddelde Grondwaterstand Op Een Plaats. https://www.dov.vlaanderen.be/page/bepalen-gemiddelde-grondwaterstand-op-een-plaats (geraadpleegd 24 juli 2018).

ElsLommelen commented 2 years ago

there's already a nodate-example. See https://inbo.github.io/inbomd_examples/citation_style/nl/index.html:

Thanks, I overlooked it... Apparently this is shown as s. d., so with a space in between, so maybe we could remove this space?

ElsLommelen commented 2 years ago

Thanks @cecileherr, I added your corrections and suggestions.

ElsLommelen commented 2 years ago

@florisvdh the following steps should be done here, would you mind doing them?

ElsLommelen commented 2 years ago

Issues still to be addressed:

ThierryO commented 2 years ago

I'm fine with Reviewers.

We should probably update address in the Dutch and English versions too. And in their Word / gDoc alternatives! Mention this to the person how insisted on updating the address in the French version.

It seems like the URL https://www.ditisvlaanderen.be no longer exists and this triggers the new NOTE. The best solution would be to remove that URL from the package and update the text.

ElsLommelen commented 2 years ago

I noticed the Flemish style reports were not yet added to the introduction vignette, so I added them in commit 5ea8360