Fixes template string quote escapes

It seems totally reasonable that using an escape slash would make
apostrophes in words work, but the translation system works in
mysterious ways that do not include supporting that. I've used backticks
as a third quote type to escape everything in a way that both
javascript and gettext understand.

While I was there I split up some strings that have more complicated
html in them, since that can be fragile when passed through translation,
and confusing for translators.
This commit is contained in:
Mouse Reeve 2022-07-29 11:22:31 -07:00
parent 41b20c4dd5
commit 868ab62863
8 changed files with 22 additions and 22 deletions

View file

@ -7,7 +7,7 @@
tour.addSteps([
{
text: "{% trans 'This is home page of a book. Let\'s see what you can do while you\'re here!' %}",
text: `{% trans "This is home page of a book. Let's see what you can do while you're here!" %}`,
title: "{% trans 'Book page' %}",
buttons: [
{
@ -52,7 +52,7 @@
],
},
{
text: "{% trans 'You can also manually add reading dates here. Unlike changing the reading status using the previous method, adding dates manually will not automatically add them to your <strong>Read</strong> or <strong>Reading</strong> shelves.<br><br>Got a favourite you re-read every year? We\'ve got you covered - you can add multiple read dates for the same book 😀' %}",
text: `{% trans "You can also manually add reading dates here. Unlike changing the reading status using the previous method, adding dates manually will not automatically add them to your <strong>Read</strong> or <strong>Reading</strong> shelves." %}<br><br>{% trans "Got a favourite you re-read every year? We've got you covered - you can add multiple read dates for the same book 😀" %}`,
title: "{% trans 'Add read dates' %}",
attachTo: {
element: "#tour-add-readthrough",
@ -196,7 +196,7 @@
],
},
{
text: "{% trans 'If your review or comment might ruin the book for someone who hasn\'t read it yet, you can hide your post behind a <strong>spoiler alert</strong>' %}",
text: `{% trans "If your review or comment might ruin the book for someone who hasn't read it yet, you can hide your post behind a <strong>spoiler alert</strong>" %}`,
title: "{% trans 'Spoiler alerts' %}",
attachTo: {
element: "",
@ -221,7 +221,7 @@
],
},
{
text: "{% trans 'Choose who can see your post here. Post privacy can be <strong>Public</strong> (everyone can see), <strong>Unlisted</strong> (everyone can see, but it doesn\'t appear in public feeds or discovery pages), <strong>Followers</strong> (only your followers can see), or <strong>Private</strong> (only you can see)' %}",
text: `{% trans "Choose who can see your post here. Post privacy can be <strong>Public</strong> (everyone can see), <strong>Unlisted</strong> (everyone can see, but it doesn't appear in public feeds or discovery pages), <strong>Followers</strong> (only your followers can see), or <strong>Private</strong> (only you can see)" %}`,
title: "{% trans 'Post privacy' %}",
attachTo: {
element: "[id^=form_review] [id^=privacy_]",
@ -270,7 +270,7 @@
],
},
{
text: "{% trans '<p class=\'notification is-warning is-light mt-3\'> Continue the tour by selecting <strong>Your books</strong> from the drop down menu.</p>' %}",
text: '<p class="notification is-warning is-light mt-3">{% trans "Continue the tour by selecting <strong>Your books</strong> from the drop down menu." %}</p>',
title: "{% trans 'Next' %}",
attachTo: {
element: () => {

View file

@ -74,7 +74,7 @@
],
},
{
text: "{% trans 'As well as creating lists from the Lists page, you can create a group-curated list here on the group\'s homepage. Any member of the group can create a list curated by group members.' %}",
text: `{% trans "As well as creating lists from the Lists page, you can create a group-curated list here on the group's homepage. Any member of the group can create a list curated by group members." %}"`
title: "{% trans 'Group lists' %}",
attachTo: {
element: "#tour-create-list",
@ -97,7 +97,7 @@
],
},
{
text: "{% trans 'Congratulations, you\'ve finished the tour! Now you know the basics, but there is lots more to explore on your own. Happy reading!' %}",
text: `{% trans "Congratulations, you've finished the tour! Now you know the basics, but there is lots more to explore on your own. Happy reading!" %}`,
title: "{% trans 'Finish' %}",
buttons: [
{

View file

@ -6,8 +6,8 @@ const initiateTour = new Shepherd.Tour({
});
function checkResponsiveState(anchor) {
let menu = document.querySelector('#navbar-dropdown');
let display = window.getComputedStyle(menu).display;
let menu = document.querySelector('#navbar-dropdown');
let display = window.getComputedStyle(menu).display;
return display == 'flex' ? anchor : '.navbar-burger';
}
@ -76,7 +76,7 @@ homeTour.addSteps([
],
},
{
text: "{% trans 'Search book records by scanning an ISBN barcode using your device\'s camera - great when you\'re in the bookstore or library!' %}",
text: `{% trans "Search book records by scanning an ISBN barcode using your device's camera - great when you're in the bookstore or library!" %}`,
title: "{% trans 'Barcode reader' %}",
attachTo: {
element: "#tour-barcode",
@ -197,7 +197,7 @@ homeTour.addSteps([
],
},
{
text: "{% trans 'Your profile, books, direct messages, and settings can be accessed by clicking on your name in the menu here.<p class=\'notification is-warning is-light mt-3\'>Try selecting <strong>Profile</strong> from the drop down menu to continue the tour.</p>' %}",
eext: `{% trans "Your profile, books, direct messages, and settings can be accessed by clicking on your name in the menu here." %} <p class="notification is-warning is-light mt-3">{% trans "Try selecting <strong>Profile</strong> from the drop down menu to continue the tour." %}</p>' %}`,
title: "{% trans 'Profile and settings menu' %}",
attachTo: {
element: checkResponsiveState('#navbar-dropdown'),

View file

@ -10,7 +10,7 @@
tour.addSteps([
{
text: "{% trans 'This is the lists page where you can discover book lists created by any user. A List is a collection of books, similar to a shelf.<br><br>Shelves are for organising books for yourself, whereas Lists are generally for sharing with others.' %}",
text: "{% trans 'This is the lists page where you can discover book lists created by any user. A List is a collection of books, similar to a shelf.' %}<br><br>{% trans 'Shelves are for organising books for yourself, whereas Lists are generally for sharing with others.' %}",
title: "{% trans 'Lists' %}",
buttons: [
{
@ -31,7 +31,7 @@
],
},
{
text: "{% trans 'Let\'s see how to create a new list.<p class=\'notification is-warning is-light mt-3\'>Click the <strong>Create List</strong> button, then <strong>Next</strong> to continue the tour</p>' %}",
text: `{% trans "Let's see how to create a new list." %}<p class="notification is-warning is-light mt-3">{% trans "Click the <strong>Create List</strong> button, then <strong>Next</strong> to continue the tour" %}</p>`,
title: "{% trans 'Creating a new list' %}",
attachTo: {
element: "#tour-create-list",

View file

@ -40,7 +40,7 @@
} else if (localResult) {
tour.addStep(
{
text: "{% trans 'If the book you are looking for is already on this Bookwyrm instance, you can click on the title to go to the book\'s page.' %}",
text: `{% trans "If the book you are looking for is already on this Bookwyrm instance, you can click on the title to go to the book's page." %}`,
title: "{% trans 'Searching' %}",
attachTo: {
element: "#tour-local-book-search-result",
@ -118,7 +118,7 @@
],
},
{
text: "{% trans 'If you still can\'t find your book, you can add a record manually.' %}",
text: `{% trans "If you still can't find your book, you can add a record manually." %}`,
title: "{% trans 'Add a record manally' %}",
attachTo: {
element: "#tour-manually-add-book",
@ -144,7 +144,7 @@
}
tour.addStep({
text: "{% trans '<p class=\'notification is-warning is-light mt-3\'>Import, manually add, or view an existing book to continue the tour.<p>' %}",
text: '<p class="notification is-warning is-light mt-3">{% trans "Import, manually add, or view an existing book to continue the tour." %}<p>',
title: "{% trans 'Continue the tour' %}",
buttons: [
{

View file

@ -98,7 +98,7 @@
],
},
{
text: "{% trans 'Now that we\'ve explored book shelves, let\'s take a look at a related concept: book lists!<p class=\'notification is-warning is-light mt-3\'>Click on the <strong>Lists</strong> link here to continue the tour.' %}",
text: `{% trans "Now that we've explored book shelves, let's take a look at a related concept: book lists!" %}<p class="notification is-warning is-light mt-3">{% trans "Click on the <strong>Lists</strong> link here to continue the tour." %}`,
title: "{% trans 'Lists' %}",
attachTo: {
element: () => {

View file

@ -28,7 +28,7 @@
],
},
{
text: "{% trans 'Let\'s create a new group!<p class=\'notification is-warning is-light mt-3\'>Click the <strong>Create group</strong> button, then <strong>Next</strong> to continue the tour</p>' %}",
text: `{% trans "Let's create a new group!" %}<p class="notification is-warning is-light mt-3">{% trans "Click the <strong>Create group</strong> button, then <strong>Next</strong> to continue the tour" %}</p>`,
title: "{% trans 'Create group' %}",
attachTo: {
element: "#tour-create-group",
@ -99,7 +99,7 @@
],
},
{
text: "{% trans 'Once you\'re happy with how everything is set up, click the <strong>Save</strong> button to create your new group.<p class=\'notification is-warning is-light mt-3\'>Create and save a group to continue the tour.</p>' %}",
text: `{% trans "Once you're happy with how everything is set up, click the <strong>Save</strong> button to create your new group." %}<p class="notification is-warning is-light mt-3">{% trans "Create and save a group to continue the tour." %}</p>`,
title: "{% trans 'Save your group' %}",
buttons: [
{

View file

@ -28,7 +28,7 @@ tour.addSteps([
],
},
{
text: "{% trans 'This tab shows everything you have read towards your annual reading goal, or allows you to set one. You don\'t have to set a reading goal if that\'s not your thing!' %}",
text: `{% trans "This tab shows everything you have read towards your annual reading goal, or allows you to set one. You don't have to set a reading goal if that's not your thing!" %}`,
title: "{% trans 'Reading Goal' %}",
attachTo: {
element: "#tour-reading-goal",
@ -97,7 +97,7 @@ tour.addSteps([
],
},
{
text: "{% trans 'The Books tab shows your book shelves. We\'ll explore this later in the tour.' %}",
text: `{% trans "The Books tab shows your book shelves. We'll explore this later in the tour." %}`,
title: "{% trans 'Books' %}",
attachTo: {
element: "#tour-shelves-tab",
@ -120,7 +120,7 @@ tour.addSteps([
],
},
{
text: "{% trans 'Now you understand the basics of your profile page, let\s add a book to your shelves.<p class=\'notification is-warning is-light mt-3\'>Search for a title or author to continue the tour.</p>' %}",
text: `{% trans "Now you understand the basics of your profile page, let's add a book to your shelves." %}<p class="notification is-warning is-light mt-3">{% trans "Search for a title or author to continue the tour." %}</p>`,
title: "{% trans 'Find a book' %}",
attachTo: {
element: "#tour-search",