Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/boot/TranslationProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
streamChannelRenameFeatureLevel,
streamChannelRenamesMap,
} from './streamChannelRenamesMap';
import { getHaveServerData } from '../haveServerDataSelectors';

// $FlowFixMe[incompatible-type] could put a well-typed mock value here, to help write tests
export const TranslationContext: React.Context<GetText> = React.createContext(undefined);
Expand Down Expand Up @@ -103,6 +104,7 @@ export default function TranslationProvider(props: Props): React.Node {
// TODO(server-9.0) remove "stream" terminology
const effectiveMessagesByLanguage =
activeAccountState == null
|| !getHaveServerData(activeAccountState)
|| getZulipFeatureLevel(activeAccountState) >= streamChannelRenameFeatureLevel
? messagesByLanguageRenamed
: messagesByLanguage;
Expand Down
5 changes: 3 additions & 2 deletions src/boot/streamChannelRenamesMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
* 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.
* account, if there is one and it has server data. If there isn't an active
* account or it doesn't have server data, just choose "channel" terminology
* unconditionally.
*/
// TODO(server-9.0) simplify away
// https://chat.zulip.org/api/changelog#changes-in-zulip-90
Expand Down