feat(language): add Erlang programming language support (@Ryrden) (#7013)

### Description

This PR adds support for the Erlang programming language to Monkeytype,
providing developers with a comprehensive set of essential Erlang
keywords, OTP behaviors, and standard library functions for typing
practice.

**Changes made:**
- Add `code_erlang` to language schema
(`packages/schemas/src/languages.ts`)
- Add `code_erlang` to frontend constants in the `code` language group
(`frontend/src/ts/constants/languages.ts`)
- Create `code_erlang.json` with 245 essential Erlang keywords and
functions
- Includes core language constructs (after, and, case, receive, spawn),
OTP behaviors (gen_server, supervisor, application), built-in functions
(spawn_link, monitor, register), and standard library modules (lists,
string, ets, mnesia, file, io)

### Checks

- [ ] Adding quotes?
- [ ] Make sure to include translations for the quotes in the
description (or another comment) so we can verify their content.
- [x] Adding a language?
- Make sure to follow the [languages
documentation](https://github.com/monkeytypegame/monkeytype/blob/master/docs/LANGUAGES.md)
  - [x] Add language to `packages/schemas/src/languages.ts`
- [x] Add language to exactly one group in
`frontend/src/ts/constants/languages.ts`
  - [x] Add language json file to `frontend/static/languages` 
- [ ] Adding a theme?
- Make sure to follow the [themes
documentation](https://github.com/monkeytypegame/monkeytype/blob/master/docs/THEMES.md)
  - [ ] Add theme to `packages/schemas/src/themes.ts`
  - [ ] Add theme to `frontend/src/ts/constants/themes.ts`
  - [ ] Add theme css file to `frontend/static/themes`
- [ ] Add some screenshot of the theme, especially with different test
settings (colorful, flip colors) to your pull request
- [ ] Adding a layout?
- [ ] Make sure to follow the [layouts
documentation](https://github.com/monkeytypegame/monkeytype/blob/master/docs/LAYOUTS.md)
  - [ ] Add layout to `packages/schemas/src/layouts.ts`
  - [ ] Add layout json file to `frontend/static/layouts` 
- [ ] Adding a font?
- Make sure to follow the [themes
documentation](https://github.com/monkeytypegame/monkeytype/blob/master/docs/FONTS.md)
  - [ ] Add font file  to `frontend/static/webfonts`
  - [ ] Add font to `packages/schemas/src/fonts.ts`
  - [ ] Add font to `frontend/src/ts/constants/fonts.ts`
- [x] Check if any open issues are related to this PR; if so, be sure to
tag them below.
- [x] Make sure the PR title follows the Conventional Commits standard.
(https://www.conventionalcommits.org for more info)
- [x] Make sure to include your GitHub username prefixed with @ inside
parentheses at the end of the PR title.

<!-- No related issues found -->

Note: Please, is it possible to add the label `hacktoberfest-accepted`
to this PR?

Co-authored-by: Jack <jack@monkeytype.com>
This commit is contained in:
Ryan Souza 2025-10-15 05:44:50 -03:00 committed by GitHub
parent 260c3a94c3
commit 154b88eecf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 253 additions and 0 deletions

View file

@ -353,6 +353,7 @@ export const LanguageGroups: Record<string, Language[]> = {
"code_cobol",
"code_clojure",
"code_common_lisp",
"code_erlang",
"code_ocaml",
"code_odin",
"code_fortran",

View file

@ -0,0 +1,251 @@
{
"name": "code_erlang",
"noLazyMode": true,
"words": [
"after",
"and",
"andalso",
"band",
"begin",
"bnot",
"bor",
"bsl",
"bsr",
"bxor",
"case",
"catch",
"cond",
"div",
"end",
"fun",
"if",
"let",
"not",
"of",
"or",
"orelse",
"query",
"receive",
"rem",
"try",
"when",
"xor",
"module",
"export",
"import",
"compile",
"vsn",
"author",
"behaviour",
"behavior",
"record",
"define",
"ifdef",
"ifndef",
"else",
"endif",
"include",
"include_lib",
"undef",
"spec",
"type",
"opaque",
"callback",
"optional_callbacks",
"spawn",
"spawn_link",
"spawn_monitor",
"spawn_opt",
"link",
"unlink",
"monitor",
"demonitor",
"process_flag",
"register",
"unregister",
"whereis",
"registered",
"send",
"exit",
"throw",
"error",
"apply",
"make_ref",
"node",
"nodes",
"self",
"pid_to_list",
"list_to_pid",
"atom_to_list",
"list_to_atom",
"binary_to_list",
"list_to_binary",
"term_to_binary",
"binary_to_term",
"integer_to_list",
"list_to_integer",
"float_to_list",
"list_to_float",
"tuple_to_list",
"list_to_tuple",
"size",
"byte_size",
"bit_size",
"length",
"hd",
"tl",
"element",
"setelement",
"tuple_size",
"is_atom",
"is_binary",
"is_bitstring",
"is_boolean",
"is_float",
"is_function",
"is_integer",
"is_list",
"is_number",
"is_pid",
"is_port",
"is_record",
"is_reference",
"is_tuple",
"abs",
"round",
"trunc",
"max",
"min",
"gen_server",
"gen_statem",
"gen_fsm",
"gen_event",
"supervisor",
"application",
"start",
"stop",
"init",
"handle_call",
"handle_cast",
"handle_info",
"terminate",
"code_change",
"start_link",
"call",
"cast",
"reply",
"noreply",
"normal",
"shutdown",
"brutal_kill",
"permanent",
"temporary",
"transient",
"worker",
"one_for_one",
"one_for_all",
"rest_for_one",
"simple_one_for_one",
"infinity",
"timer",
"sleep",
"send_after",
"send_interval",
"cancel",
"now",
"date",
"time",
"localtime",
"universaltime",
"calendar",
"datetime_to_gregorian_seconds",
"gregorian_seconds_to_datetime",
"erlang",
"system_info",
"memory",
"garbage_collect",
"process_info",
"statistics",
"trace",
"trace_pattern",
"dbg",
"ets",
"new",
"insert",
"lookup",
"delete",
"match",
"select",
"foldl",
"foldr",
"tab2list",
"info",
"dets",
"open_file",
"close",
"sync",
"mnesia",
"create_schema",
"create_table",
"delete_table",
"write",
"read",
"transaction",
"activity",
"dirty_write",
"dirty_read",
"dirty_delete",
"file",
"open",
"position",
"consult",
"eval",
"script",
"io",
"format",
"fwrite",
"nl",
"get_line",
"get_chars",
"put_chars",
"lists",
"append",
"concat",
"reverse",
"sort",
"keysort",
"member",
"filter",
"map",
"foreach",
"all",
"any",
"partition",
"splitwith",
"takewhile",
"dropwhile",
"zip",
"unzip",
"flatten",
"string",
"len",
"equal",
"chr",
"str",
"rstr",
"span",
"cspan",
"substr",
"tokens",
"chars",
"copies",
"words",
"sub_word",
"strip",
"left",
"right",
"centre",
"to_upper",
"to_lower"
]
}

View file

@ -418,6 +418,7 @@ export const LanguageSchema = z.enum(
"code_cobol",
"code_clojure",
"code_common_lisp",
"code_erlang",
"docker_file",
"code_fortran",
"viossa",