-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add string localization loading and fetching to Lang
Also began localizing the help command a bit to test things out
- Loading branch information
Showing
13 changed files
with
174 additions
and
41 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"CMD_HELP_SERVERONLY": "[Server Only]", | ||
"CMD_HELP_OWNERONLY": "[Owner Only]", | ||
"CMD_HELP_ALIASES": "Aliases: {{aliases}}", | ||
"CMD_HELP_CODEBLOCK": "```ldif\n{{serverOnly}}{{ownerOnly}}Command: {{commandName}}\nDescription: {{desc}}\n{{aliasText}}Usage: {{usage}}\n{{info}}\n```" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/** | ||
* @typedef {Function} LangResourceFunction Represents a function assigned to | ||
* a specific language that takes a string key and a {@link TokenReplaceData} | ||
* object and returns a localized string for that language if it exists | ||
*/ | ||
|
||
import { TokenReplaceData } from './TokenReplaceData'; | ||
export type LangResourceFunction = (key: string, data?: TokenReplaceData) => string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/** | ||
* @typedef {object} TokenReplaceData Represents an object mapping key | ||
* tokens to string values, where the token keys will be replaced with | ||
* the provided value in the source string when given to a Lang resource | ||
* function like {@link Lang.res} | ||
*/ | ||
|
||
export type TokenReplaceData = { [key: string]: string }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"CMD_HELP_SERVERONLY": "[Canjan Uhmo]", | ||
"CMD_HELP_OWNERONLY": "[Ufhan Uhmo]", | ||
"CMD_HELP_ALIASES": "Ymeycac: {{aliases}}", | ||
"CMD_HELP_CODEBLOCK": "```ldif\n{{serverOnly}}{{ownerOnly}}Lussyht: {{commandName}}\nTaclnebdeuh: {{desc}}\n{{aliasText}}Icyka: {{usage}}\n{{info}}\n```" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters