mirror of
https://github.com/wassname/talk.git
synced 2026-07-14 11:18:50 +08:00
[CORL-406] Tenant Locale Selection (#2450)
* feat: added preload config * feat: support changing locale * fix: name case * fix: removed unused code * feat: added translations for default reactions * fix: do not translate icon * fix: shorter i18n keys
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import React, { FunctionComponent } from "react";
|
||||
|
||||
import { LanguageCode, LOCALES_MAP } from "coral-common/helpers/i18n";
|
||||
import { PropTypesOf } from "coral-framework/types";
|
||||
import { Option, SelectField } from "coral-ui/components";
|
||||
|
||||
interface Props extends PropTypesOf<typeof SelectField> {
|
||||
value: LanguageCode;
|
||||
}
|
||||
|
||||
const LocaleField: FunctionComponent<Props> = props => {
|
||||
return (
|
||||
<SelectField {...props}>
|
||||
{Object.keys(LOCALES_MAP).map((lang: LanguageCode) => {
|
||||
return (
|
||||
<Option value={lang} key={lang}>
|
||||
{LOCALES_MAP[lang]}
|
||||
</Option>
|
||||
);
|
||||
})}
|
||||
</SelectField>
|
||||
);
|
||||
};
|
||||
|
||||
export default LocaleField;
|
||||
@@ -6,3 +6,4 @@ export { default as OIDCButton } from "./OIDCButton";
|
||||
export { default as Markdown } from "./Markdown";
|
||||
export { default as FadeInTransition } from "./FadeInTransition";
|
||||
export { default as DurationField, DURATION_UNIT } from "./DurationField";
|
||||
export { default as LocaleField } from "./LocaleField";
|
||||
|
||||
Reference in New Issue
Block a user