Latest decky changed merged into i18n and updated translation.

This commit is contained in:
Marco Rodolfi
2023-01-23 13:22:34 +01:00
parent 59409eb59f
commit 0f0b47beed
73 changed files with 695 additions and 73012 deletions
@@ -1,6 +1,9 @@
import { ConfirmModal, Navigation, QuickAccessTab } from 'decky-frontend-lib';
import { FC, useState } from 'react';
import { useTranslation } from 'react-i18next';
const { t } = useTranslation('PluginInstallModal');
interface PluginInstallModalProps {
artifact: string;
version: string;
@@ -26,13 +29,13 @@ const PluginInstallModal: FC<PluginInstallModalProps> = ({ artifact, version, ha
onCancel={async () => {
await onCancel();
}}
strTitle={`Install ${artifact}`}
strOKButtonText={loading ? 'Installing' : 'Install'}
strTitle={t("install_title", artifact)}
strOKButtonText={loading ? t("install_button_processing") : t("install_button_idle")}
>
{hash == 'False' ? (
<h3 style={{ color: 'red' }}>!!!!NO HASH PROVIDED!!!!</h3>
) : (
`Are you sure you want to install ${artifact} ${version}?`
t("install_desc", artifact, version)
)}
</ConfirmModal>
);
+4 -4
View File
@@ -100,7 +100,7 @@ const PluginCard: FC<PluginCardProps> = ({ plugin }) => {
plugin.description
) : (
<span>
<i style={{ color: '#666' }}>No description provided.</i>
<i style={{ color: '#666' }}>{t("plugin_no_desc")}</i>
</span>
)}
</span>
@@ -112,7 +112,7 @@ const PluginCard: FC<PluginCardProps> = ({ plugin }) => {
color: '#fee75c',
}}
>
<i>This plugin has full access to your Steam Deck.</i>{' '}
<i>{t("plugin_full_access")}</i>{' '}
<a
className="deckyStoreCardDescriptionRootLink"
href="https://deckbrew.xyz/root"
@@ -149,7 +149,7 @@ const PluginCard: FC<PluginCardProps> = ({ plugin }) => {
layout="below"
onClick={() => requestPluginInstall(plugin.name, plugin.versions[selectedOption])}
>
<span className="deckyStoreCardInstallText">Install</span>
<span className="deckyStoreCardInstallText">{t("plugin_install")}</span>
</ButtonItem>
</div>
<div
@@ -166,7 +166,7 @@ const PluginCard: FC<PluginCardProps> = ({ plugin }) => {
label: version.name,
})) as SingleDropdownOption[]
}
menuLabel="Plugin Version"
menuLabel={t("plugin_version_label") as string}
selectedOption={selectedOption}
onChange={({ data }) => setSelectedOption(data)}
/>
+23 -21
View File
@@ -10,6 +10,9 @@ import {
} from 'decky-frontend-lib';
import { FC, useEffect, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
const { t } = useTranslation('Store');
import logo from '../../../assets/plugin_store.png';
import Logger from '../../logger';
import { StorePlugin, getPluginList } from '../../store';
@@ -54,13 +57,13 @@ const StorePage: FC<{}> = () => {
}}
tabs={[
{
title: 'Browse',
title: t("store_tabs_title"),
content: <BrowseTab children={{ data: data }} />,
id: 'browse',
renderTabAddon: () => <span className={TabCount}>{data.length}</span>,
},
{
title: 'About',
title: t("store_tabs_about"),
content: <AboutTab />,
id: 'about',
},
@@ -75,8 +78,8 @@ const StorePage: FC<{}> = () => {
const BrowseTab: FC<{ children: { data: StorePlugin[] } }> = (data) => {
const sortOptions = useMemo(
(): DropdownOption[] => [
{ data: 1, label: 'Alphabetical (A to Z)' },
{ data: 2, label: 'Alphabetical (Z to A)' },
{ data: 1, label: t("store_tabs_alph_desc") },
{ data: 2, label: t("store_tabs_alph_asce") },
],
[],
);
@@ -105,11 +108,11 @@ const BrowseTab: FC<{ children: { data: StorePlugin[] } }> = (data) => {
width: '47.5%',
}}
>
<span className="DialogLabel">Sort</span>
<span className="DialogLabel">{t("store_sort_label")}</span>
<Dropdown
menuLabel="Sort"
menuLabel={t("store_sort_label") as string}
rgOptions={sortOptions}
strDefaultLabel="Last Updated (Newest)"
strDefaultLabel={t("store_sort_label_def") as string}
selectedOption={selectedSort}
onChange={(e) => setSort(e.data)}
/>
@@ -122,11 +125,11 @@ const BrowseTab: FC<{ children: { data: StorePlugin[] } }> = (data) => {
marginLeft: 'auto',
}}
>
<span className="DialogLabel">Filter</span>
<span className="DialogLabel">{t("store_filter_label")}</span>
<Dropdown
menuLabel="Filter"
menuLabel={t("store_filter_label")}
rgOptions={filterOptions}
strDefaultLabel="All"
strDefaultLabel={t("store_fiter_label_def")}
selectedOption={selectedFilter}
onChange={(e) => setFilter(e.data)}
/>
@@ -136,7 +139,7 @@ const BrowseTab: FC<{ children: { data: StorePlugin[] } }> = (data) => {
<div style={{ justifyContent: 'center', display: 'flex' }}>
<Focusable style={{ display: 'flex', alignItems: 'center', width: '96%' }}>
<div style={{ width: '100%' }}>
<TextField label="Search" value={searchFieldValue} onChange={(e) => setSearchValue(e.target.value)} />
<TextField label={t("store_search_label")} value={searchFieldValue} onChange={(e) => setSearchValue(e.target.value)} />
</div>
</Focusable>
</div>
@@ -151,11 +154,11 @@ const BrowseTab: FC<{ children: { data: StorePlugin[] } }> = (data) => {
maxWidth: '100%',
}}
>
<span className="DialogLabel">Sort</span>
<span className="DialogLabel">{t("store_sort_label")}</span>
<Dropdown
menuLabel="Sort"
menuLabel={t("store_sort_label") as string}
rgOptions={sortOptions}
strDefaultLabel="Last Updated (Newest)"
strDefaultLabel={t("store_sort_label_def") as string}
selectedOption={selectedSort}
onChange={(e) => setSort(e.data)}
/>
@@ -165,7 +168,7 @@ const BrowseTab: FC<{ children: { data: StorePlugin[] } }> = (data) => {
<div style={{ justifyContent: 'center', display: 'flex' }}>
<Focusable style={{ display: 'flex', alignItems: 'center', width: '96%' }}>
<div style={{ width: '100%' }}>
<TextField label="Search" value={searchFieldValue} onChange={(e) => setSearchValue(e.target.value)} />
<TextField label={t("store_search_label")} value={searchFieldValue} onChange={(e) => setSearchValue(e.target.value)} />
</div>
</Focusable>
</div>
@@ -216,7 +219,7 @@ const AboutTab: FC<{}> = () => {
/>
<span className="deckyStoreAboutHeader">Testing</span>
<span>
Please consider testing new plugins to help the Decky Loader team!{' '}
{t("store_testing_cta")}{' '}
<a
href="https://deckbrew.xyz/testing"
target="_blank"
@@ -227,13 +230,12 @@ const AboutTab: FC<{}> = () => {
deckbrew.xyz/testing
</a>
</span>
<span className="deckyStoreAboutHeader">Contributing</span>
<span className="deckyStoreAboutHeader">{t("store_contrib_label")}</span>
<span>
If you would like to contribute to the Decky Plugin Store, check the SteamDeckHomebrew/decky-plugin-template
repository on GitHub. Information on development and distribution is available in the README.
{t("store_contrib_desc")}
</span>
<span className="deckyStoreAboutHeader">Source Code</span>
<span>All plugin source code is available on SteamDeckHomebrew/decky-plugin-database repository on GitHub.</span>
<span className="deckyStoreAboutHeader">{t("store_source_label")}</span>
<span>{t("store_source_desc")}</span>
</div>
);
};
+2 -16
View File
@@ -1,26 +1,12 @@
import i18next from 'i18next';
import Backend from 'i18next-fs-backend';
import Backend from 'i18next-http-backend';
import { initReactI18next } from 'react-i18next';
i18next
.use(initReactI18next)
.use(Backend)
.use(initReactI18next)
.init({
debug: true,
backend: {
// path where resources get loaded from, or a function
// returning a path:
// function(lngs, namespaces) { return customPath; }
// the returned path will interpolate lng, ns if provided like giving a static path
loadPath: '/home/deck/homebrew/locales/{{lng}}/{{ns}}.json',
// path to post missing resources
// addPath: '/locales/{{lng}}/{{ns}}.missing.json',
// if you use i18next-fs-backend as caching layer in combination with i18next-chained-backend, you can optionally set an expiration time
// an example on how to use it as cache layer can be found here: https://github.com/i18next/i18next-fs-backend/blob/master/example/caching/app.js
// expirationTime: 60 * 60 * 1000
},
fallbackLng: 'en',
fallbackNS: 'Common',
lng: 'en',
@@ -1,3 +0,0 @@
{
"update_channel_label": "Update Channel"
}
-4
View File
@@ -1,4 +0,0 @@
{
"reload": "Reload",
"uninstall": "Uninstall"
}
@@ -1,7 +0,0 @@
{
"valve_internal_label": "Enable Valve Internal",
"valve_internal_desc1": "Enables the Valve internal developer menu.",
"valve_internal_desc2": "Do not touch anything in this menu unless you know what it does.",
"react_devtools_label": "Enable React DevTools",
"react_devtools_desc": "Enables connection to a computer running React DevTools. Changing this setting will reload Steam. Set the IP address before enabling."
}
-3
View File
@@ -1,3 +0,0 @@
{
"select_version": "Select a version"
}
@@ -1,5 +0,0 @@
{
"list_no_plugin": "No plugins installed!",
"list_update_to": "Update to {{name}}",
"list_plug_actions_label": "Plugin Actions"
}
@@ -1,4 +0,0 @@
{
"remote_cef_label": "Allow Remote CEF Debugging",
"remote_cef_desc": "Allow unauthenticated access to the CEF debugger to anyone in your network"
}
@@ -1,6 +0,0 @@
{
"developer_mode_label": "Developer mode",
"developer_mode_desc": "Enables Decky's developer settings.",
"manual_plugin_label": "Manual plugin install",
"manual_plugin_install_button": "Install"
}
@@ -1,6 +0,0 @@
{
"general_title": "General",
"plugins_title": "Plugins",
"developer_title": "Developer",
"navbar_settings": "Decky Settings"
}
-4
View File
@@ -1,4 +0,0 @@
{
"store_channel_label": "Store Channel",
"custom_store_label": "Custom Store"
}
-14
View File
@@ -1,14 +0,0 @@
{
"no_patch_notes_desc": "no patch notes for this version",
"decky_updates": "Decky Updates",
"updates_label": "Updates",
"updates_cur_version": "Current version: {{ver}}",
"updates_lat_version": "Latest version: {{ver}}",
"updates_checking": "'Checking",
"updates_check_button": "Check For Updates",
"updates_install_button": "Install Update",
"updates_reloading": "Reloading",
"updates_updating": "Updating"
}
@@ -1,13 +0,0 @@
{
"enabling": "Enabling",
"disabling": "Disabling",
"decky_update_available": "Update to {{tag_name}} available!",
"plugin_update_one": "Updates available for 1 plugin!",
"plugin_update_other": "Updates available for {{number}} plugins!",
"plugin_uninstall": "Uninstall {{name}}?",
"plugin_load_error": "Error loading plugin {{name}}",
"plugin_load_error_toast": "Error loading {{name}}",
"error": "Error",
"plugin_error_uninstall": "Please go to {{-icon}} in the Decky menu if you need to uninstall this plugin.",
"file_picker_cancel_text": "User canceled"
}
@@ -1,3 +0,0 @@
{
"update_channel_label": "Canale di aggiornamento"
}
-4
View File
@@ -1,4 +0,0 @@
{
"reload": "Ricarica",
"uninstall": "Rimuovi"
}
@@ -1,7 +0,0 @@
{
"valve_internal_label": "Abilita Menu Sviluppatore",
"valve_internal_desc1": "Abilita il menu interno di sviluppo di Valve.",
"valve_internal_desc2": "Non toccare nulla in questo menu se non sai quello che fa.",
"react_devtools_label": "Abilita i DevTools di React",
"react_devtools_desc": "Abilita la connessione ad un computer che esegue i DevTools di React. Cambiando questa impostazione ricaricherà Steam. Imposta l'indirizzo IP prima di abilitarlo."
}
-3
View File
@@ -1,3 +0,0 @@
{
"select_version": "Seleziona una versione"
}
@@ -1,5 +0,0 @@
{
"list_no_plugin": "Nessun plugin installato!",
"list_update_to": "Aggiornamento a {{name}}",
"list_plug_actions_label": "Operazioni sui plugins"
}
@@ -1,4 +0,0 @@
{
"remote_cef_label": "Permetti il debug remoto di CEF",
"remote_cef_desc": "Permetti l'accesso non autenticato a chiunque sulla tua rete locale al debugger di CEF."
}
@@ -1,6 +0,0 @@
{
"developer_mode_label": "Modalità sviluppatore",
"developer_mode_desc": "Abilità le impostazioni di sviluppo di Decky.",
"manual_plugin_label": "Installazione manuale plugins",
"manual_plugin_install_button": "Installa"
}
@@ -1,6 +0,0 @@
{
"general_title": "Generali",
"plugins_title": "Plugins",
"developer_title": "Sviluppatore",
"navbar_settings": "Impostazioni Decky"
}
-4
View File
@@ -1,4 +0,0 @@
{
"store_channel_label": "Canale del negozio",
"custom_store_label": "Negozio custom"
}
-14
View File
@@ -1,14 +0,0 @@
{
"no_patch_notes_desc": "nessuna patch notes per questa versione",
"decky_updates": "Aggiornamenti di Decky",
"updates_label": "Aggiornamenti",
"updates_cur_version": "Versione attuale: {{ver}}",
"updates_lat_version": "Ultima versione: {{ver}}",
"updates_checking": "Controllando",
"updates_check_button": "Cerca aggiornamenti",
"updates_install_button": "Installa aggiornamento",
"updates_reloading": "Ricaricando",
"updates_updating": "Aggiornando"
}
@@ -1,13 +0,0 @@
{
"enabling": "Abilitando",
"disabling": "Disabilitando",
"decky_update_available": "Disponibile aggiornamento a {{tag_name}}!",
"plugin_update_one": "Aggiornamento disponibile per un plugin!",
"plugin_update_other": "Aggiornamento disponibile per {{number}} plugins!",
"plugin_uninstall": "Rimuovo {{name}}?",
"plugin_load_error": "Errore caricando il plugin {{name}}",
"plugin_load_error_toast": "Errore caricando {{name}}",
"error": "Errore",
"plugin_error_uninstall": "Per rimuovere questo plugin vai su {{-icon}} nel menu di Decky.",
"file_picker_cancel_text": "Annullato dall'utente"
}
+1 -1
View File
@@ -344,7 +344,7 @@ class PluginLoader extends Logger {
fetchNoCors(url: string, request: any = {}) {
let args = { method: 'POST', headers: {} };
const req = { ...args, ...request, url, data: request.body };
req?.body && delete req.body
req?.body && delete req.body;
return this.callServerMethod('http_request', req);
},
executeInTab(tab: string, runAsync: boolean, code: string) {