Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/locales/en/date/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pub mod month;
pub mod weekday;
44 changes: 44 additions & 0 deletions src/locales/en/date/month.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
use crate::utils::seeder;
use wasm_bindgen::prelude::*;

#[wasm_bindgen(js_name = date_month_wide)]
pub fn month_wide() -> String {
EN_MONTH_WIDE[seeder::gen_range(0..EN_MONTH_WIDE_LEN)].to_string()
}

static EN_MONTH_WIDE: [&'static str; 12] = [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December",
];
static EN_MONTH_WIDE_LEN: usize = EN_MONTH_WIDE.len();

#[wasm_bindgen(js_name = date_month_abbr)]
pub fn month_abbr() -> String {
EN_MONTH_ABBR[seeder::gen_range(0..EN_MONTH_ABBR_LEN)].to_string()
}

static EN_MONTH_ABBR: [&'static str; 12] = [
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec",
];
static EN_MONTH_ABBR_LEN: usize = EN_MONTH_ABBR.len();
29 changes: 29 additions & 0 deletions src/locales/en/date/weekday.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
use crate::utils::seeder;
use wasm_bindgen::prelude::*;

#[wasm_bindgen(js_name = date_weekday_wide)]
pub fn weekday_wide() -> String {
EN_WEEKDAY_WIDE[seeder::gen_range(0..EN_WEEKDAY_WIDE_LEN)].to_string()
}

static EN_WEEKDAY_WIDE: [&'static str; 7] = [
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday",
];
static EN_WEEKDAY_WIDE_LEN: usize = EN_WEEKDAY_WIDE.len();

#[wasm_bindgen(js_name = date_weekday_abbr)]
pub fn weekday_abbr() -> String {
EN_WEEKDAY_ABBR[seeder::gen_range(0..EN_WEEKDAY_ABBR_LEN)].to_string()
}

static EN_WEEKDAY_ABBR: [&'static str; 7] = [
"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat",
];
static EN_WEEKDAY_ABBR_LEN: usize = EN_WEEKDAY_ABBR.len();

3 changes: 3 additions & 0 deletions src/locales/en/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ pub mod color;
pub mod app;
pub mod lorem;
pub mod team;
pub mod date;
pub mod sport;
pub mod tea;
20 changes: 20 additions & 0 deletions src/locales/en/sport/ancient_olympics.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
use crate::utils::seeder;
use wasm_bindgen::prelude::*;

#[wasm_bindgen(js_name = sport_ancient_olympics)]
pub fn ancient_olympics_sport() -> String {
EN_ANCIENT_OLYMPICS[seeder::gen_range(0..EN_ANCIENT_OLYMPICS_LEN)].to_string()
}

static EN_ANCIENT_OLYMPICS: [&'static str; 9] = [
"Boxing",
"Chariot racing",
"Discus",
"Horse racing",
"Long jump",
"Pankration",
"Pentathlon",
"Running",
"Wrestling",
];
static EN_ANCIENT_OLYMPICS_LEN: usize = EN_ANCIENT_OLYMPICS.len();
6 changes: 6 additions & 0 deletions src/locales/en/sport/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pub mod summer_olympics;
pub mod winter_olympics;
pub mod summer_paralympics;
pub mod winter_paralympics;
pub mod ancient_olympics;
pub mod unusual;
58 changes: 58 additions & 0 deletions src/locales/en/sport/summer_olympics.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
use crate::utils::seeder;
use wasm_bindgen::prelude::*;

#[wasm_bindgen(js_name = sport_summer_olympics)]
pub fn summer_olympics_sport() -> String {
EN_SUMMER_OLYMPICS[seeder::gen_range(0..EN_SUMMER_OLYMPICS_LEN)].to_string()
}

static EN_SUMMER_OLYMPICS: [&'static str; 47] = [
"3x3 basketball",
"Archery",
"Artistic gymnastics",
"Artistic swimming",
"Athletics",
"Badminton",
"Baseball # Technically part of \"Baseball Softball\" according to IOC website",
"Basketball",
"Beach volleyball",
"BMX freestyle # Officially \"Cycling BMX Freestyle\"",
"BMX racing # Officially \"Cycling BMX Racing\"",
"Boxing",
"Canoe/kayak flatwater",
"Canoe/kayak slalom",
"Diving",
"Equestrian",
"Fencing",
"Football",
"Golf",
"Handball",
"Hockey",
"Judo",
"Karate",
"Marathon swimming",
"Modern pentathlon",
"Mountain bike # Officially \"Cycling Mountain Bike\"",
"Rhythmic gymnastics",
"Road cycling # Officially \"Cycling Road\"",
"Rowing",
"Rugby # Officially \"Rugby Sevens\"",
"Sailing",
"Shooting",
"Skateboarding",
"Softball # Technically part of \"Baseball Softball\" according to IOC website",
"Sport climbing",
"Surfing",
"Swimming",
"Table tennis",
"Taekwondo",
"Tennis",
"Track cycling # Officially \"Cycling Track\"",
"Trampoline",
"Triathlon",
"Volleyball",
"Water polo",
"Weight lifting",
"Wrestling",
];
static EN_SUMMER_OLYMPICS_LEN: usize = EN_SUMMER_OLYMPICS.len();
33 changes: 33 additions & 0 deletions src/locales/en/sport/summer_paralympics.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
use crate::utils::seeder;
use wasm_bindgen::prelude::*;

#[wasm_bindgen(js_name = sport_summer_paralympics)]
pub fn summer_paralympics_sport() -> String {
EN_SUMMER_PAEALYMPICS[seeder::gen_range(0..EN_SUMMER_PAEALYMPICS_LEN)].to_string()
}

static EN_SUMMER_PAEALYMPICS: [&'static str; 22] = [
"Archery",
"Athletics",
"Badminton",
"Blind football",
"Boccia",
"Canoe",
"Cycling",
"Equestrian",
"Goalball",
"Judo",
"Powerlifting",
"Rowing",
"Shooting",
"Sitting volleyball",
"Swimming",
"Table tennis",
"Taekwondo",
"Triathlon",
"Wheelchair basketball",
"Wheelchair fencing",
"Wheelchair rugby",
"Wheelchair tennis",
];
static EN_SUMMER_PAEALYMPICS_LEN: usize = EN_SUMMER_PAEALYMPICS.len();
32 changes: 32 additions & 0 deletions src/locales/en/sport/unusual.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
use crate::utils::seeder;
use wasm_bindgen::prelude::*;

#[wasm_bindgen(js_name = sport_unusual)]
pub fn unusual_sport() -> String {
EN_UNUSUAL_SPORT[seeder::gen_range(0..EN_UNUSUAL_SPORT_LEN)].to_string()
}

static EN_UNUSUAL_SPORT: [&'static str; 21] = [
"Apple Racing",
"Ban'ei",
"Bathtubbing",
"Bed racing",
"Bossaball",
"Botaoshi",
"Beer Can Regatta",
"Black pudding throwing",
"Bog snorkelling",
"Bottle kicking",
"Camel jumping",
"Camel wrestling",
"Chess boxing",
"Extreme ironing",
"Flugtag/Birdman",
"Gurning",
"Kastenlauf (Beer crate running)",
"Oil wrestling",
"Poohsticks",
"Wife carrying",
"Zorbing",
];
static EN_UNUSUAL_SPORT_LEN: usize = EN_UNUSUAL_SPORT.len();
27 changes: 27 additions & 0 deletions src/locales/en/sport/winter_olympics.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
use crate::utils::seeder;
use wasm_bindgen::prelude::*;

#[wasm_bindgen(js_name = sport_winter_olympics)]
pub fn winter_olympics_sport() -> String {
EN_WINTER_OLYMPICS[seeder::gen_range(0..EN_WINTER_OLYMPICS_LEN)].to_string()
}

static EN_WINTER_OLYMPICS: [&'static str; 16] = [
"Alpine skiing",
"Biathlon",
"Bobsleigh",
"Cross-country skiing",
"Curling",
"Figure skating",
"Freestyle skiing",
"Ice hockey",
"Luge",
"Nordic combined",
"Short track speed skating",
"Skeleton",
"Ski jumping",
"Ski mountaineering",
"Snowboard",
"Speed skating",
];
static EN_WINTER_OLYMPICS_LEN: usize = EN_WINTER_OLYMPICS.len();
17 changes: 17 additions & 0 deletions src/locales/en/sport/winter_paralympics.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
use crate::utils::seeder;
use wasm_bindgen::prelude::*;

#[wasm_bindgen(js_name = sport_winter_paralympics)]
pub fn winter_paralympics_sport() -> String {
EN_WINTER_PAEALYMPICS[seeder::gen_range(0..EN_WINTER_PAEALYMPICS_LEN)].to_string()
}

static EN_WINTER_PAEALYMPICS: [&'static str; 6] = [
"Alpine skiing",
"Biathlon",
"Cross-country skiing",
"Para ice hockey",
"Snowboard",
"Wheelchair curling",
];
static EN_WINTER_PAEALYMPICS_LEN: usize = EN_WINTER_PAEALYMPICS.len();
35 changes: 35 additions & 0 deletions src/locales/en/tea/black_tea.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
use crate::utils::seeder;
use wasm_bindgen::prelude::*;

#[wasm_bindgen(js_name = tea_black_tea)]
pub fn black_tea() -> String {
EN_BLACK_TEA[seeder::gen_range(0..EN_BLACK_TEA_LEN)].to_string()
}

static EN_BLACK_TEA: [&'static str; 24] = [
"Assam",
"Ceylon",
"Congou",
"Darjeeling",
"Dianhong",
"Earl Grey",
"English Afternoon",
"English Breakfast",
"Irish Breakfast",
"Jaekseol",
"Jiu Qu Hong Mei",
"Kangra",
"Keemun",
"Lady Grey",
"Lahijan",
"Lapsang Souchong",
"Masala Chai",
"Munnar",
"Nepali",
"Nilgiri",
"Rize",
"Scottish Breakfast",
"Sun Moon Lake",
"Yingdehong",
];
static EN_BLACK_TEA_LEN: usize = EN_BLACK_TEA.len();
34 changes: 34 additions & 0 deletions src/locales/en/tea/green_tea.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
use crate::utils::seeder;
use wasm_bindgen::prelude::*;

#[wasm_bindgen(js_name = tea_green_tea)]
pub fn green_tea() -> String {
EN_GREEN_TEA[seeder::gen_range(0..EN_GREEN_TEA_LEN)].to_string()
}

static EN_GREEN_TEA: [&'static str; 23] = [
"Bancha",
"Biluochun",
"Chun Mee",
"Daejak",
"Garucha",
"Genmaicha",
"Gunpowder",
"Gyokuro",
"Hojicha",
"Huangshan Maofeng",
"Ipcha",
"Jungjak",
"Kabusecha",
"Kukicha",
"Longjing",
"Lu'an Melon Seed",
"Matcha",
"Sejak",
"Sencha",
"Shincha",
"Taipin Houkui",
"Ujeon",
"Xinyang Maojian",
];
static EN_GREEN_TEA_LEN: usize = EN_GREEN_TEA.len();
Loading