✏️ Fix module wrapper translation typo

This commit is contained in:
ajnart
2022-09-02 23:45:47 +02:00
parent ca530feb7c
commit 601ca9d894

View File

@@ -18,8 +18,7 @@ import { IModule } from './ModuleTypes';
function getItems(module: IModule) { function getItems(module: IModule) {
const { config, setConfig } = useConfig(); const { config, setConfig } = useConfig();
const { t } = useTranslation([module.id, 'common']); const { t } = useTranslation([`modules/${module.id}`, 'common']);
const items: JSX.Element[] = []; const items: JSX.Element[] = [];
if (module.options) { if (module.options) {
const keys = Object.keys(module.options); const keys = Object.keys(module.options);
@@ -33,7 +32,7 @@ function getItems(module: IModule) {
if (type === 'object') { if (type === 'object') {
items.push( items.push(
<MultiSelect <MultiSelect
label={module.options?.[keys[index]].name} label={t(`${module.options?.[keys[index]].name}`)}
data={module.options?.[keys[index]].options ?? []} data={module.options?.[keys[index]].options ?? []}
defaultValue={ defaultValue={
(moduleInConfig?.options?.[keys[index]]?.value as string[]) ?? (moduleInConfig?.options?.[keys[index]]?.value as string[]) ??
@@ -90,7 +89,7 @@ function getItems(module: IModule) {
key={optionName} key={optionName}
id={optionName} id={optionName}
name={optionName} name={optionName}
label={values[index].name} label={t(`${values[index].name}`)}
defaultValue={ defaultValue={
(moduleInConfig?.options?.[keys[index]]?.value as string) ?? (moduleInConfig?.options?.[keys[index]]?.value as string) ??
(values[index].value as string) ?? (values[index].value as string) ??
@@ -99,7 +98,7 @@ function getItems(module: IModule) {
onChange={(e) => {}} onChange={(e) => {}}
/> />
<Button type="submit">{t('actions.save')}</Button> <Button type="submit">{t('actions.save', { ns: 'common' })}</Button>
</Group> </Group>
</form> </form>
); );
@@ -221,7 +220,7 @@ export function ModuleMenu(props: any) {
</ActionIcon> </ActionIcon>
</motion.div> </motion.div>
</Menu.Target> </Menu.Target>
<Menu.Dropdown> <Menu.Dropdown style={{ maxWidth: 300 }}>
<Menu.Label>{t('settings.label')}</Menu.Label> <Menu.Label>{t('settings.label')}</Menu.Label>
{items.map((item) => ( {items.map((item) => (
<Menu.Item key={item.key}>{item}</Menu.Item> <Menu.Item key={item.key}>{item}</Menu.Item>