-
Notifications
You must be signed in to change notification settings - Fork 993
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
File names for translated vignettes? #6221
Comments
advantage would be to have the locale directly in the file name. |
@eliocamp is this something in scope for the documentation working group? Are there any preliminary recommendations you can suggest here? |
Yes, it is very much in scope. No, I have no recommendations yet 🥲. |
Perhaps testing also various options with {pkgdown} to see which one presents better. In the existing directory, I am afraid it would end up in a long list of vignettes. |
On Linux, it's usually something like If there was some way do make |
May be some solution around Python package pip install mdpo allowing md2po and then reverse po2md to find back the translated vignette. Must still investigate how much information we lose. Commands:
Issue: mondeja/md-ulb-pwrap#7 my tests going on -> https://github.com/ChristianWia/vignettes |
In our work to get multilingual documentation, we are thinking that the translated documentation would live in its own translation module. So the French helpfiles for data.table would be in a package called data.table.fr (or whatever, the name is not important) and any user who would like to see the documentation in that language would install it. The idea is that this would decouple translations from the original package and users won't need to get translations in a language they don't need. I think that model might also work for vignettes. |
OK, I see. Then, in the meantime, we could place vignettes translation in French in an 'fr' subdirectory. Once that new mechanism will be available, we could easily create the corresponding repository and transfer these files.
|
|
As long as it actually works, I agree for now putting it in subdirectories is the way to go. Please pass along any learnings in this process to the R documentation working group team -- @eliocamp would https://github.com/RConsortium/multilingual-documentation-wg or https://github.com/eliocamp/rhelpi18n be the better place (I assume the former). |
Yes, I think these high-level discussions are better had in https://github.com/RConsortium/multilingual-documentation-wg |
Impact of LOCALE on vignette translation If we agree the translated vignette is a clone of the EN one (same YAML, same skeleton), several elements should be considered during translation. 1 vignettes not using common resources : 2 vignette using common resources : 2.1 access to CSS : 2.2 access to images and other medias : 2.2.1 médias not relying on Locale : 2.2.2 medias depending on the Locale : 2.2.2.1 .Rmd does not describe the image 2.2.2.2 .Rmd describes the image 2.2.2.2.1 either we keep the EN image : 2.2.2.2.2 or we create a Locale image (*) : (*) I think it is possible to modify the contents of an .svg to translate the displayed text (to investigate) |
Part of the appeal of vignettes is that they are already part of the package and accessible offline. Some very approximate testing shows that enabling the French vignettes (#6455) to render adds more than 30% to the Caching the R results in the English vignettes for reuse in the translations would be hard to implement and is unlikely to help much: time is also spent inside If the translated vignettes are included in the raw script# this was without OPENBLAS_NUM_THREADS=1, so the CPU load is above normal
# most of the process doesn't use linear algebra anyway
elapsed <- \(s) {
s <- regmatches(s, gregexec('(\\d+):([\\d.]+)elapsed', s, perl = TRUE))[[1]][2:3,]
as.numeric(s[1,])*60 + as.numeric(s[2,])
}
d <- rbind(
cbind(kind = 'vignettes/fr/*', rbind(
data.frame(process = 'build', time = elapsed('
52.84user 14.42system 0:38.99elapsed 172%CPU (0avgtext+0avgdata 1270424maxresident)k
53.32user 14.27system 0:38.61elapsed 175%CPU (0avgtext+0avgdata 1270228maxresident)k
53.36user 14.05system 0:38.53elapsed 174%CPU (0avgtext+0avgdata 1270548maxresident)k
')),
data.frame(process = 'check', time = elapsed('
138.89user 44.84system 2:06.32elapsed 145%CPU (0avgtext+0avgdata 1270412maxresident)k
137.14user 44.95system 2:04.29elapsed 146%CPU (0avgtext+0avgdata 1270192maxresident)k
143.14user 48.11system 2:10.45elapsed 146%CPU (0avgtext+0avgdata 1270584maxresident)k
'))
)),
cbind(kind = 'vignettes/*-fr*', rbind(
data.frame(process = 'build', time = elapsed('
82.31user 23.16system 0:51.61elapsed 204%CPU (0avgtext+0avgdata 1313952maxresident)k
82.02user 23.47system 0:51.31elapsed 205%CPU (0avgtext+0avgdata 1314172maxresident)k
81.63user 23.42system 0:51.24elapsed 205%CPU (0avgtext+0avgdata 1313888maxresident)k
')),
data.frame(process = 'check', time = elapsed('
171.63user 59.06system 2:21.92elapsed 162%CPU (0avgtext+0avgdata 1313928maxresident)k
173.07user 63.13system 2:23.48elapsed 164%CPU (0avgtext+0avgdata 1313184maxresident)k
175.47user 58.57system 2:26.24elapsed 160%CPU (0avgtext+0avgdata 1313056maxresident)k
'))
))
)
lattice::barchart(time ~ kind | process, aggregate(time ~ kind + process, d, mean), ylim = c(0, max(d$time))) |
It would be great to minimally impact the package check/compilation/installation with translations. If we got a convention that the -lang- translation of vignettes is in Rdatatable/data.table.-lang- GitHub repos, and that these repos mainly serve to compile a localized {pkgdown} site, it is relatively easy to compute links to corresponding pages in the original vignettes. Also, a link back to the original English vignettes can be added in the translations. The installation of the {data.table.} package is not necessary. Only if users want offline versions of the vignettes. It seems to me to be a relatively simple solution to this problem for now. |
Hi! @Rdatatable/french are planning to translate vignettes to French.
what should the file names for the translated vignettes be?
in the existing directory:
datatable-intro.Rmd
datatable-intro-fr.Rmd
datatable-intro-de.Rmd
datatable-intro-pl.Rmd
....
or:
vignettes/fr
datatable-intro.Rmd
...
vignettes/de
datatable-intro.Rmd
...
vignettes/pl
datatable-intro.Rmd
...
or:
vignettes/po/fr
datatable-intro.Rmd
...
vignettes/po/de
datatable-intro.Rmd
...
vignettes/po/pl
datatable-intro.Rmd
...
or: other ???
My tendency would be to do it in the existing directory. I'm not sure if sub-directories are possible?
The text was updated successfully, but these errors were encountered: