mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-09 20:12:10 +10:00
i18n Support and Task improvements (#80)
* fix: release workflow * feat: move mostly to internal tasks system * feat: migrate object clean to new task system * fix: release not getting good base version * chore: set version v0.3.0 * chore: style * feat: basic task concurrency * feat: temp pages to fill in page links * feat: inital i18n support * feat: localize store page * chore: style * fix: weblate doesn't like multifile thing * fix: update nuxt * feat: improved error logging * fix: using old task api * feat: basic translation docs * feat: add i18n eslint plugin * feat: translate store and auth pages * feat: more translation progress * feat: admin dash i18n progress * feat: enable update check by default in prod * fix: using wrong i18n keys * fix: crash in library sources page * feat: finish i18n work * fix: missing i18n translations * feat: use twemoji for emojis * feat: sanatize object ids * fix: EmojiText's alt text * fix: UserWidget not using links * feat: cache and auth for emoji api * fix: add more missing translations
This commit is contained in:
27
i18n/i18n.config.ts
Normal file
27
i18n/i18n.config.ts
Normal file
@ -0,0 +1,27 @@
|
||||
export default defineI18nConfig(() => {
|
||||
const defaultDateTimeFormat = {
|
||||
short: {
|
||||
year: "numeric",
|
||||
month: "long",
|
||||
day: "numeric",
|
||||
},
|
||||
long: {
|
||||
year: "numeric",
|
||||
month: "short",
|
||||
day: "numeric",
|
||||
weekday: "short",
|
||||
hour: "numeric",
|
||||
minute: "numeric",
|
||||
},
|
||||
} as const;
|
||||
|
||||
return {
|
||||
// https://i18n.nuxtjs.org/docs/guide/locale-fallback
|
||||
fallbackLocale: "en-us",
|
||||
// https://vue-i18n.intlify.dev/guide/essentials/datetime.html
|
||||
datetimeFormats: {
|
||||
"en-us": defaultDateTimeFormat,
|
||||
"en-pirate": defaultDateTimeFormat,
|
||||
},
|
||||
};
|
||||
});
|
||||
25
i18n/localeDetector.ts
Normal file
25
i18n/localeDetector.ts
Normal file
@ -0,0 +1,25 @@
|
||||
// https://i18n.nuxtjs.org/docs/guide/server-side-translations
|
||||
|
||||
// Detect based on query, cookie, header
|
||||
export default defineI18nLocaleDetector((event, config) => {
|
||||
// try to get locale from query
|
||||
const query = tryQueryLocale(event, { lang: "" }); // disable locale default value with `lang` option
|
||||
if (query) {
|
||||
return query.toString();
|
||||
}
|
||||
|
||||
// try to get locale from cookie
|
||||
const cookie = tryCookieLocale(event, { lang: "", name: "i18n_redirected" }); // disable locale default value with `lang` option
|
||||
if (cookie) {
|
||||
return cookie.toString();
|
||||
}
|
||||
|
||||
// try to get locale from header (`accept-header`)
|
||||
const header = tryHeaderLocale(event, { lang: "" }); // disable locale default value with `lang` option
|
||||
if (header) {
|
||||
return header.toString();
|
||||
}
|
||||
|
||||
// If the locale cannot be resolved up to this point, it is resolved with the value `defaultLocale` of the locale config passed to the function
|
||||
return config.defaultLocale;
|
||||
});
|
||||
3
i18n/locales/en_pirate.json
Normal file
3
i18n/locales/en_pirate.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"welcome": "Arr matey, Welcome!"
|
||||
}
|
||||
351
i18n/locales/en_us.json
Normal file
351
i18n/locales/en_us.json
Normal file
@ -0,0 +1,351 @@
|
||||
{
|
||||
"account": {
|
||||
"devices": {
|
||||
"capabilities": "Capabilities",
|
||||
"lastConnected": "Last Connected",
|
||||
"noDevices": "No devices connected to your account.",
|
||||
"platform": "Platform",
|
||||
"revoke": "Revoke",
|
||||
"subheader": "Manage the devices authorized to access your Drop account.",
|
||||
"title": "Devices"
|
||||
},
|
||||
"notifications": {
|
||||
"all": "View all {arrow}",
|
||||
"desc": "View and manage your notifications.",
|
||||
"markAllAsRead": "Mark all as read",
|
||||
"markAsRead": "Mark as read",
|
||||
"none": "No notifications",
|
||||
"notifications": "Notifications",
|
||||
"title": "Notifications",
|
||||
"unread": "Unread Notifications"
|
||||
},
|
||||
"settings": "Account Settings",
|
||||
"title": "Account"
|
||||
},
|
||||
"actions": "Actions",
|
||||
"adminTitle": "Admin Dashboard | Drop",
|
||||
"adminTitleTemplate": "{0} | Admin | Drop",
|
||||
"auth": {
|
||||
"callback": {
|
||||
"authClient": "Authorize client?",
|
||||
"authorize": "Authorize",
|
||||
"authorizedClient": "Drop has successfully authorized the client. You may now close this window.",
|
||||
"issues": "Having issues?",
|
||||
"learn": "Learn more {arrow}",
|
||||
"paste": "Paste this code into the client to continue:",
|
||||
"permWarning": "Accepting this request will allow \"{name}\" on \"{platform}\" to:",
|
||||
"requestedAccess": "\"{name}\" has requested access to your Drop account.",
|
||||
"success": "Successful!"
|
||||
},
|
||||
"confirmPassword": "Confirm @:auth.password",
|
||||
"displayName": "Display Name",
|
||||
"email": "Email",
|
||||
"password": "Password",
|
||||
"register": {
|
||||
"confirmPasswordFormat": "Must be the same as above",
|
||||
"emailFormat": "Must be in the format user{'@'}example.com",
|
||||
"passwordFormat": "Must be 14 or more characters",
|
||||
"subheader": "Fill in your details below to create your account.",
|
||||
"title": "Create your Drop account",
|
||||
"usernameFormat": "Must be 5 or more characters, and lowercase"
|
||||
},
|
||||
"signin": {
|
||||
"externalProvider": "Sign in with external provider {arrow}",
|
||||
"forgot": "Forgot password?",
|
||||
"noAccount": "Don't have an account? Ask an admin to create one for you.",
|
||||
"or": "OR",
|
||||
"pageTitle": "Sign in to Drop",
|
||||
"rememberMe": "Remember me",
|
||||
"signin": "Sign in",
|
||||
"title": "Sign in to your account"
|
||||
},
|
||||
"signout": "Signout",
|
||||
"username": "Username"
|
||||
},
|
||||
"cancel": "Cancel",
|
||||
"chars": {
|
||||
"arrow": "→",
|
||||
"arrowBack": "←",
|
||||
"quoted": "\"\"",
|
||||
"srComma": ", {0}"
|
||||
},
|
||||
"close": "Close",
|
||||
"common": {
|
||||
"cannotUndo": "This action cannot be undone.",
|
||||
"date": "Date",
|
||||
"deleteConfirm": "Are you sure you want to delete \"{0}\"?",
|
||||
"friends": "Friends",
|
||||
"groups": "Groups",
|
||||
"noResults": "No results",
|
||||
"servers": "Servers",
|
||||
"tags": "Tags",
|
||||
"today": "Today"
|
||||
},
|
||||
"create": "Create",
|
||||
"delete": "Delete",
|
||||
"drop": {
|
||||
"desc": "An open-source game distribution platform built for speed, flexibility and beauty.",
|
||||
"drop": "Drop"
|
||||
},
|
||||
"edit": "Edit",
|
||||
"editor": {
|
||||
"bold": "Bold",
|
||||
"boldPlaceholder": "bold text",
|
||||
"code": "Code",
|
||||
"codePlaceholder": "code",
|
||||
"heading": "Heading",
|
||||
"headingPlaceholder": "heading",
|
||||
"italic": "Italic",
|
||||
"italicPlaceholder": "italic text",
|
||||
"link": "Link",
|
||||
"linkPlaceholder": "link text",
|
||||
"listItem": "List Item",
|
||||
"listItemPlaceholder": "list item"
|
||||
},
|
||||
"errors": {
|
||||
"backHome": "{arrow} Back to home",
|
||||
"invalidBody": "Invalid request body: {0}",
|
||||
"inviteRequired": "Invitation required to sign up.",
|
||||
"library": {
|
||||
"add": {
|
||||
"desc": "Drop couldn't add this game to your library: {0}",
|
||||
"title": "Failed to add game to library"
|
||||
},
|
||||
"collection": {
|
||||
"create": {
|
||||
"desc": "Drop couldn't create your collection: {0}",
|
||||
"title": "Failed to create collection"
|
||||
}
|
||||
},
|
||||
"source": {
|
||||
"delete": {
|
||||
"desc": "Drop couldn't add delete this source: {0}",
|
||||
"title": "Failed to delete library source"
|
||||
}
|
||||
}
|
||||
},
|
||||
"news": {
|
||||
"article": {
|
||||
"delete": {
|
||||
"desc": "Drop couldn't delete this article: {0}",
|
||||
"title": "Failed to delete article"
|
||||
}
|
||||
}
|
||||
},
|
||||
"occurred": "An error occurred while responding to your request. If you believe this to be a bug, please report it. Try signing in and see if it resolves the issue.",
|
||||
"ohNo": "Oh no!",
|
||||
"pageTitle": "{0} | Drop",
|
||||
"revokeClient": "Failed to revoke client",
|
||||
"revokeClientFull": "Failed to revoke client {0}",
|
||||
"signIn": "Sign in {arrow}",
|
||||
"support": "Support Discord",
|
||||
"unknown": "An unknown error occurred",
|
||||
"version": {
|
||||
"delete": {
|
||||
"desc": "Drop encountered an error while deleting the version: {error}",
|
||||
"title": "There an error while deleting the version"
|
||||
},
|
||||
"order": {
|
||||
"desc": "Drop encountered an error while updating the version: {error}",
|
||||
"title": "There an error while updating the version order"
|
||||
}
|
||||
}
|
||||
},
|
||||
"footer": {
|
||||
"about": "About",
|
||||
"aboutDrop": "About Drop",
|
||||
"api": "API",
|
||||
"docs": {
|
||||
"client": "Client Docs",
|
||||
"server": "Server Docs"
|
||||
},
|
||||
"documentation": "Documentation",
|
||||
"faq": "FAQ",
|
||||
"features": "Features",
|
||||
"findGame": "Find a Game",
|
||||
"footer": "Footer",
|
||||
"games": "Games",
|
||||
"social": {
|
||||
"discord": "Discord",
|
||||
"github": "GitHub"
|
||||
},
|
||||
"topSellers": "Top Sellers"
|
||||
},
|
||||
"header": {
|
||||
"admin": {
|
||||
"admin": "Admin",
|
||||
"meta": "Meta",
|
||||
"tasks": "Tasks",
|
||||
"users": "Users"
|
||||
},
|
||||
"back": "Back",
|
||||
"openSidebar": "Open sidebar"
|
||||
},
|
||||
"highest": "highest",
|
||||
"home": "Home",
|
||||
"library": {
|
||||
"addGames": "All Games",
|
||||
"addToLib": "Add to Library",
|
||||
"admin": {
|
||||
"detectedGame": "Drop has detected you have new games to import.",
|
||||
"detectedVersion": "Drop has detected you have new verions of this game to import.",
|
||||
"gameLibrary": "Game Library",
|
||||
"import": {
|
||||
"import": "Import",
|
||||
"link": "Import {arrow}",
|
||||
"loading": "Loading game results...",
|
||||
"search": "Search",
|
||||
"searchPlaceholder": "Fallout 4",
|
||||
"selectDir": "Please select a directory...",
|
||||
"selectGame": "Select game to import",
|
||||
"selectGamePlaceholder": "Please select a game...",
|
||||
"selectGameSearch": "Select game",
|
||||
"selectPlatform": "Please select a platform...",
|
||||
"version": {
|
||||
"advancedOptions": "Advanced options",
|
||||
"import": "Import version",
|
||||
"installDir": "(install_dir)/",
|
||||
"launchCmd": "Launch executable/command",
|
||||
"launchDesc": "Executable to launch the game",
|
||||
"launchPlaceholder": "game.exe",
|
||||
"loadingVersion": "Loading version metadata...",
|
||||
"noAdv": "No advanced options for this configuration.",
|
||||
"noVersions": "No versions to import",
|
||||
"platform": "Version platform",
|
||||
"setupCmd": "Setup executable/command",
|
||||
"setupDesc": "Ran once when the game is installed",
|
||||
"setupMode": "Setup mode",
|
||||
"setupModeDesc": "When enabled, this version does not have a launch command, and simply runs the executable on the user's computer. Useful for games that only distribute installer and not portable files.",
|
||||
"setupPlaceholder": "setup.exe",
|
||||
"umuLauncherId": "UMU Launcher ID",
|
||||
"umuOverride": "Override UMU Launcher Game ID",
|
||||
"umuOverrideDesc": "By default, Drop uses a non-ID when launching with UMU Launcher. In order to get the right patches for some games, you may have to manually set this field.",
|
||||
"updateMode": "Update mode",
|
||||
"updateModeDesc": "When enabled, these files will be installed on top of (overwriting) the previous version's. If multiple \"update modes\" are chained together, they are applied in order.",
|
||||
"version": "Select version to import"
|
||||
},
|
||||
"withoutMetadata": "Import without metadata"
|
||||
},
|
||||
"metadataProvider": "Metadata provider",
|
||||
"noGames": "No games imported",
|
||||
"noVersions": "You have no versions of this game available.",
|
||||
"noVersionsAdded": "no versions added",
|
||||
"openInMetadata": "Open in Metadata",
|
||||
"openLibrary": "Open with Library {arrow}",
|
||||
"openMetadata": "Open with Metadata {arrow}",
|
||||
"openStore": "Open in Store",
|
||||
"shortDesc": "Short Description",
|
||||
"sources": {
|
||||
"create": "Create source",
|
||||
"createDesc": "Drop will use this source to access your game library, and make them available.",
|
||||
"desc": "Configure your library sources, where Drop will look for new games and versions to import.",
|
||||
"fsDesc": "Imports games from a path on disk. Requires version-based folder structure, and supports archived games.",
|
||||
"fsPath": "Path",
|
||||
"fsPathDesc": "An absolute path to your game library.",
|
||||
"fsPathPlaceholder": "/mnt/games",
|
||||
"link": "Sources {arrow}",
|
||||
"nameDesc": "The name of your source, for reference.",
|
||||
"namePlaceholder": "My New Source",
|
||||
"sources": "Library Sources",
|
||||
"typeDesc": "The type of your source. Changes the required options.",
|
||||
"working": "Working?"
|
||||
},
|
||||
"subheader": "As you add folders to your library sources, Drop will detect it and prompt you to import it. Each game needs to be imported before you can import a version.",
|
||||
"title": "Libraries",
|
||||
"versionPriority": "Version priority"
|
||||
},
|
||||
"back": "Back to Library",
|
||||
"collection": {
|
||||
"addToNew": "Add to new collection",
|
||||
"collections": "Collections",
|
||||
"create": "Create Collection",
|
||||
"createDesc": "Collections can used to organise your games and find them more easily, especially if you have a large library.",
|
||||
"delete": "Delete Collection",
|
||||
"namePlaceholder": "Collection name",
|
||||
"noCollections": "No collections",
|
||||
"notFound": "Collection not found",
|
||||
"subheader": "Add a new collection to organize your games",
|
||||
"title": "Collection"
|
||||
},
|
||||
"gameCount": "{0} games | {0} game | {0} games",
|
||||
"inLib": "In Library",
|
||||
"launcherOpen": "Open in Launcher",
|
||||
"noGames": "No games in library",
|
||||
"notFound": "Game not found",
|
||||
"search": "Search library...",
|
||||
"subheader": "Organize your games into collections for easy access, and access all your games."
|
||||
},
|
||||
"lowest": "lowest",
|
||||
"name": "Name",
|
||||
"news": {
|
||||
"article": {
|
||||
"add": "Add",
|
||||
"content": "Content (Markdown)",
|
||||
"create": "Create New Article",
|
||||
"editor": "Editor",
|
||||
"editorGuide": "Use the shortcuts above or write Markdown directly. Supports **bold**, *italic*, [links](url), and more.",
|
||||
"new": "New article",
|
||||
"preview": "Preview",
|
||||
"shortDesc": "Short description",
|
||||
"submit": "Submit",
|
||||
"tagPlaceholder": "Add a tag...",
|
||||
"titles": "Title",
|
||||
"uploadCover": "Upload cover image"
|
||||
},
|
||||
"back": "Back to News",
|
||||
"checkLater": "Check back later for updates.",
|
||||
"delete": "Delete Article",
|
||||
"filter": {
|
||||
"all": "All time",
|
||||
"month": "This month",
|
||||
"week": "This week",
|
||||
"year": "This year"
|
||||
},
|
||||
"none": "No articles",
|
||||
"notFound": "Article not found",
|
||||
"search": "Search articles",
|
||||
"searchPlaceholder": "Search articles...",
|
||||
"subheader": "Stay up to date with the latest updates and announcements.",
|
||||
"title": "Latest News"
|
||||
},
|
||||
"options": "Options",
|
||||
"save": "Save",
|
||||
"security": "Security",
|
||||
"settings": "Settings",
|
||||
"store": {
|
||||
"commingSoon": "coming soon",
|
||||
"exploreMore": "Explore more {arrow}",
|
||||
"images": "Game Images",
|
||||
"lookAt": "Check it out",
|
||||
"noGame": "no game",
|
||||
"noImages": "No images",
|
||||
"openAdminDashboard": "Open in Admin Dashboard",
|
||||
"platform": "Platform | Platform | Platforms",
|
||||
"rating": "Rating",
|
||||
"readLess": "Click to read less",
|
||||
"readMore": "Click to read more",
|
||||
"recentlyAdded": "Recently Added",
|
||||
"recentlyReleased": "Recently released",
|
||||
"recentlyUpdated": "Recently Updated",
|
||||
"released": "Released",
|
||||
"reviews": "({0} Reviews)",
|
||||
"title": "Store",
|
||||
"view": "View in Store"
|
||||
},
|
||||
"type": "Type",
|
||||
"upload": "Upload",
|
||||
"uploadFile": "Upload file",
|
||||
"userHeader": {
|
||||
"closeSidebar": "Close sidebar",
|
||||
"links": {
|
||||
"community": "Community",
|
||||
"library": "Library",
|
||||
"news": "News"
|
||||
},
|
||||
"profile": {
|
||||
"admin": "Admin Dashboard",
|
||||
"settings": "Account settings"
|
||||
}
|
||||
},
|
||||
"welcome": "American, Welcome!"
|
||||
}
|
||||
Reference in New Issue
Block a user