Skip to content

Colin/internationalization#441

Closed
ColinFay wants to merge 11 commits intorstudio:masterfrom
ThinkR-open:colin/internationalization
Closed

Colin/internationalization#441
ColinFay wants to merge 11 commits intorstudio:masterfrom
ThinkR-open:colin/internationalization

Conversation

@ColinFay
Copy link
Contributor

@ColinFay ColinFay commented Oct 7, 2020

This PR implements a mechanism for internationalizing {learnr} UI elements.

@ColinFay ColinFay marked this pull request as ready for review October 13, 2020 08:01
@ColinFay
Copy link
Contributor Author

@schloerke The internationalization is ready.

I've chosen to leave the question() fun untouched, because as I see it, teachers can still write their own text for the buttons.
And if we chose to add an auto translation here, it would override the setting from `question(), which might be weird.

What's your view on this?

@schloerke
Copy link
Collaborator

I agree. Let's only change text that learnr has control over.

You are correct in that we should wait on the question text once we have full page translations.

@ColinFay
Copy link
Contributor Author

Nice :)

Then, as far as I am concerned, this PR is ready.

Let me know if you want me to change anything

@schloerke
Copy link
Collaborator

Let's get R CMD check to pass, then we can merge.

The change above should fix it. IDK why I can't commit it.

Co-authored-by: Barret Schloerke <[email protected]>
@ColinFay
Copy link
Contributor Author

Great, everything seems good then :)

@gadenbuie
Copy link
Member

This is really great work and will make learnr tutorials more approachable for tutorial authors in general and in other languages!

I'd like to propose two additions that would make it easier to change the learnr tutorial language without having to update the learnr package directly (although that should still be encouraged for language translations!).

  1. language could accept a list in the expected format, falling back to the English defaults. This would make it trivial to adjust wording of various learnr UI elements from the YAML header of the tutorial:

    ---
    title: "Tutorial"
    output: 
      learnr::tutorial:
        progressive: true
        allow_skip: true
        language:
          button:
            runcode: "Run My Code"
            hints: "Hint, please"
            startover: "Reset"
            previoustopic: "Previous Section"
            nexttopic: "Next Section"
          text:
            startover: "Restart Tutorial"
    ---
  2. Alternatively, language could accept a path to a JSON file with the language specification in the expected format.

@gadenbuie
Copy link
Member

Superseded by #456

Thank you @ColinFay for such a great start to this feature!

@gadenbuie gadenbuie closed this Jan 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants