gettext-extractor
gettext-extractor copied to clipboard
how can use for extract strings not translated into XREngine repo?
https://github.com/XRFoundation/XREngine pls give me cheatsheet for use your app commands and paths pls
I'm not sure what exactly you're looking for. I recommend you read the wiki. If you have a question or problem, provide more details and I'll try my best to help you.
i want to extract strings not translated yet of https://github.com/XRFoundation/XREngine, i follow this steps
sudo su
cd
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update && sudo apt-get install yarn
# Yarn version
yarn --version
1.22.19
git clone https://github.com/lukasgeiter/gettext-extractor.git
cd gettext-extractor/
yarn add gettext-extractor
yarn test
yarn run v1.22.19
$ jest --config jest.json
PASS tests/html/selector.test.ts
PASS tests/js/extractors/factories/callExpression.test.ts
PASS tests/builder.test.ts
PASS tests/utils/content.test.ts
PASS tests/js/extractors/comments.test.ts
PASS tests/extractor.test.ts
PASS tests/html/extractors/factories/elementContent.test.ts
PASS tests/html/extractors/factories/elementAttribute.test.ts
PASS tests/parser.test.ts
PASS tests/html/parser.test.ts
PASS tests/js/parser.test.ts
PASS tests/js/utils.test.ts
PASS tests/html/utils.test.ts
PASS tests/html/extractors/factories/embeddedJs.test.ts
Test Suites: 14 passed, 14 total
Tests: 1003 passed, 1003 total
Snapshots: 0 total
Time: 6.899 s
Ran all test suites.
Done in 7.70s.
but i dont know how test in XREngine, pls guide me
First of all, I'm not sure that my package is what you need. gettext-extractor is for the gettext system of managing translations. The extractor generates a .pot template file which is the basis for translations that are stored in .po files. Looking at your repo, I noticed that you're using json for your translations.
i can next convert .pot to .json, do u have discord?
El mié, 8 jun 2022 a las 13:23, Lukas Geiter @.***>) escribió:
First of all, I'm not sure that my package is what you need. gettext-extractor is for the gettext https://en.wikipedia.org/wiki/Gettext system of managing translations. The extractor generates a .pot template file which is the basis for translations that are stored in .po files. Looking at your repo, I noticed that you're using json for your translations.
— Reply to this email directly, view it on GitHub https://github.com/lukasgeiter/gettext-extractor/issues/54#issuecomment-1150246676, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADIWFFL6RV7T75EKVEMQKTVODQJ5ANCNFSM5YFJXDNA . You are receiving this because you authored the thread.Message ID: @.***>
- Install the package in your repo (instructions here)
- Create a new
.jsfile with the contents from this example - Execute your file using
node
At this point you should see some console output and it will generate a messages.pot file that's most likely pretty empty. Why is it empty? Because you haven't adjusted the configuration to your needs yet. You do that by adjusting the code you copied from the example. All necessary information is in the wiki.
Can u give me your discord, WhatsApp or other chatting method?
El mié, 8 de jun. de 2022, 1:33 p. m., Lukas Geiter < @.***> escribió:
- Install the package in your repo (instructions here https://github.com/lukasgeiter/gettext-extractor/wiki/Installation)
- Create a new .js file with the contents from this example https://github.com/lukasgeiter/gettext-extractor/wiki/Introduction
- Execute your file using node
At this point you should see some console output and it will generate a messages.pot file that's most likely pretty empty. Why is it empty? Because you haven't adjusted the configuration to your needs yet. You do that by adjusting the code you copied from the example. All necessary information is in the wiki https://github.com/lukasgeiter/gettext-extractor/wiki/JavaScript%2C-TypeScript%2C-JSX .
— Reply to this email directly, view it on GitHub https://github.com/lukasgeiter/gettext-extractor/issues/54#issuecomment-1150256851, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADIWFA4ATJU2XUNUSIZS43VODRPZANCNFSM5YFJXDNA . You are receiving this because you authored the thread.Message ID: @.***>
No
- Install the package in your repo (instructions here)
- Create a new
.jsfile with the contents from this example- Execute your file using
nodeAt this point you should see some console output and it will generate a
messages.potfile that's most likely pretty empty. Why is it empty? Because you haven't adjusted the configuration to your needs yet. You do that by adjusting the code you copied from the example. All necessary information is in the wiki.
root@ubuntu21:~/XREngine# node extraccion.js
0 messages extracted
--------------------------
0 total usages
0 files (0 with messages)
0 message contexts
import React, { useEffect, useState } from 'react'
import { RouteComponentProps } from 'react-router-dom'
import { useProjectState } from '@xrengine/client-core/src/common/services/ProjectService'
import { useDispatch } from '@xrengine/client-core/src/store'
import { useAuthState } from '@xrengine/client-core/src/user/services/AuthService'
import { UserId } from '@xrengine/common/src/interfaces/UserId'
import { Engine } from '@xrengine/engine/src/ecs/classes/Engine'
import { initSystems } from '@xrengine/engine/src/ecs/functions/SystemFunctions'
import { useWorld } from '@xrengine/engine/src/ecs/functions/SystemHooks'
import { SystemUpdateType } from '@xrengine/engine/src/ecs/functions/SystemUpdateType'
import { initializeCoreSystems, initializeSceneSystems } from '@xrengine/engine/src/initializeEngine'
import { loadEngineInjection } from '@xrengine/projects/loadEngineInjection'
import EditorContainer from '../components/EditorContainer'
import { EditorAction, useEditorState } from '../services/EditorServices'
export const EditorPage = (props: RouteComponentProps<{ sceneName: string; projectName: string }>) => {
const editorState = useEditorState()
const projectState = useProjectState()
const authState = useAuthState()
const dispatch = useDispatch()
const authUser = authState.authUser
const user = authState.user
const [clientInitialized, setClientInitialized] = useState(false)
const [engineReady, setEngineReady] = useState(false)
const [isAuthenticated, setAuthenticated] = useState(false)
const systems = [
{
systemModulePromise: import('../systems/RenderSystem'),
type: SystemUpdateType.POST_RENDER,
args: { enabled: true }
},
{
systemModulePromise: import('../systems/InputSystem'),
type: SystemUpdateType.PRE_RENDER,
args: { enabled: true }
},
{
systemModulePromise: import('../systems/FlyControlSystem'),
type: SystemUpdateType.PRE_RENDER,
args: { enabled: true }
},
{
systemModulePromise: import('../systems/EditorControlSystem'),
type: SystemUpdateType.PRE_RENDER,
args: { enabled: true }
},
{
systemModulePromise: import('../systems/EditorCameraSystem'),
type: SystemUpdateType.PRE_RENDER,
args: { enabled: true }
},
{
systemModulePromise: import('../systems/ResetInputSystem'),
type: SystemUpdateType.PRE_RENDER,
args: { enabled: true }
},
{
systemModulePromise: import('../systems/GizmoSystem'),
type: SystemUpdateType.PRE_RENDER,
args: { enabled: true }
}
]
useEffect(() => {
const _isAuthenticated =
authUser.accessToken.value != null && authUser.accessToken.value.length > 0 && user.id.value != null
if (isAuthenticated !== _isAuthenticated) setAuthenticated(_isAuthenticated)
}, [authUser.accessToken, user.id, isAuthenticated])
useEffect(() => {
if (engineReady) {
const { projectName, sceneName } = props.match.params
dispatch(EditorAction.projectChanged(projectName ?? null))
dispatch(EditorAction.sceneChanged(sceneName ?? null))
}
}, [engineReady, props.match.params.projectName, props.match.params.sceneName])
useEffect(() => {
if (clientInitialized || projectState.projects.value.length <= 0) return
setClientInitialized(true)
Engine.instance.isEditor = true
const world = Engine.instance.currentWorld
initializeCoreSystems().then(async () => {
initSystems(world, systems)
await initializeSceneSystems()
const projects = projectState.projects.value.map((project) => project.name)
await loadEngineInjection(world, projects)
setEngineReady(true)
})
}, [projectState.projects.value])
return <>{engineReady && editorState.projectName.value && isAuthenticated && <EditorContainer />}</>
}
Again, read this wiki page and try figuring things out on your own. I'm not going to do your work for you.