Skip to content

Commit

Permalink
Fix #6 i18n - UI in english, some error in english
Browse files Browse the repository at this point in the history
  • Loading branch information
boly38 committed Jun 11, 2024
1 parent 70d4e68 commit cbb4a8f
Show file tree
Hide file tree
Showing 15 changed files with 450 additions and 60 deletions.
196 changes: 196 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"express": "^4.19.2",
"http-errors": "^2.0.0",
"http-status-codes": "^2.3.0",
"i18n": "^0.15.1",
"node-dependency-injection": "^3.1.2",
"superagent": "^9.0.2",
"tinyurl": "^1.1.7",
Expand Down
11 changes: 11 additions & 0 deletions src/exceptions/ServiceUnavailableException.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import {ReasonPhrases, StatusCodes} from "http-status-codes";
import {isSet} from "node:util/types";
import i18n from "i18n";

export default class ServiceUnavailableException {
constructor(message = null) {
this.code = ReasonPhrases.SERVICE_UNAVAILABLE;
this.status = StatusCodes.SERVICE_UNAVAILABLE;
this.message = isSet(message) ? message : i18n.__('server.error.unavailable');
}
}
11 changes: 11 additions & 0 deletions src/exceptions/TooManyRequestsException.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import {ReasonPhrases, StatusCodes} from "http-status-codes";
import {isSet} from "node:util/types";
import i18n from "i18n";

export default class TooManyRequestsException {
constructor(message = null) {
this.code = ReasonPhrases.TOO_MANY_REQUESTS;
this.status = StatusCodes.TOO_MANY_REQUESTS;
this.message = isSet(message) ? message : i18n.__('server.error.tooManyRequests');
}
}
48 changes: 48 additions & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"index.title": "BotEnSky Node.js BlueSky Bot hosted on Render.com",
"index.menu.home": "Home - Logs",
"index.menu.principles": "Principles",
"index.menu.faq": "FAQ",
"index.menu.github": "Source Code on GitHub",
"home.bot_activities": "Bot activities",
"home.welcome_on_bot_page": "Welcome on website of ",
"home.a_bluesky_bot": "a BlueSky’s bot",
"home.version": "version",
"home.activities": "Recent activities",
"home.freshness": "freshness",
"home.seven_days_analytics": "7 days analytics",
"home.posts": "posts",
"home.examples": "examples",
"home.best_score": "Best score",
"home.best_likes": "Best likes",
"principles.besplantnet.head": "the robot answers to certain posts!",
"principles.besplantnet.body": "At certain times of the day, the robot searches for images of flowers/plants.\n\n Then it tries to identify the plant, and if successful, it answers the author of the post with an example image.",
"principles.besaskplantnet.head": "the robot answers to certain mentions!",
"principles.besaskplantnet.body": "For the moment it is possible to ask the robot to identify a flower/plant.\n\n To do this, answer a post containing an image of a flower/plant with the mention <code>@botensky.bsky.social</code>.<br/>\n Then you must wait for the robot to wake up for the <b>AskPlantnet</b> plugin (see FAQ)",
"principles.bot_principles": "Bot’s principles",
"principles.functions": "Functions",
"project.line1": "BotEnSky is an open-source project that tries to identify plants or flowers (click on the black GitHub corner).",
"project.line2": "It's a young bot, but it learns from its mistakes.",
"project.line2link": "See the project's tickets",
"project.line3": "The project is open to tinkerers who want to improve the bot.",
"project.line4": "A web designer could bring a lot for example...",
"project.line5": "If someone is working on it, then it is possible that the bot posts more often or strangely.",
"project.line6": "You want to talk about the bot and its features somewhere other than BlueSky, open a discussion.",
"project.line6link": "See the project's discussions",
"faq.title": "Frequently Asked Questions",
"faq.head1": "On this website, it takes a long time to display",
"faq.tag1": "😴",
"faq.body1": "I fall asleep when I'm not stimulated, this is free hosting that optimizes server times.",
"faq.body1b": "yes, also think about saving the planet 🌍",
"faq.body1c": "It takes a little time (sometimes up to 6 minutes) to wake up the server, but then it responds normally.",
"faq.head2": "What time do you wake up?",
"faq.tag2": "🕐",
"faq.body2": "For the moment it's not too fixed yet. apart from manual shots,",
"faq.body2a": "For the plugin <b>PlantNet</b> : I simulate at ~ 17:15/17:25, and practice at 17:30, 19:30 (FR).",
"faq.body2b": "For the plugin <b>AskPlantnet</b> (in testing phase): I practice at 12:00 and 17:00 (FR).",
"server.error.unexpected": "Unexpected error",
"server.error.unavailable": "I am currently under maintenance, please try again later",
"server.error.tooManyRequests": "Request too close together, please try again later",
"server.pleaseReportIssue": "please look for or report it on ",
"server.issueLinkLabel": "issues"
}
Loading

0 comments on commit cbb4a8f

Please sign in to comment.