forked from zulip/zulip-mobile
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP ui: Use "channel" or "stream" based on server feature level
TODO: - use the right feature level - Make sure servers at that feature level accept `@channel` for wildcard mentions. Discussion: https://chat.zulip.org/#narrow/stream/378-api-design/topic/stream.2Fchannel.20rename.3A.20.40stream.20wildcard.20mention/near/1752545 - write appropriate TODO(server-x) comments - run tools/tx-sync Done at the level of TranslationProvider, which (conveniently) can access the feature level of the active account if any. The messages_en.json changes were done with a handy Perl command that Greg helped me work out: $ perl -i -ne ' print; print if (s/stream/channel/g || s/Stream/Channel/g); ' static/translations/messages_en.json Fixes: zulip#5827
- Loading branch information
1 parent
69d77de
commit 1dfc3e7
Showing
5 changed files
with
210 additions
and
8 deletions.
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,88 @@ | ||
/* @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. | ||
*/ | ||
export const streamChannelRenameFeatureLevel = 1; // TODO | ||
|
||
/** | ||
* 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. | ||
*/ | ||
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', | ||
}; |
Oops, something went wrong.