Commit d12d963d1dc2340bf7726e17d111c407fda58c7d
strings, prep for translations, attn: @mixmix
Dominic Tarr committed on 8/11/2017, 8:53:22 AMParent: 06176b2a556059bf16c62b812c8f7945dbb692cf
Files changed
app/page/home.js | changed |
index.js | changed |
translations/sync.js | added |
app/page/home.js | ||
---|---|---|
@@ -18,18 +18,12 @@ | ||
18 | 18 | 'sbot.pull.log': 'first', |
19 | 19 | 'history.sync.push': 'first', |
20 | 20 | 'keys.sync.id': 'first', |
21 | 21 | 'message.sync.unbox': 'first', |
22 | - 'message.html.markdown': 'first' | |
22 | + 'message.html.markdown': 'first', | |
23 | + 'translations.sync.strings': 'first' | |
23 | 24 | }) |
24 | 25 | |
25 | -var strings = { | |
26 | - showMore: "Show More", | |
27 | - channels: "Channels", | |
28 | - directMessages: "Direct Messages", | |
29 | - replySymbol: "> " | |
30 | -} | |
31 | - | |
32 | 26 | function firstLine (text) { |
33 | 27 | if(text.length < 80 && !~text.indexOf('\n')) return text |
34 | 28 | |
35 | 29 | var line = '' |
@@ -59,8 +53,9 @@ | ||
59 | 53 | } |
60 | 54 | |
61 | 55 | exports.create = (api) => { |
62 | 56 | return nest('app.page.home', function (location) { |
57 | + var strings = api.translations.sync.strings() | |
63 | 58 | // location here can expected to be: { page: 'home' } |
64 | 59 | |
65 | 60 | var container = h('div.container', []) |
66 | 61 |
index.js | ||
---|---|---|
@@ -1,8 +1,9 @@ | ||
1 | 1 | const ticktack = { |
2 | 2 | app: require('./app'), |
3 | 3 | blob: require('./blob'), |
4 | 4 | router: require('./router'), |
5 | - styles: require('./styles') | |
5 | + styles: require('./styles'), | |
6 | + translations: require('./translations/sync') | |
6 | 7 | } |
7 | 8 | |
8 | 9 | module.exports = ticktack |
translations/sync.js | ||
---|---|---|
@@ -1,0 +1,13 @@ | ||
1 | + | |
2 | +exports.gives = {translations: {sync: {strings: true}}} | |
3 | + | |
4 | +exports.create = function () { | |
5 | + return {translations: {sync: {strings: function () { | |
6 | + return { | |
7 | + showMore: "Show More", | |
8 | + channels: "Channels", | |
9 | + directMessages: "Direct Messages", | |
10 | + replySymbol: "> " | |
11 | + } | |
12 | + }}}} | |
13 | +} |
Built with git-ssb-web