Commit b4bb2278fc6720ae4aa5470a30a66da315b74f00
add warning translations
mix irving committed on 2/13/2018, 7:00:19 AMParent: 30807fa44b8b7b127a6118a555fc4f259245efe3
Files changed
app/html/warning.js | changed |
app/obs/pluginWarnings.js | changed |
translations/en.js | changed |
app/html/warning.js | ||
---|---|---|
@@ -4,28 +4,31 @@ | ||
4 | 4 … | exports.gives = nest('app.html.warning') |
5 | 5 … | |
6 | 6 … | exports.needs = nest({ |
7 | 7 … | 'app.html.lightbox': 'first', |
8 | - 'app.obs.pluginWarnings': 'first' | |
8 … | + 'app.obs.pluginWarnings': 'first', | |
9 … | + 'translations.sync.strings': 'first' | |
9 | 10 … | }) |
10 | 11 … | |
11 | 12 … | exports.create = (api) => { |
12 | 13 … | var seenWarning = false |
13 | 14 … | |
14 | 15 … | return nest('app.html.warning', function warning () { |
15 | 16 … | if (seenWarning) return |
16 | 17 … | |
18 … | + const t = api.translations.sync.strings().pluginWarnings | |
19 … | + | |
17 | 20 … | const lightbox = api.app.html.lightbox( |
18 | 21 … | h('div', [ |
19 | - h('h1', 'Ticktack running in limited mode'), | |
20 | - h('p', 'Another scuttlebutt app is managing your shared database. Core functionality will work, but you may find there are some features that do not work.'), | |
21 | - h('p', 'If you are running Patchwork, close Patchwork before running Ticktack to get the full set of features'), | |
22 … | + h('h1', t.heading), | |
23 … | + h('p', t.description), | |
24 … | + h('p', t.advice), | |
22 | 25 … | h('Button', { |
23 | 26 … | 'ev-click': () => { |
24 | 27 … | lightbox.close() |
25 | 28 … | seenWarning = true |
26 | 29 … | }}, |
27 | - 'okay' | |
30 … | + t.action.ok | |
28 | 31 … | ) |
29 | 32 … | ]) |
30 | 33 … | ) |
31 | 34 … |
app/obs/pluginWarnings.js | ||
---|---|---|
@@ -19,9 +19,8 @@ | ||
19 | 19 … | function checkForTrouble () { |
20 | 20 … | onceTrue( |
21 | 21 … | api.sbot.obs.connection, |
22 | 22 … | sbot => { |
23 | - console.log('nope', sbot.channel) | |
24 | 23 … | if (!sbot.channel) warnings.set(true) // TODO could build a list of missing plugins + effects |
25 | 24 … | else warnings.set(false) |
26 | 25 … | } |
27 | 26 … | ) |
translations/en.js | |||
---|---|---|---|
@@ -4,8 +4,16 @@ | |||
4 | 4 … | slogan: `Connecting the Unconnected | |
5 | 5 … | Reconstructing a trusty social network | |
6 | 6 … | ` | |
7 | 7 … | }, | |
8 … | + pluginWarnings: { | ||
9 … | + heading: 'Ticktack running in limited mode', | ||
10 … | + description: 'Another scuttlebutt app is managing your shared database. Core functionality will work, but you may find there are some features that do not work.', | ||
11 … | + advice: 'If you are running Patchwork, close Patchwork before running Ticktack to get the full set of features', | ||
12 … | + action: { | ||
13 … | + ok: 'Okay' | ||
14 … | + } | ||
15 … | + }, | ||
8 | 16 … | blogIndex: { | |
9 | 17 … | title: 'Discover', | |
10 | 18 … | }, | |
11 | 19 … | topNav: { | |
@@ -148,6 +156,5 @@ | |||
148 | 156 … | languages: { | |
149 | 157 … | en: 'English', | |
150 | 158 … | zh: '中文' | |
151 | 159 … | } | |
152 | - | ||
153 | 160 … | } |
Built with git-ssb-web