Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

French translation (vignettes) #6455

Merged
merged 8 commits into from
Nov 11, 2024
Merged

French translation (vignettes) #6455

merged 8 commits into from
Nov 11, 2024

Conversation

phgrosjean
Copy link
Contributor

This is the French translation for fr.po and R-fr.po.

This is also the translation of the ten vignettes in French, in an "fr" subdirectory as discussed in #6221 (@MichaelChirico "As long as it actually works, I agree for now putting it in subdirectories is the way to go.")

However, the vignettes in subdirectories are not listed in the main help page of the package, nor by vignette(). This is a problem (they are essentially "unusable" as such). Also, there are twice more vignettes to compile now, and possibly even more if there are other translations.

So, the solution to place translated vignettes in a {data.table.fr} package along with the translation of the man pages may be a better solution. I also did a trial in this direction in phgrosjean/data.table.fr.

Please, check both approaches before deciding for this pull request.

@rffontenelle
Copy link
Contributor

Out of curiosity, what are the commands you ran to generate the PO files and the MO files?

@phgrosjean
Copy link
Contributor Author

We (we are indeed 5 translators) use poEdit to get the .po file from the .pot template, and when the .po file is saved in poEdit, the .mo file is automatically created.

@rffontenelle
Copy link
Contributor

I now remembered you mentioned using rmdpo for extracting the POT from the vignettes.

@phgrosjean
Copy link
Contributor Author

@rffontenelle Oh yes, sorry, you asked for the vignettes. We used indeed {rmdpo}. For now, it directly updates the existing .po file with changes in the vignette, but a pathway using a .pot file would be better.

The various files are here and in subdirectories, and the script that generates these files is here

We still have to figure out how to work with Weblate, if and when this will be available for {data.table}.

@tdhock
Copy link
Member

tdhock commented Sep 3, 2024

Should there be a brief documentation somewhere about who was responsible for the translation of the vignette (so they can get credit, and to stay in contact for updates), as well as what resources were used for the translation? RFrench dictionary, {rmdpo}, etc. Probably for authorship DESCRIPTION Authors@R is best, with comment="French translation of vignettes and messages" or similar.
I'm not sure what would be the best place to document what resources were used, maybe that can stay out of the repo? for example on a wiki page? https://github.com/Rdatatable/data.table/wiki/Translations

However, the vignettes in subdirectories are not listed in the main help page of the package, nor by vignette(). This is a problem (they are essentially "unusable" as such). Also, there are twice more vignettes to compile now, and possibly even more if there are other translations.

For distributing the vignettes in a separate package, a drawback would be that it is not as easy for users to discover the additional vignettes in data.table.fr package (compared to the English vignettes in data.table package).

If we wanted to maintain discoverability, and keep the French vignettes in data.table package, we could move them to the main vignettes directory, but that may be a problem for build times?

Another place users may want to discover vignettes is on http://rdatatable.gitlab.io/data.table/ so I wonder how the vignettes would appear there?

@phgrosjean
Copy link
Contributor Author

In phgrosjean/data.table.fr, translators are listed as contributors of the package, but this is not totally correct. We should list vignettes authors + translators with a clear indication of who did what. Is there a list of vignettes authors (a subset of all {data.table} authors, I suppose)?

Otherwise, I think French vignettes should appear in the menu Vignettes > fr > ... if the site is build using {pkgdown} on http://rdatatable.gitlab.io/data.table/. Could you try it in a sandbox somewhere?

Ideally, English vignettes should be replaced by French ones at the different places when the user sets LANGUAGE=fr as environment variable, but R help, vignette(), {pkgdown}... are not build like that. They are monolingual. Period. (for now)

This is a discussion for the R translation working group. But in the meantime, we have to find a satisfactory transient solution for {data.table}.

@phgrosjean
Copy link
Contributor Author

Oh, and there is also the translation of the cheatsheet. Where to place it?

@tdhock
Copy link
Member

tdhock commented Sep 4, 2024

the cheat sheets currently go in rstudio/cheatsheets#367

- paquet -> package in R-fr.po, datatable-importing.Rmd and datatable-reshape.Rmd
- `"JFK" et "LAX"`-> `c("JFK", "LAX")` i, datatable-secondary-indices-and-auto-indexing.Rmd
@phgrosjean
Copy link
Contributor Author

@tdhock New commit integrating the changes (paquet -> package) and c("JFK", "LAX")

@MichaelChirico
Copy link
Member

Thanks so much! Would you mind splitting this into two PRs? One with the main package .po, the other with the vignette changes? Clearly the latter requires a bit more careful thought. The former can be merged right away.

