2.0.0 beta 8

- added Italian
- added `Locales.supported()` and `Locales.fallback()` methods
  now launcher can have locales unsupported by the game

From previous commits:
- fixed shaders work
- made `Tray` class to manage tray features
- added tray icon
- added `folders` field in config file
  and now you can specify some pathes
- added `constants.paths.tempDir` field
- Discord RPC icons were moved to `src/assets/images/discord` folder
  and highly optimized
- added templates for `fr-fr`, `es-es` and `vi-vn` translations
- added Discord RPC icons selection
- added windows centering;
  also added `Window.current.center()` method
- added custom shaders option in settings menu
- fixed `applied` patch info field caching
- decreased splash screen timings
This commit is contained in:
Observer KRypt0n_ 2022-01-06 22:39:29 +02:00
parent 9c85cef91c
commit b22dd2aa44
No known key found for this signature in database
GPG key ID: DC5D4EC1303465DA
14 changed files with 160 additions and 10 deletions

View file

@ -1,6 +1,6 @@
{
"applicationId": "com.krypt0nn.an-anime-game-launcher",
"version": "2.0.0-beta-7",
"version": "2.0.0-beta-8",
"defaultMode": "window",
"port": 0,
"documentRoot": "/bundle/",

View file

@ -1,6 +1,6 @@
{
"name": "an-anime-game-launcher",
"version": "2.0.0-beta-7",
"version": "2.0.0-beta-8",
"license": "GPL-3.0",
"type": "module",
"scripts": {

View file

@ -27,6 +27,7 @@ settings:
de-de: Deutsch
fr-fr: Français
es-es: Español
it-it: Italiano
vi-vn: Tiếng Việt
# Spiel sprachpaket auswahl

View file

@ -27,6 +27,7 @@ settings:
de-de: Deutsch
fr-fr: Français
es-es: Español
it-it: Italiano
vi-vn: Tiếng Việt
# Game voice pack language

View file

@ -27,6 +27,7 @@ settings:
de-de: Deutsch
fr-fr: Français
es-es: Español
it-it: Italiano
vi-vn: Tiếng Việt
# Game voice pack language

View file

@ -27,6 +27,7 @@ settings:
de-de: Deutsch
fr-fr: Français
es-es: Español
it-it: Italiano
vi-vn: Tiếng Việt
# Game voice pack language
@ -117,4 +118,4 @@ settings:
ou désactiver les effets visuels
items:
none: None
custom: Custom
custom: Custom

113
public/locales/it-it.yaml Normal file
View file

@ -0,0 +1,113 @@
# Splash window
splash:
title: Caricando il launcher
phrases:
- Facendo attività molto importanti...
- Bullizzando Paimon...
- Pullando per Yae...
# Launcher window
launcher:
predownload: Pre-scarica l'aggiornamento
# Settings window
settings:
# General
general:
title: Generale
items:
# Language selection
lang:
# Launcher language
launcher:
title: Launcher
items:
en-us: English (US)
ru-ru: Русский
de-de: Deutsch
fr-fr: Français
es-es: Español
it-it: Italiano
vi-vn: Tiếng Việt
# Game voice pack language
voice:
title: Doppiaggio
tooltip: Dovrai manualmente configurare il voice pack in gioco
items:
en-us: Inglese (US)
ja-jp: Giapponese
ko-kr: Coreano
zn-cn: Cinese
# Launcher theme
theme:
title: Tema
items:
system: Sistema
light: Chiaro
dark: Scuro
# Discord RPC
discord:
title: Integrazione Discord
settings:
title: Impostazioni di integrazione con Discord
items:
timer: Mostra il tempo di gioco
in-launcher: Testo nel launcher
in-game: Testo in gioco
# Enhancements
enhancements:
title: Miglioramenti
items:
# HUD
hud:
title: Interfaccia
items:
none: None
dxvk: DXVK
mangohud: MangoHUD
# GameMode
gamemode:
title: Usa GameMode
tooltip: È un software che può migliorare le prestazioni in gioco
# Unlock FPS
fps_unlocker:
title: Sblocca gli FPS
tooltip: Questa opzione rimuoverà la limitazione di 60 FPS in gioco
# Delete DXVK logs
purge_dxvk_logs:
title: Cancella i log DXVK
tooltip: Con questa opzione attiva, il launcher cancellerà automaticamente i file di log DXVK
# Runners
runners:
title: Versione di Wine
items:
recommended:
title: Mostra solo le consigliate
tooltip: Questa opzione nasconderà le versioni di Wine non giocabili
# DXVKs
dxvks:
title: DXVK
items:
recommended:
title: Mostra solo le consigliate
tooltip: Questa opzione nasconderà le vecchie versioni di DXVK
# Shaders
shaders:
title: Shaders
items:
shaders:
title: Shaders
tooltip: Usa il bottone Home per attivare/disattivare le shaders in gioco
items:
none: None
custom: Custom

View file

@ -27,6 +27,7 @@ settings:
de-de: Deutsch
fr-fr: Français
es-es: Español
it-it: Italiano
vi-vn: Tiếng Việt
# Язык озвучки в игре

View file

@ -27,6 +27,7 @@ settings:
de-de: Deutsch
fr-fr: Français
es-es: Español
it-it: Italiano
vi-vn: Tiếng Việt
# Game voice pack language

View file

@ -39,7 +39,7 @@ const bundler = new Bundler({
output: path.join(__dirname, '../dist/An Anime Game Launcher.AppImage'),
// Application version
version: '2.0.0-beta-7'
version: '2.0.0-beta-8'
});
// Bundle project

View file

@ -7,6 +7,7 @@ register('ru-ru', () => Locales.get('ru-ru'));
register('de-de', () => Locales.get('de-de'));
register('fr-fr', () => Locales.get('fr-fr'));
register('es-es', () => Locales.get('es-es'));
register('it-it', () => Locales.get('it-it'));
register('vi-vn', () => Locales.get('vi-vn'));
Locales.default().then((locale) => {

View file

@ -7,6 +7,7 @@ import Configs from './Configs';
import Debug from './core/Debug';
import IPC from './core/IPC';
import DiscordRPC from './core/DiscordRPC';
import Locales from './core/Locales';
import ProgressBar from './launcher/ProgressBar';
import State from './launcher/State';
@ -22,7 +23,7 @@ export default class Launcher
public constructor(onMount)
{
this.tray = new Tray('/public/icons/256x256.png');
this.tray = new Tray(`/public/icons/256x256.png`);
this.tray.update();
this.updateDiscordRPC('in-launcher');
@ -90,7 +91,7 @@ export default class Launcher
public getSocial(): Promise<string>
{
return new Promise(async (resolve) => {
resolve(`https://${constants.placeholders.lowercase.first}.${constants.placeholders.lowercase.company}.com/launcher/10/${await Configs.get('lang.launcher')}?api_url=https%3A%2F%2Fapi-os-takumi.${constants.placeholders.lowercase.company}.com%2Fhk4e_global&key=gcStgarh&prev=false`);
resolve(`https://${constants.placeholders.lowercase.first}.${constants.placeholders.lowercase.company}.com/launcher/10/${Locales.fallback((await Locales.default()) ?? 'en-us')}?api_url=https%3A%2F%2Fapi-os-takumi.${constants.placeholders.lowercase.company}.com%2Fhk4e_global&key=gcStgarh&prev=false`);
});
}

View file

@ -10,21 +10,30 @@ type AvailableLocales =
| 'de-de'
| 'fr-fr'
| 'es-es'
| 'it-it'
| 'vi-vn';
declare const Neutralino;
export default class Locales
{
/**
* List of locales supported by the game's API
*/
public static readonly supportedLocales: AvailableLocales[] = [
'en-us', 'ru-ru', 'de-de',
'fr-fr', 'es-es', 'vi-vn'
];
/**
* Get or update the default locale
*/
public static default(lang: AvailableLocales|null = null): Promise<string>
public static default(lang: AvailableLocales|null = null): Promise<AvailableLocales>
{
if (lang !== null)
Configs.set('lang.launcher', lang);
return Configs.get('lang.launcher') as Promise<string>;
return Configs.get('lang.launcher') as Promise<AvailableLocales>;
}
/**
@ -70,4 +79,24 @@ export default class Locales
.then((locale) => resolve(YAML.parse(locale)));
});
}
/**
* Checks if the specified language supported
* by the game's API
*/
public static supported(lang: AvailableLocales): boolean
{
return this.supportedLocales.includes(lang);
}
/**
* Returns provided language if it is supported
* by the game's API. Otherwise returns fallback language (en-us by default)
*/
public static fallback(lang: AvailableLocales, fallback: AvailableLocales = 'en-us'): AvailableLocales
{
return this.supported(lang) ? lang : fallback;
}
};
export type { AvailableLocales };

View file

@ -1,6 +1,6 @@
import constants from '../Constants';
import Configs from '../Configs';
import fetch from '../core/Fetch';
import Locales from '../core/Locales';
export default class Background
{
@ -10,7 +10,7 @@ export default class Background
public static get(): Promise<string>
{
return new Promise(async (resolve) => {
fetch(constants.backgroundUri + await Configs.get('lang.launcher'))
fetch(constants.backgroundUri + Locales.fallback((await Locales.default()) ?? 'en-us'))
.then((header) => header.body().then((body) => {
resolve(JSON.parse(body).data.adv.background);
}));