The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
Rocket.Chat/client/contexts/TranslationContext.js

20 lines
603 B

import { createContext, useContext } from 'react';
const translate = (key) => key;
translate.has = () => true;
export const TranslationContext = createContext({
languages: [{
name: 'Default',
en: 'Default',
key: '',
}],
language: '',
loadLanguage: async () => {},
translate,
});
export const useLanguages = () => useContext(TranslationContext).languages;
export const useLanguage = () => useContext(TranslationContext).language;
export const useLoadLanguage = () => useContext(TranslationContext).loadLanguage;
export const useTranslation = () => useContext(TranslationContext).translate;