style: remove l10n
All checks were successful
retro / xml (push) Successful in 21s
retro / php (push) Successful in 58s
retro / nodejs (push) Successful in 1m3s
retro / release (push) Has been skipped

This commit is contained in:
Michel Roux 2025-01-08 17:52:07 +01:00
parent c9e2e5b25d
commit 68b7a0fbcb
8 changed files with 47 additions and 84 deletions

View File

@ -1,14 +0,0 @@
.idea/
*.iml
vendor/
vendor-bin/*/vendor/
.php-cs-fixer.cache
tests/.phpunit.cache
node_modules/
js/
css/
build/

View File

@ -22,7 +22,6 @@ $config = new MyConfig();
$config
->getFinder()
->notPath('build')
->notPath('l10n')
->notPath('node_modules')
->notPath('src')
->notPath('vendor')

View File

@ -106,7 +106,6 @@ appstore:
--exclude="$(app_name)/.*" \
--exclude="$(app_name)/js/.*" \
--exclude="$(app_name)/tsconfig.json" \
--exclude="$(app_name)/stylelint.config.cjs" \
--exclude="$(app_name)/README.md" \
--exclude="$(app_name)/package-lock.json" \
--exclude="$(app_name)/LICENSE" \
@ -129,17 +128,3 @@ dev: build
docker build -t $(app_name) .
docker run -itd --rm --name $(app_name) -v $(CURDIR):/var/www/html/apps/$(app_name) -p 80:80 $(app_name)
npm run watch || docker stop $(app_name)
# Generate translations
.PHONY: l10n
l10n:
docker run --rm \
-v $(CURDIR):/app \
--entrypoint php \
nextcloudci/translations \
/translationtool.phar create-pot-files
docker run --rm \
-v $(CURDIR):/app \
--entrypoint php \
nextcloudci/translations \
/translationtool.phar convert-po-files

2
package-lock.json generated
View File

@ -10,8 +10,6 @@
"@emulatorjs/emulatorjs": "^4.2.1",
"@nextcloud/auth": "^2.4.0",
"@nextcloud/files": "^3.10.1",
"@nextcloud/initial-state": "^2.2.0",
"@nextcloud/l10n": "^3.1.0",
"@nextcloud/router": "^3.0.1",
"@nextcloud/vite-config": "^2.2.2",
"vite": "~5.4.11"

View File

@ -20,8 +20,6 @@
"@emulatorjs/emulatorjs": "^4.2.1",
"@nextcloud/auth": "^2.4.0",
"@nextcloud/files": "^3.10.1",
"@nextcloud/initial-state": "^2.2.0",
"@nextcloud/l10n": "^3.1.0",
"@nextcloud/router": "^3.0.1",
"@nextcloud/vite-config": "^2.2.2",
"vite": "~5.4.11"

42
src/common.ts Normal file
View File

@ -0,0 +1,42 @@
import af from '@emulatorjs/emulatorjs/data/localization/af-FR.json'
import ar from '@emulatorjs/emulatorjs/data/localization/ar-AR.json'
import ben from '@emulatorjs/emulatorjs/data/localization/ben-BEN.json'
import de from '@emulatorjs/emulatorjs/data/localization/de-GER.json'
import el from '@emulatorjs/emulatorjs/data/localization/el-GR.json'
import es from '@emulatorjs/emulatorjs/data/localization/es-ES.json'
import fa from '@emulatorjs/emulatorjs/data/localization/fa-AF.json'
import hi from '@emulatorjs/emulatorjs/data/localization/hi-HI.json'
import it from '@emulatorjs/emulatorjs/data/localization/it-IT.json'
import ja from '@emulatorjs/emulatorjs/data/localization/ja-JA.json'
import jv from '@emulatorjs/emulatorjs/data/localization/jv-JV.json'
import ko from '@emulatorjs/emulatorjs/data/localization/ko-KO.json'
import pt from '@emulatorjs/emulatorjs/data/localization/pt-BR.json'
import ru from '@emulatorjs/emulatorjs/data/localization/ru-RU.json'
import tr from '@emulatorjs/emulatorjs/data/localization/tr-TR.json'
import vi from '@emulatorjs/emulatorjs/data/localization/vi-VN.json'
import zh from '@emulatorjs/emulatorjs/data/localization/zh-CN.json'
export const localizations = {
af,
fr: af,
ar,
ben,
de,
el,
gr: el,
es,
fa,
hi,
it,
ja,
jv,
ko,
pt,
br: pt,
ru,
tr,
vi,
vn: vi,
zh,
cn: zh,
}

View File

@ -9,7 +9,7 @@ import {
import cores from './mime.json'
import { generateUrl } from '@nextcloud/router'
import icon from '../img/app.svg?raw'
import { t } from '@nextcloud/l10n'
import { localizations } from './common'
const getCore = (file: Node) => {
if (file.type === FileType.File && file.permissions & Permission.READ) {
@ -24,7 +24,7 @@ const getCore = (file: Node) => {
const action = new FileAction({
id: 'retro',
displayName: () => t('repod', 'Play'),
displayName: () => localizations[document.documentElement.lang].Play || 'Play',
iconSvgInline: () => icon,
enabled: (files: Node[]) => {
if (files.length !== 1) return false

View File

@ -7,50 +7,8 @@ import '@emulatorjs/emulatorjs/data/src/GameManager.js'
import '@emulatorjs/emulatorjs/data/src/socket.io.min.js'
import '@emulatorjs/emulatorjs/data/src/compression.js'
import '@emulatorjs/emulatorjs/data/emulator.css'
import af from '@emulatorjs/emulatorjs/data/localization/af-FR.json'
import ar from '@emulatorjs/emulatorjs/data/localization/ar-AR.json'
import ben from '@emulatorjs/emulatorjs/data/localization/ben-BEN.json'
import de from '@emulatorjs/emulatorjs/data/localization/de-GER.json'
import el from '@emulatorjs/emulatorjs/data/localization/el-GR.json'
import es from '@emulatorjs/emulatorjs/data/localization/es-ES.json'
import fa from '@emulatorjs/emulatorjs/data/localization/fa-AF.json'
import { getRequestToken } from '@nextcloud/auth'
import hi from '@emulatorjs/emulatorjs/data/localization/hi-HI.json'
import it from '@emulatorjs/emulatorjs/data/localization/it-IT.json'
import ja from '@emulatorjs/emulatorjs/data/localization/ja-JA.json'
import jv from '@emulatorjs/emulatorjs/data/localization/jv-JV.json'
import ko from '@emulatorjs/emulatorjs/data/localization/ko-KO.json'
import pt from '@emulatorjs/emulatorjs/data/localization/pt-BR.json'
import ru from '@emulatorjs/emulatorjs/data/localization/ru-RU.json'
import tr from '@emulatorjs/emulatorjs/data/localization/tr-TR.json'
import vi from '@emulatorjs/emulatorjs/data/localization/vi-VN.json'
import zh from '@emulatorjs/emulatorjs/data/localization/zh-CN.json'
const localizations = {
af,
fr: af,
ar,
ben,
de,
el,
gr: el,
es,
fa,
hi,
it,
ja,
jv,
ko,
pt,
br: pt,
ru,
tr,
vi,
vn: vi,
zh,
cn: zh,
}
import { localizations } from './common'
type Config = {
gameUrl?: string
@ -176,11 +134,6 @@ class MyEmulatorJS extends window.EmulatorJS {
const config: Config = {}
config.language = document.documentElement.lang
if (Object.keys(localizations).includes(config.language)) {
config.langJson = localizations[config.language]
}
const gameUrl = new URL(location.href).searchParams.get('file')
if (gameUrl) {
config.gameUrl = gameUrl
@ -192,6 +145,8 @@ if (system) {
}
config.dataPath = 'https://cdn.emulatorjs.org/stable/data/'
config.language = document.documentElement.lang
config.langJson = localizations[config.language]
config.threads = !!window.SharedArrayBuffer
// eslint-disable-next-line no-new