Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This refactors test-translate for preparation of refactoring the translation machinery.
expect_set_translate()
function in helper-translate.Rexpect_title_translate()
checks that the<head><title>
elements of generated pages have the expected title pattern ofLESSON NAME: TRANSLATED TITLE
expect_h1_translate()
checks that the<main><div><h1>
elements of generated pages are identical toTRANSLATED TITLE
@foggleston has correctly pointed out that updating the translations in the future is going to be a bit of a slog because the developers would need to not only modify the translations used within the
tr_()
function, but also modify the expectations intests/testthat/test-translate.R
.The solution is to pack all of the translated strings into a single file so that they could be evaluated later (see the commit comment on b7d380e for details). In order to do that, we should shore up the tests, which is what this PR does.