Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add quotes and translations #296

Merged
merged 2 commits into from
Sep 16, 2022
Merged
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
7 changes: 4 additions & 3 deletions geeksay.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ const translations = {
"waiting": "loading",
"unauthorized": "401",
"nothing": "void",
"pink": "#ffc0cb"
"style": "CSS",
"developer": "dev"
}
Expand Down Expand Up @@ -174,6 +175,7 @@ const quotes = [
"Easy as pie", // easy as π
"Live, laugh, love", // live, laugh, <3
"Green with envy", // #00ff00 with envy
"pink panther" // #ffc0cb panther
"Get busy living or get busy dying", // git busy living || git busy dying
"out of the blue", // out of the #0000ff
"caught red-handed", // caught #ff0000 handed
Expand All @@ -194,8 +196,7 @@ function geeksay(text) {
function geeksayWord(word) {
if (isNumeric(word)) {
return (word >>> 0).toString(2);
}
else {
} else {
lowerCaseText = removeSymbols(word).toLowerCase();
if (translations.hasOwnProperty(lowerCaseText)) {
word = word.toLowerCase().replace(lowerCaseText, translations[lowerCaseText]);
Expand All @@ -218,4 +219,4 @@ function getRandomQuote() {
return quotes[Math.floor(Math.random() * quotes.length)];
}

module.exports = geeksay;
module.exports = geeksay;