style: ➖ remove l10n
This commit is contained in:
parent
c9e2e5b25d
commit
68b7a0fbcb
14
.l10nignore
14
.l10nignore
@ -1,14 +0,0 @@
|
|||||||
.idea/
|
|
||||||
*.iml
|
|
||||||
|
|
||||||
vendor/
|
|
||||||
vendor-bin/*/vendor/
|
|
||||||
|
|
||||||
.php-cs-fixer.cache
|
|
||||||
tests/.phpunit.cache
|
|
||||||
|
|
||||||
node_modules/
|
|
||||||
js/
|
|
||||||
css/
|
|
||||||
|
|
||||||
build/
|
|
@ -22,7 +22,6 @@ $config = new MyConfig();
|
|||||||
$config
|
$config
|
||||||
->getFinder()
|
->getFinder()
|
||||||
->notPath('build')
|
->notPath('build')
|
||||||
->notPath('l10n')
|
|
||||||
->notPath('node_modules')
|
->notPath('node_modules')
|
||||||
->notPath('src')
|
->notPath('src')
|
||||||
->notPath('vendor')
|
->notPath('vendor')
|
||||||
|
15
Makefile
15
Makefile
@ -106,7 +106,6 @@ appstore:
|
|||||||
--exclude="$(app_name)/.*" \
|
--exclude="$(app_name)/.*" \
|
||||||
--exclude="$(app_name)/js/.*" \
|
--exclude="$(app_name)/js/.*" \
|
||||||
--exclude="$(app_name)/tsconfig.json" \
|
--exclude="$(app_name)/tsconfig.json" \
|
||||||
--exclude="$(app_name)/stylelint.config.cjs" \
|
|
||||||
--exclude="$(app_name)/README.md" \
|
--exclude="$(app_name)/README.md" \
|
||||||
--exclude="$(app_name)/package-lock.json" \
|
--exclude="$(app_name)/package-lock.json" \
|
||||||
--exclude="$(app_name)/LICENSE" \
|
--exclude="$(app_name)/LICENSE" \
|
||||||
@ -129,17 +128,3 @@ dev: build
|
|||||||
docker build -t $(app_name) .
|
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)
|
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)
|
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
2
package-lock.json
generated
@ -10,8 +10,6 @@
|
|||||||
"@emulatorjs/emulatorjs": "^4.2.1",
|
"@emulatorjs/emulatorjs": "^4.2.1",
|
||||||
"@nextcloud/auth": "^2.4.0",
|
"@nextcloud/auth": "^2.4.0",
|
||||||
"@nextcloud/files": "^3.10.1",
|
"@nextcloud/files": "^3.10.1",
|
||||||
"@nextcloud/initial-state": "^2.2.0",
|
|
||||||
"@nextcloud/l10n": "^3.1.0",
|
|
||||||
"@nextcloud/router": "^3.0.1",
|
"@nextcloud/router": "^3.0.1",
|
||||||
"@nextcloud/vite-config": "^2.2.2",
|
"@nextcloud/vite-config": "^2.2.2",
|
||||||
"vite": "~5.4.11"
|
"vite": "~5.4.11"
|
||||||
|
@ -20,8 +20,6 @@
|
|||||||
"@emulatorjs/emulatorjs": "^4.2.1",
|
"@emulatorjs/emulatorjs": "^4.2.1",
|
||||||
"@nextcloud/auth": "^2.4.0",
|
"@nextcloud/auth": "^2.4.0",
|
||||||
"@nextcloud/files": "^3.10.1",
|
"@nextcloud/files": "^3.10.1",
|
||||||
"@nextcloud/initial-state": "^2.2.0",
|
|
||||||
"@nextcloud/l10n": "^3.1.0",
|
|
||||||
"@nextcloud/router": "^3.0.1",
|
"@nextcloud/router": "^3.0.1",
|
||||||
"@nextcloud/vite-config": "^2.2.2",
|
"@nextcloud/vite-config": "^2.2.2",
|
||||||
"vite": "~5.4.11"
|
"vite": "~5.4.11"
|
||||||
|
42
src/common.ts
Normal file
42
src/common.ts
Normal 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,
|
||||||
|
}
|
@ -9,7 +9,7 @@ import {
|
|||||||
import cores from './mime.json'
|
import cores from './mime.json'
|
||||||
import { generateUrl } from '@nextcloud/router'
|
import { generateUrl } from '@nextcloud/router'
|
||||||
import icon from '../img/app.svg?raw'
|
import icon from '../img/app.svg?raw'
|
||||||
import { t } from '@nextcloud/l10n'
|
import { localizations } from './common'
|
||||||
|
|
||||||
const getCore = (file: Node) => {
|
const getCore = (file: Node) => {
|
||||||
if (file.type === FileType.File && file.permissions & Permission.READ) {
|
if (file.type === FileType.File && file.permissions & Permission.READ) {
|
||||||
@ -24,7 +24,7 @@ const getCore = (file: Node) => {
|
|||||||
|
|
||||||
const action = new FileAction({
|
const action = new FileAction({
|
||||||
id: 'retro',
|
id: 'retro',
|
||||||
displayName: () => t('repod', 'Play'),
|
displayName: () => localizations[document.documentElement.lang].Play || 'Play',
|
||||||
iconSvgInline: () => icon,
|
iconSvgInline: () => icon,
|
||||||
enabled: (files: Node[]) => {
|
enabled: (files: Node[]) => {
|
||||||
if (files.length !== 1) return false
|
if (files.length !== 1) return false
|
||||||
|
51
src/main.ts
51
src/main.ts
@ -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/socket.io.min.js'
|
||||||
import '@emulatorjs/emulatorjs/data/src/compression.js'
|
import '@emulatorjs/emulatorjs/data/src/compression.js'
|
||||||
import '@emulatorjs/emulatorjs/data/emulator.css'
|
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 { getRequestToken } from '@nextcloud/auth'
|
||||||
import hi from '@emulatorjs/emulatorjs/data/localization/hi-HI.json'
|
import { localizations } from './common'
|
||||||
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,
|
|
||||||
}
|
|
||||||
|
|
||||||
type Config = {
|
type Config = {
|
||||||
gameUrl?: string
|
gameUrl?: string
|
||||||
@ -176,11 +134,6 @@ class MyEmulatorJS extends window.EmulatorJS {
|
|||||||
|
|
||||||
const config: Config = {}
|
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')
|
const gameUrl = new URL(location.href).searchParams.get('file')
|
||||||
if (gameUrl) {
|
if (gameUrl) {
|
||||||
config.gameUrl = gameUrl
|
config.gameUrl = gameUrl
|
||||||
@ -192,6 +145,8 @@ if (system) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
config.dataPath = 'https://cdn.emulatorjs.org/stable/data/'
|
config.dataPath = 'https://cdn.emulatorjs.org/stable/data/'
|
||||||
|
config.language = document.documentElement.lang
|
||||||
|
config.langJson = localizations[config.language]
|
||||||
config.threads = !!window.SharedArrayBuffer
|
config.threads = !!window.SharedArrayBuffer
|
||||||
|
|
||||||
// eslint-disable-next-line no-new
|
// eslint-disable-next-line no-new
|
||||||
|
Loading…
x
Reference in New Issue
Block a user