Skip to content
This repository was archived by the owner on Feb 15, 2022. It is now read-only.

Create a Lang module #333

Closed
ghost opened this issue May 11, 2021 · 6 comments
Closed

Create a Lang module #333

ghost opened this issue May 11, 2021 · 6 comments
Assignees

Comments

@ghost
Copy link

ghost commented May 11, 2021

We will need to tag data with the language its written in. We will also need to dispatch logic basic on an indicated language value. Let's be prepared for those scenarios by introducing a Lang module which has constants for the current set of languages that ocaml.org supports.

We will mostly likely use react-intl when implementing internationalization support, so considering imitating how it defines constants: https://github.com/formatjs/formatjs.

@rdavison
Copy link
Contributor

Correct me if I'm wrong but as it stands it seems to me that this issue is asking for a module that looks like:

type t = [
  | `En
  | `Fr
  | ...
]

Am I mistaken? If not, would it make more sense to just use react-intl or finding a binding to it, and using it instead of defining what appears to me as an exceedingly simple module?

@agarwal
Copy link
Member

agarwal commented May 19, 2021

it seems to me that this issue is asking for a module that looks like

Yes, that's it. It is a very simple module. I wanted the type to exist, so that future harder work will be structured around this. Since it is so simple, you could go ahead with some refactoring related to this. Search for values with names like *En, and convert these to functions that take a Lang.t.

@ghost
Copy link
Author

ghost commented May 24, 2021

The issue will feed into the overall work in #145.

@ghost
Copy link
Author

ghost commented Jun 26, 2021

I consider this issue complete.

@ghost ghost closed this as completed Jun 26, 2021
@ghost ghost reopened this Jul 1, 2021
@ghost
Copy link
Author

ghost commented Jul 1, 2021

Review of #438:

Please update MainLayout and GlobalData modules to use the Lang type.

@rdavison
Copy link
Contributor

Review of #438:

Please update MainLayout and GlobalData modules to use the Lang type.

Merged ocaml/ocaml.org#540

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants