Skip to content

msmathcomp/AI-Dilemmas

Repository files navigation

AI-Form

Configuration

A config file (public/config.json) is loaded before the application is started. It supports the following keys:

  • defaultLanguage (string, default: "en"): Default language to use.

Development and Building

The application is built using React + Vite, powered by tailwind-css for styling and typescript.

Prerequisites

Make sure that node and npm (or pnpm) is installed.

Environment Variables

To use the app with a supabase db connection, you must use the correct environment variables. Copy the example .env.example file and fill in the variables from supabase

cp .env.example .env

Running locally (dev mode)

Instead of using pnpm, you can also use npm. However pnpm is preferred since it is much faster and efficient.

pnpm i
pnpm run dev

Building

You can compile the application, which can be then be accessed in from the dist/ folder.

pnpm run build

To preview the built version, you can run

pnpm run preview

Internationalization

To add a new translation, the following steps are necessary:

  • Figure out the language code for the language you want to add, e.g. eo for Esperanto.
  • Copy a locale file from tr/ for a language you are familiar with and rename its basename to match the new language code, e.g. copy tr/en.json to tr/eo.json.
  • Translate all the texts in the new locale file. Preserve whitespace.
  • Update the intlayer.config.ts file. For e.g. add Locales.ESPERANTO to locales array.
  • Add the import to the tr/index.ts file and update the object being exported. For e.g. adding import eoTranslations from './eo.json' and adding a new value of eo: eoTranslations.
  • To update the intlayer dictionaries you can the following command. Note, it builds the dictionary on running app via dev command as well.
pnpm dlx intlayer build

About

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors