Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/brunosabot/afkalc


https://github.com/brunosabot/afkalc

hacktoberfest

Last synced: about 2 months ago
JSON representation

Awesome Lists containing this project

README

        

# Afkalc

## Usage

```shell
npm
npm start
```

## Dev guide

### Add a translation

#### Step 1: Configure the new language

In `main.tsx`, you need to activate the language for two concepts :

- The date library `dayjs`
- The app i18n with `i18next`

To add a language for `dayjs`, you just need to add the language import at the top of the document. Exemple adding french:

```javascript
import "dayjs/locale/fr";
```

To add a language for `i18next`, you need to update the arrays in the `whitelist` feature of the configuration.

Exemple adding french:

```diff
-const languages = ["en"];
+const languages = ["en", "fr"];
```

#### Step 2: Add the quick language change

In both `Menu.tsx` and `Home.tsx`, you need to add a new quick language change button.

Simply add a new `` component with a `lang` attribute corresponding to the code and an `emoji` flag for the country.

Exemple adding french:

```jsx

```

#### Step 3: Add the translations

In the `public/locales` folder, add a new folder with you new langage.

Then, copy all the files from the `en` folder into you newly created file and update them with the proper translated strings