Commit Graph

88 Commits

Author SHA1 Message Date
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
renovate[bot]
17892c6a99 Update dependency i18next to v23.16.2 2024-10-21 00:58:33 +00:00
renovate[bot]
a2afc0af75 Update dependency i18next to v23.16.0 2024-10-14 00:24:58 +00:00
renovate[bot]
e65283f049 Update dependency i18next to v23.15.2 2024-10-07 00:52:05 +00:00
Cathy Sarisky
2a2d7bb9ad
Added i18n support to search - ready for translator work! (#21055)
ref https://github.com/TryGhost/Ghost/issues/16628

This adds translation support to search, which should be the last missing piece of i18n support for Ghost's frontend  🎉
- Translation (t) helper added to sodo-search.
- Ghost head tweaked to include data-locale.
- All (I hope) strings in sodo-search wrapped in the t helper.
- Possibly poor-quality French translation strings added.

---------

Co-authored-by: Vikas Potluri <vikaspotluri123.github@gmail.com>
2024-09-24 12:39:32 +01:00
renovate[bot]
9860371df7 Update dependency i18next to v23.15.1 2024-09-10 10:04:37 +00:00
renovate[bot]
3677f83d1c Update dependency i18next to v23.15.0 2024-09-09 18:15:47 +00:00
renovate[bot]
6a7b8bd3ca Update dependency i18next to v23.14.0 2024-08-19 10:08:00 +00:00
renovate[bot]
d50187b35f Update dependency i18next to v23.13.0 2024-08-16 08:22:12 +00:00
renovate[bot]
c02c98529e Update dependency i18next to v23.12.7 2024-08-15 20:30:55 +00:00
renovate[bot]
d72040588a Update dependency i18next to v23.12.4 2024-08-15 15:59:07 +00:00
renovate[bot]
c96b1a1140 Update dependency i18next to v23.12.3 2024-08-13 00:40:17 +00:00
renovate[bot]
fd335d3f4c Update dependency i18next to v23.12.2 2024-07-30 07:48:15 +00:00
renovate[bot]
16ce66f74e Update dependency i18next to v23.12.1 2024-07-15 00:13:10 +00:00
renovate[bot]
f01e06153f Update dependency i18next to v23.11.5 2024-05-20 21:41:46 +00:00
renovate[bot]
a4dc6c5cf6 Update dependency i18next-parser to v8.13.0 2024-05-20 10:40:32 +01:00
renovate[bot]
4edb6b6731 Update dependency i18next to v23.11.4 2024-05-10 10:07:11 +00:00
renovate[bot]
9056b9138c Update dependency i18next to v23.11.3 2024-04-29 08:40:51 +00:00
renovate[bot]
f6f9f8cd79 Update dependency i18next to v23.11.2 2024-04-15 01:16:18 +00:00
renovate[bot]
5eab1e1ed6 Update dependency i18next to v23.11.1 2024-04-09 18:49:21 +00:00
renovate[bot]
f4cb488d04 Update dependency i18next to v23.11.0 2024-04-08 17:03:58 +00:00
renovate[bot]
e17bbb6215 Update dependency i18next to v23.10.1 2024-03-08 07:07:33 +00:00
renovate[bot]
211016210e Update dependency i18next to v23.10.0 2024-02-22 14:10:30 +00:00
renovate[bot]
6b19637566 Update dependency i18next to v23.9.0 2024-02-19 00:18:33 +00:00
renovate[bot]
123ccdb6f9 Update dependency i18next to v23.8.2 2024-01-31 14:46:21 +00:00
renovate[bot]
707b2f3ca1 Update dependency i18next to v23.8.1 2024-01-29 06:45:42 +00:00
renovate[bot]
f868984e92 Update dependency i18next to v23.8.0 2024-01-29 01:10:51 +00:00
renovate[bot]
af4b98cdaf Update dependency i18next to v23.7.20 2024-01-26 14:00:21 +00:00
renovate[bot]
428be0f9ef Update dependency i18next to v23.7.19 2024-01-25 01:54:29 +00:00
renovate[bot]
75dbedf8ad Update dependency i18next to v23.7.18 2024-01-22 00:21:58 +00:00
renovate[bot]
a93e288253 Update dependency i18next to v23.7.16 2024-01-04 13:47:04 +00:00
renovate[bot]
d89dace67f Update dependency i18next to v23.7.15 2024-01-03 13:29:42 +00:00
renovate[bot]
ebcf0ad508 Update dependency i18next to v23.7.14 2024-01-02 22:48:14 +00:00
renovate[bot]
04e4e807c2 Update dependency i18next to v23.7.13 2024-01-02 12:14:25 +00:00
renovate[bot]
d1b41f8f0b Update dependency i18next to v23.7.9 2023-12-12 19:42:27 +00:00
renovate[bot]
a87804be57 Update dependency i18next to v23.7.8 2023-12-06 20:43:02 +00:00
renovate[bot]
a5c4f30a9f Update dependency i18next to v23.7.7 2023-11-28 14:42:59 +00:00
renovate[bot]
2b591d9b6f Update dependency i18next to v23.7.6 2023-11-13 15:22:35 +00:00
renovate[bot]
fa05fc06c6 Update dependency i18next to v23.7.5 2023-11-13 11:36:19 +00:00
renovate[bot]
92b5e41acd Update dependency i18next to v23.7.4 2023-11-13 11:15:10 +00:00
renovate[bot]
7278f6d17e Update dependency i18next to v23.7.3 2023-11-13 02:24:33 +00:00
renovate[bot]
5d4e37fea3 Update dependency i18next to v23.7.1 2023-11-10 14:29:56 +00:00
Daniel Lockyer
389ced9c4f Reverted i18next-parser to v8.8.0
refs https://github.com/i18next/i18next-parser/issues/939

- a bug in the parser means that files outside of the package are not
  being parsed
2023-10-25 12:06:00 +02:00
Daniel Lockyer
c5c6f84c7d Added CI check to ensure i18n translations are in sync
fixes https://github.com/TryGhost/DevOps/issues/91

- this adds a CI job that will run i18n tests if any of the packages
  that use it have changed
- this helps prevent translations from going out of sync
2023-10-25 12:06:00 +02:00
renovate[bot]
2d4959d972 Update dependency i18next to v23.6.0 2023-10-18 16:45:25 +00:00
renovate[bot]
a26accd123 Update dependency i18next-parser to v8.9.0 2023-10-16 08:02:41 +02:00
Daniel Lockyer
85098e07d4 Configured all unit tests to use dot reporter
refs https://ghost.slack.com/archives/C02G9E68C/p1696490748701419

- this configures mocha to use the dot reporter because the default is
  way too verbose in CI
2023-10-05 12:24:24 +02:00
renovate[bot]
be022b9e58 Update dependency i18next-parser to v8.8.0 2023-10-02 08:51:28 +02:00
renovate[bot]
68dcb0f012 Update dependency i18next to v23.5.1 2023-09-08 10:47:33 +00:00
Daniel Lockyer
c6cb35074a Updated linting and testing packages 2023-09-01 15:51:17 +02:00