-
-
Notifications
You must be signed in to change notification settings - Fork 654
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ui: Use "channel" or "stream" based on server feature level #5830
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
/* @flow strict-local */ | ||
|
||
/** | ||
* The feature level at which we want to say "channel" instead of "stream". | ||
* | ||
* Outside a per-account context, check the feature level of the active | ||
* account, if there is one. If there isn't an active account, just choose | ||
* "channel" terminology unconditionally. | ||
*/ | ||
// TODO(server-9.0) simplify away | ||
// https://chat.zulip.org/api/changelog#changes-in-zulip-90 | ||
export const streamChannelRenameFeatureLevel = 255; | ||
|
||
/** | ||
* A messageId: messageId map, from "stream" terminology to "channel". | ||
* | ||
* When appropriate (see streamChannelRenameFeatureLevel), use this to patch | ||
* UI-string data for all languages, so that the UI says "channel" instead | ||
* of "stream". See https://github.com/zulip/zulip-mobile/issues/5827 . | ||
* | ||
* For example, use this to make a copy of messages_en that has | ||
* | ||
* "Notify stream": "Notify channel", | ||
* | ||
* instead of | ||
* | ||
* "Notify stream": "Notify stream", | ||
* "Notify channel": "Notify channel", | ||
* | ||
* and likewise for all the other languages. | ||
*/ | ||
// TODO(server-9.0) simplify away | ||
export const streamChannelRenamesMap: {| [string]: string |} = { | ||
stream: 'channel', | ||
'Notify stream': 'Notify channel', | ||
'Who can access the stream?': 'Who can access the channel?', | ||
'Only organization administrators and owners can edit streams.': | ||
'Only organization administrators and owners can edit channels.', | ||
'{realmName} only allows organization administrators or owners to make public streams.': | ||
'{realmName} only allows organization administrators or owners to make public channels.', | ||
'{realmName} only allows organization moderators, administrators, or owners to make public streams.': | ||
'{realmName} only allows organization moderators, administrators, or owners to make public channels.', | ||
'{realmName} only allows full organization members, moderators, administrators, or owners to make public streams.': | ||
'{realmName} only allows full organization members, moderators, administrators, or owners to make public channels.', | ||
'{realmName} only allows organization members, moderators, administrators, or owners to make public streams.': | ||
'{realmName} only allows organization members, moderators, administrators, or owners to make public channels.', | ||
'{realmName} only allows organization administrators or owners to make private streams.': | ||
'{realmName} only allows organization administrators or owners to make private channels.', | ||
'{realmName} only allows organization moderators, administrators, or owners to make private streams.': | ||
'{realmName} only allows organization moderators, administrators, or owners to make private channels.', | ||
'{realmName} only allows full organization members, moderators, administrators, or owners to make private streams.': | ||
'{realmName} only allows full organization members, moderators, administrators, or owners to make private channels.', | ||
'{realmName} only allows organization members, moderators, administrators, or owners to make private streams.': | ||
'{realmName} only allows organization members, moderators, administrators, or owners to make private channels.', | ||
'{realmName} does not allow anybody to make web-public streams.': | ||
'{realmName} does not allow anybody to make web-public channels.', | ||
'{realmName} only allows organization owners to make web-public streams.': | ||
'{realmName} only allows organization owners to make web-public channels.', | ||
'{realmName} only allows organization administrators or owners to make web-public streams.': | ||
'{realmName} only allows organization administrators or owners to make web-public channels.', | ||
'{realmName} only allows organization moderators, administrators, or owners to make web-public streams.': | ||
'{realmName} only allows organization moderators, administrators, or owners to make web-public channels.', | ||
'Cannot subscribe to stream': 'Cannot subscribe to channel', | ||
'Stream #{name} is private.': 'Channel #{name} is private.', | ||
'Please specify a stream.': 'Please specify a channel.', | ||
'Please specify a valid stream.': 'Please specify a valid channel.', | ||
'No messages in stream': 'No messages in channel', | ||
'All streams': 'All channels', | ||
// 'No messages in topic: {streamAndTopic}': 'No messages in topic: {channelAndTopic}', | ||
'Mute stream': 'Mute channel', | ||
'Unmute stream': 'Unmute channel', | ||
'{username} will not be notified unless you subscribe them to this stream.': | ||
'{username} will not be notified unless you subscribe them to this channel.', | ||
'Stream notifications': 'Channel notifications', | ||
'No streams found': 'No channels found', | ||
'Mark stream as read': 'Mark channel as read', | ||
'Failed to mute stream': 'Failed to mute channel', | ||
'Failed to unmute stream': 'Failed to unmute channel', | ||
'Stream settings': 'Channel settings', | ||
'Failed to show stream settings': 'Failed to show channel settings', | ||
'You are not subscribed to this stream': 'You are not subscribed to this channel', | ||
'Create new stream': 'Create new channel', | ||
Stream: 'Channel', | ||
'Edit stream': 'Edit channel', | ||
'Only organization admins are allowed to post to this stream.': | ||
'Only organization admins are allowed to post to this channel.', | ||
'Copy link to stream': 'Copy link to channel', | ||
'Failed to copy stream link': 'Failed to copy channel link', | ||
'A stream with this name already exists.': 'A channel with this name already exists.', | ||
Streams: 'Channels', | ||
}; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW here's the command I used just now to help check this — a variation on the Perl one-liner that edited the messages JSON file:
<static/translations/messages_en.json perl -lne 'next unless (my ($k) = /^ *(".*"): \1/); $_ = $k; next unless (s/stream/channel/g || s/Stream/Channel/g); print "$k: $_,"'
I took that command's output, copy-pasted it between the braces of this object literal, deleted what had been here, and reformatted. The result was identical to what you have… except it added a line
which indeed shouldn't be there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It also occurs to me that that
{streamAndTopic}
string might be worth including but commented out, as a bit of a reminder of why this map isn't just areplaceAll
or the like.