Skip to content

Support changing the locale #15

@pillowfication

Description

@pillowfication

Currently there is no way to change the locale with the dev-harness. Seems like everything is in place for it, but there's no UI yet.

/* AppHeader/index.tsx */

import React, { ChangeEvent } from 'react';
import { Box, MenuItem, TextField } from '@alteryx/ui';

/* ... */

const AppHeader = (props: IAppHeaderProps): JSX.Element => {
  /* ... */
  const handleChangeLocale = (event: ChangeEvent<HTMLInputElement>): void => {
    handleSetLocale(event.target.value);
  };

  return (
    /* ... */
                <Grid item>
                  <FormControlLabel
                    control={(
                      <TextField
                        onChange={handleChangeLocale}
                        select
                        SelectProps={{ autoWidth: false }}
                        value={locale}
                      >
                        {localeOptions.map(option => (
                          <MenuItem key={option.value} value={option.value}>
                            {option.primary}
                          </MenuItem>
                        ))}
                      </TextField>
                    )}
                    label={<Box mr={2}>Locale</Box>}
                    labelPlacement="start"
                  />
                </Grid>
    /* ... */
  );
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions