Commit 337ff74d31eddc3a716cc478e7e24a48610eb10f
add missing translation for comments
mix irving committed on 12/8/2017, 6:40:37 AMParent: cbd6bae4225830b0dd2604e026bd6eda962d043e
Files changed
app/html/comments.js | changed |
app/page/blogShow.js | changed |
translations/en.js | changed |
translations/zh.js | changed |
app/html/comments.js | ||
---|---|---|
@@ -14,18 +14,19 @@ | ||
14 | 14 | 'message.html.timeago': 'first', |
15 | 15 | 'message.html.likes': 'first', |
16 | 16 | 'unread.sync.markRead': 'first', |
17 | 17 | 'unread.sync.isUnread': 'first', |
18 | + 'translations.sync.strings': 'first', | |
18 | 19 | }) |
19 | 20 | |
20 | 21 | exports.create = (api) => { |
21 | 22 | return nest('app.html.comments', comments) |
22 | 23 | |
23 | 24 | function comments (root) { |
24 | 25 | const { messages, channel, lastId: branch } = api.feed.obs.thread(root) |
26 | + const strings = api.translations.sync.strings() | |
25 | 27 | |
26 | 28 | // TODO - move this up into Patchcore |
27 | - var debouncer = null | |
28 | 29 | const messagesTree = computed(throttle(messages, 200), msgs => { |
29 | 30 | return msgs |
30 | 31 | .filter(msg => forkOf(msg) === undefined) |
31 | 32 | .map(threadMsg => { |
@@ -49,13 +50,14 @@ | ||
49 | 50 | |
50 | 51 | return h('Comments', [ |
51 | 52 | // when(twoComposers, compose({ meta, shrink: true, canAttach: false })), |
52 | 53 | map(messagesTree, msg => Comment(msg, root, branch)), |
53 | - compose({ meta, shrink: false, canAttach: false }), | |
54 | + compose({ meta, shrink: false, canAttach: false, placeholder: strings.writeComment }), | |
54 | 55 | ]) |
55 | 56 | } |
56 | 57 | |
57 | 58 | function Comment (msgObs, root, branch) { |
59 | + const strings = api.translations.sync.strings() | |
58 | 60 | const msg = resolve(msgObs) |
59 | 61 | |
60 | 62 | const raw = get(msg, 'value.content.text') |
61 | 63 | var className = api.unread.sync.isUnread(msg) ? ' -unread' : ' -read' |
@@ -86,9 +88,10 @@ | ||
86 | 88 | channel: content.channel |
87 | 89 | }, |
88 | 90 | shrink: false, |
89 | 91 | canAttach: false, |
90 | - canPreview: false | |
92 | + canPreview: false, | |
93 | + placeholder: strings.writeComment | |
91 | 94 | }, toggleCompose) |
92 | 95 | |
93 | 96 | return h('Comment', { className }, [ |
94 | 97 | h('div.left', api.about.html.avatar(author, 'tiny')), |
app/page/blogShow.js | ||
---|---|---|
@@ -17,12 +17,10 @@ | ||
17 | 17 | 'message.html.likes': 'first', |
18 | 18 | 'message.html.markdown': 'first', |
19 | 19 | 'message.html.timeago': 'first', |
20 | 20 | 'feed.obs.thread': 'first', |
21 | - | |
22 | 21 | 'blog.html.title': 'first', |
23 | 22 | 'blog.html.content': 'first', |
24 | - | |
25 | 23 | }) |
26 | 24 | |
27 | 25 | exports.create = (api) => { |
28 | 26 | return nest('app.page.blogShow', blogShow) |
translations/en.js | ||
---|---|---|
@@ -20,8 +20,9 @@ | ||
20 | 20 | channel: 'Channel', |
21 | 21 | loading: 'Loading...', |
22 | 22 | optionalField: 'optional', |
23 | 23 | writeMessage: 'Write a message', |
24 | + writeComment: 'Write a comment', | |
24 | 25 | peopleNearby: 'People nearby', |
25 | 26 | sendMessage: 'Send', |
26 | 27 | showMore: 'Show More', |
27 | 28 | directMessages: 'Direct Messages', |
Built with git-ssb-web