0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-04-08 02:52:39 -05:00
ghost/ghost
Cathy Sarisky 1d429b8b09
🌐Added i18n for newsletter strings (#21433)
no issue

This PR adds the ability to translate the strings that appear in the
newsletter as boilerplate text, using i18next.

Variables are in single mustaches ( `{date}` ) in the translation
strings (rather than `{{date}}`), because these strings occur both the
email template.hbs and also .js files. That necessitated a separate
namespace.

This PR also includes changes to the newsletter button ("more like
this", "less like this", "comment") that were previously delivered on
desktop as images that included the text. @sanne-san provided a rework
that removed text-as-image from the desktop buttons, and allows more
shared code between the two layouts, along with making the buttons
translatable.

Example usage - handlebars
```
<h3 class="latest-posts-header">{{t 'Keep reading'}}</h3>

{{{t 'By {authors}' authors=post.authors }}} 
```
(NOTE: triple { required because of possible & )

Example usage - javascript
```
                getValue: (member) => {
                    if (member.status === 'comped') {
                        return t('complimentary');
                    }
                    if (this.isMemberTrialing(member)) {
                        return t('trialing');
                    }
                    // other possible statuses: t('free'), t('paid') //
                    return t(member.status);
                }
```

---------

Co-authored-by: Sanne de Vries <sannedv@protonmail.com>
Co-authored-by: Steve Larson <9larsons@gmail.com>
2024-10-31 08:41:39 -05:00
..
adapter-cache-memory-ttl
adapter-cache-redis
adapter-manager
admin Update Koenig packages (#21480) 2024-10-31 10:11:27 +00:00
announcement-bar-settings
api-framework
api-version-compatibility-service
audience-feedback
bookshelf-repository
bootstrap-socket
collections
constants
core 🌐Added i18n for newsletter strings (#21433) 2024-10-31 08:41:39 -05:00
custom-fonts Removed Prata font (#21478) 2024-10-31 05:43:39 +00:00
custom-theme-settings-service
data-generator
domain-events
donations
dynamic-routing-events
email-addresses Update dependency nodemailer to v6.9.16 2024-10-28 11:17:18 +00:00
email-analytics-provider-mailgun
email-analytics-service
email-content-generator
email-events
email-service 🌐Added i18n for newsletter strings (#21433) 2024-10-31 08:41:39 -05:00
email-suppression-list
express-dynamic-redirects
external-media-inliner
extract-api-key
ghost
html-to-plaintext
i18n 🌐Added i18n for newsletter strings (#21433) 2024-10-31 08:41:39 -05:00
importer-handler-content-files
importer-revue
in-memory-repository
job-manager
link-redirects
link-replacer
link-tracking
magic-link
mail-events
mailgun-client
member-attribution
member-events
members-api 🐛 Fixed malformed unsubscribe_url in members api response (#21437) 2024-10-28 15:36:05 -05:00
members-csv
members-events-service
members-importer
members-ssr
mentions-email-report
metrics-server
milestones
minifier
model-to-domain-event-interceptor
mw-api-version-mismatch
mw-cache-control
mw-error-handler
mw-session-from-token
mw-update-user-last-seen
mw-version-match
mw-vhost
nql-filter-expansions
oembed-service Not storing icons and thumbnails in case of mention (#21424) 2024-10-28 05:29:49 +00:00
offers
package-json
payments
post-events
post-revisions
posts-service
recommendations
referrers
security
session-service Updated code for fetching location (#21368) 2024-10-23 06:43:42 +01:00
settings-path-manager
slack-notifications
staff-service
stats-service
stripe
tiers
tinybird
update-check-service
verification-trigger
version-notifications-data-service
webmentions
tsconfig.json