Cramkle Save

Web-based flashcard studying app

Project README

Cramkle

CI

Cramkle is a web-based flashcard studying app that helps you organize your study using a spaced repetition algorithm, used in many flashcard apps and learning websites, such as Anki and SuperMemo.

Getting started

If you want to access the Cloud version of Cramkle, go to www.cramkle.com, else you can follow the instructions below.

git clone https://github.com/cramkle/cramkle
cd cramkle

# Install dependencies
yarn

# Compile messages translations
yarn compile

If you want to run this project locally, you will also need to setup and run Hipocampo, which is our GraphQL API.

Development

Now that you've setup all the dependencies for both this project and Hipocampo, you can run the local server with the command below.

yarn dev

Adding and updating translations

This project uses lingui-js for i18n. In case you need to translate something that isn't yet translated, or you are adding some new texts, you'll need to use one of the macros from the lingui package. Lingui comes with several macros to handle all sorts of cases of language translation, but the most common one is just plain text. For simple texts, you can use either the Trans macro or the t macro (in conjunction with the useLingui hook).

Now, to translate something you can just wrap it up with one of lingui macros, like one of the two above:

import { Trans, t } from '@lingui/macro'
import { useLingui } from '@lingui/react'
import React from 'react'

const ComponentWithTrans = () => {
  return (
    <span>
      <Trans>My translated text</Trans>
    </span>
  )
}

const ComponentWithUseLingui = () => {
  const { i18n } = useLingui()

  return (
    <span>
      {i18n._(t`My translated text`)}
    </span>
  )
}

After adding the macro to the component like in the example above, you'll need to run yarn extract so lingui an extract those texts into PO files (under ./src/locales/). Then, edit the translation in the corresponding files and run yarn compile. You can see more info and other examples on the Lingui docs.

Open Source Agenda is not affiliated with "Cramkle" Project. README Source: cramkle/cramkle
Stars
32
Open Issues
8
Last Commit
9 months ago
Repository
License
MIT

Open Source Agenda Badge

Open Source Agenda Rating