.ci/.lintr.R Outdated
@@ -73,7 +73,7 @@ rm(dt_linters)
# TODO(lintr#2172): Glob with lintr itself.
exclusions = c(local({
exclusion_for_dir <- function(dir, exclusions) {
files = file.path("..", list.files(dir, pattern = "\\.(R|Rmd|Rraw)$", full.names=TRUE, recursive=TRUE))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why revert this :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I had to re-fork the repository and I did not notice this when I did my commit.
I'll do a separate pull request for the main package .po files, since the discussion here is mainly about vignettes.

@phgrosjean phgrosjean changed the title French translation (messages and vignettes) French translation (vignettes) Sep 5, 2024
@phgrosjean
Copy link
Contributor Author

OK, only the vignettes in French in this pull request now.

@MichaelChirico MichaelChirico added the translation issues/PRs related to message translation projects label Sep 21, 2024
@tdhock
Copy link
Member

tdhock commented Oct 4, 2024

lint currently says

Warning: file=vignettes/fr/datatable-keys-fast-subset.Rmd,line=64,col=23,[sample_int_linter] sample.int(n, m, ...) is preferable to sample(1:n, m, ...).
Warning: file=vignettes/fr/datatable-keys-fast-subset.Rmd,line=65,col=23,[sample_int_linter] sample.int(n, m, ...) is preferable to sample(n, m, ...).
Warning: file=vignettes/fr/datatable-keys-fast-subset.Rmd,line=413,col=21,[sample_int_linter] sample.int(n, m, ...) is preferable to sample(n, m, ...).
Warning: file=vignettes/fr/datatable-secondary-indices-and-auto-indexing.Rmd,line=288,col=21,[sample_int_linter] sample.int(n, m, ...) is preferable to sample(n, m, ...).

other than that, is this PR ready to merge?

Could you try it in a sandbox somewhere?

I have not checked if we can see vignettes on pkgdown site yet, I will try on my local machine.

@tdhock
Copy link
Member

tdhock commented Oct 4, 2024

I got an error, am I doing the build wrong?

> pkgdown::build_site("~/R/data.table")
── Installing package data.table into temporary library ────────────────────────
── Building pkgdown site for package data.table ────────────────────────────────
Reading from: ~/R/data.table
Writing to: ~/R/data.table/docs
── Sitrep ──────────────────────────────────────────────────────────────────────
✖ URLs not ok.
  In DESCRIPTION, URL is missing package url
  (https://rdatatable.gitlab.io/data.table).
  See details in `vignette(pkgdown::metadata)`.Favicons ok.Open graph metadata ok.Articles metadata ok.Reference metadata ok.
── Initialising site ───────────────────────────────────────────────────────────
── Building home ───────────────────────────────────────────────────────────────
✖ Icon "fas fa-home fa-lg" lacks an `aria-label`.Specify `aria-label` to make the icon accessible to screen readers.Learn more in `vignette(pkgdown::accessibility)`.
This message is displayed once every 8 hours.
Reading datatable-benchmarking.md
Writing `datatable-benchmarking.html`
Reading GOVERNANCE.md
Reading NEWS.0.md
Reading NEWS.1.md
Reading Seal_of_Approval.md
Reading .github/CONTRIBUTING.md
Reading README.md
Writing `404.html`
── Building function reference ─────────────────────────────────────────────────
Reading man/address.Rd
Writing `reference/address.html`
Reading man/all.equal.data.table.Rd
Reading man/as.data.table.Rd
Reading man/as.data.table.xts.Rd
Reading man/as.matrix.Rd
Reading man/as.xts.data.table.Rd
Reading man/assign.Rd
Reading man/between.Rd
Reading man/cdt.Rd
Reading man/chmatch.Rd
Writing `reference/chmatch.html`
Reading man/coalesce.Rd
Reading man/copy.Rd
Reading man/data.table-class.Rd
Reading man/data.table.Rd
Writing `reference/data.table.html`
Reading man/datatable-optimize.Rd
Reading man/dcast.data.table.Rd
Reading man/deprecated.Rd
Reading man/duplicated.Rd
Reading man/fcase.Rd
Reading man/fdroplevels.Rd
Reading man/fifelse.Rd
Reading man/foverlaps.Rd
Reading man/frank.Rd
Reading man/fread.Rd
Reading man/froll.Rd
Writing `reference/froll.html`
Reading man/fsort.Rd
Writing `reference/fsort.html`
Reading man/fwrite.Rd
Reading man/groupingsets.Rd
Reading man/IDateTime.Rd
Reading man/J.Rd
Reading man/last.Rd
Reading man/last.updated.Rd
Reading man/like.Rd
Reading man/measure.Rd
Reading man/melt.data.table.Rd
Reading man/merge.Rd
Reading man/na.omit.data.table.Rd
Reading man/nafill.Rd
Reading man/notin.Rd
Reading man/openmp-utils.Rd
Reading man/patterns.Rd
Reading man/print.data.table.Rd
Reading man/rbindlist.Rd
Reading man/rleid.Rd
Reading man/rowid.Rd
Reading man/setattr.Rd
Writing `reference/setattr.html`
Reading man/setcolorder.Rd
Reading man/setDF.Rd
Reading man/setDT.Rd
Reading man/setkey.Rd
Reading man/setNumericRounding.Rd
Reading man/setops.Rd
Reading man/setorder.Rd
Reading man/shift.Rd
Reading man/shouldPrint.Rd
Reading man/special-symbols.Rd
Reading man/split.Rd
Reading man/subset.data.table.Rd
Reading man/substitute2.Rd
Reading man/tables.Rd
Reading man/test.data.table.Rd
Reading man/test.Rd
Reading man/timetaken.Rd
Writing `reference/timetaken.html`
Reading man/transform.data.table.Rd
Reading man/transpose.Rd
Reading man/truelength.Rd
Reading man/tstrsplit.Rd
Reading man/update_dev_pkg.Rd
── Building articles ───────────────────────────────────────────────────────────
Reading vignettes/datatable-benchmarking.Rmd
Warning message:
Failed to parse example for topic "update_dev_pkg" 
Error: 
! in callr subprocess.
Caused by error in `.f(.x[[i]], ...)`:
! Failed to render vignettes/datatable-benchmarking.Rmd.Warning message:In file(con, "r") :cannot open file 'css/toc.css': No such file or directory
Caused by error:
! cannot open the connectionSee `$stderr` for standard error.
Type .Last.error to see the more details.

in https://github.com/Rdatatable/data.table/blob/master/.gitlab-ci.yml (where I think the site is usually built) I see

  script:
    - R --version
    - *install-deps ## markdown pkg not present in r-pkgdown image
    - mkdir -p ./pkgdown/favicon/ && cp .graphics/favicon/* ./pkgdown/favicon/ ## copy favicons
    - rm -rf ./vignettes ## r-lib/pkgdown#2383
    - Rscript -e 'pkgdown::build_site(override=list(destination="./website"))'

@MichaelChirico
Copy link
Member

lint currently says

Ignore that, it's present in the original but skipped:

sample_int_linter = Inf

(or if anything, it should be fixed by a similar lintr config setup)

@tdhock
Copy link
Member

tdhock commented Oct 7, 2024

so there are three blocking points that we need to decide before merging this PR.

  1. do we keep vignettes in vignettes/fr sub-directory (probably not visible on CRAN, but visible on pkgdown site according to @phgrosjean but I was unable to verify because I got an error when I tried to build), or do we move them to regular vignettes directory? (should be visible on CRAN as well). I tend to think that for the short term we should just move them to the regular vignettes directory, so we can see them on CRAN, and maybe later we can move them?
  2. do we want to add links between the different translations (link to French version on top of English version, etc) ?
  3. where to give authorship credit to translators? I would suggest adding them to data.table/DESCRIPTOIN as below, is that OK?
  person("Philippe","Grosjean", role="ctb", comment = "French translation"),

@AngelFelizR
Copy link
Contributor

I think that translations should only be posted on the website to avoid increasing the time required to install the package.

Copy link

codecov bot commented Nov 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.60%. Comparing base (319a53c) to head (9bb0103).
Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6455   +/-   ##
=======================================
  Coverage   98.60%   98.60%           
=======================================
  Files          79       79           
  Lines       14518    14518           
=======================================
  Hits        14316    14316           
  Misses        202      202           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tdhock tdhock requested a review from jangorecki as a code owner November 8, 2024 22:20
@jangorecki
Copy link
Member

in https://github.com/Rdatatable/data.table/blob/master/.gitlab-ci.yml (where I think the site is usually built) I see

  script:
    - R --version
    - *install-deps ## markdown pkg not present in r-pkgdown image
    - mkdir -p ./pkgdown/favicon/ && cp .graphics/favicon/* ./pkgdown/favicon/ ## copy favicons
    - rm -rf ./vignettes ## r-lib/pkgdown#2383
    - Rscript -e 'pkgdown::build_site(override=list(destination="./website"))'

This is workaround for bug in pkgdown described in linked issue. Follow this workaround when generating vignettes for a website. AFAIR bug was closed as wont fix but you can check once again with pkgdown team.
Ultimately I would aim for moving vignettes to litedown. That I am pretty sure wont be supported by pkgdown as well. In future we should be able to replace pkgdown with litedown as well. @yihui

@jangorecki jangorecki removed their request for review November 9, 2024 19:50
@tdhock
Copy link
Member

tdhock commented Nov 11, 2024

I'm merging because I added FR team to DESCRIPTION, and I added links from English to French vignettes. Please file another PR for any further updates we would need to do.

@tdhock tdhock merged commit 2f49a0d into master Nov 11, 2024
6 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
translation issues/PRs related to message translation projects
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants