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

[pull] main from carpentries:main #10

Merged
merged 109 commits into from
Dec 12, 2023
Merged

Conversation

pull[bot]
Copy link

@pull pull bot commented Dec 8, 2023

See Commits and Changes for more details.


Created by pull[bot]

Can you help keep this open source service alive? 💖 Please sponsor : )

joelnitta and others added 30 commits November 22, 2023 15:09
apparently last commit did not run document(), this adds Milan Malfait
who was added in DESCRIPTION as ctb
based on {pkgdown} scheme and using {potools}
Co-authored-by: Zhian N. Kamvar <[email protected]>
Co-authored-by: Zhian N. Kamvar <[email protected]>
The reason why the initial apporach I proposed was not working is
because this bumps into a few concepts that have not been clearly
documented on this end.

First, there is the concept of the `pkg` object. This object is a
representation of the _pkgdown.yaml file from the `site/` folder. When
any page is built, this is passed to `pkgdown::data_template()`, which
creates the data needed for the whisker templates (e.g. everything in
the `$params` section of the `_pkgdown.yaml` file is shunted into `$yaml`)
and boilerplate items like dropdown menu items (for pkgdown) are added.

In my original conception, I would be able to add `$translate` to the
`pkg` object and it would be propogated to the website. This was not
true and this is where the disconnect initially lies. The problem was that the
code for `pkgdown::data_template()` was _replacing_ the `$translate`
field with the default translations from {pkgdown}.

In this package, the way we pass variables to {varnish} via the
`_pkgdown.yaml` file, the generated content for `learner_globals()` and
`instructor_globals()`, and the `this_metadata()` object, which contains
both supplied and generated metadata content.

All of these are passed to `build_html()`, which uses
`pkgdown::render_page_html()`, passing the generated global data to the
`data` parameter and _this_ is where the translations are incorporated.
This will run before pkgdown is run so that we don't have to worry about
syntax or messing up HTML. It's not the perfect solution, but it will
work.
zkamvar and others added 24 commits December 6, 2023 07:21
This replaces it with a more efficient method by translating once and
then applying those translations over the nodes. This is still not
efficient as can be. The translations _could_ live in yet another global
environment that can be initialized when the config file is read in, but
we will optimize that later
This function does not need to rely on the pkgdown structure. We have
the language recorded in the metadata, so that should be sufficient.
I retrieved some of them from carpentries/styles-es, but I could not
translate all of them.
WIP: Add Support for Translations
Update DESCRIPTION to use main branch of varnish
I did the remaining translations to Spanish.  Thanks so much, @zkamvar and @joelnitta, for building this.

Thanks a lot, @acrall, for working so hard in advance in the localization of The Carpentries materials.
@pull pull bot added the ⤵️ pull label Dec 8, 2023
@milanmlft milanmlft merged commit 47d803a into milanmlft:main Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants