Skip to content

Commit

Permalink
App: remove endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
robisim74 committed Aug 31, 2022
1 parent 7a0cbe2 commit 7750e96
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 64 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,15 @@ export const config: SpeakConfig = {
]
};
```
Assets will be loaded through the implementation of `getTranslation$` function below. You can call an _endpoint_, or load _json_ files to return a `Translation` object for each language:
Assets will be loaded through the implementation of `getTranslation$` function below. You can load _json_ files or call an _endpoint_ to return a `Translation` object for each language:
```json
{
"app": {
"title": "I'm {{name}}"
}
}
```
Then add the `QwikSpeak` component in `root.tsx`:
Add the `QwikSpeak` component in `root.tsx`:
```jsx
import { QwikSpeak } from 'qwik-speak';

Expand Down
60 changes: 0 additions & 60 deletions src/app/routes/i18n/[lang]/[asset].json/index.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/library/qwik-speak.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export const QwikSpeak = component$((props: QwikSpeakProps) => {
Object.assign(translation, loadedTranslation);

if (speakDev) {
console.debug('Qwik Speak', '', `Translation loaded - ${JSON.stringify(config.assets)} - ${lang}`);
console.debug('Qwik Speak', '', `Translation loaded - ${config.assets} - ${lang}`);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/library/speak.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const Speak = component$((props: SpeakProps) => {
Object.assign(translation[lang], loadedTranslation[lang]);

if (speakDev) {
console.debug('Qwik Speak', '', `Translation loaded - ${JSON.stringify(props.assets)} - ${lang}`);
console.debug('Qwik Speak', '', `Translation loaded - ${props.assets} - ${lang}`);
}
}

Expand Down

0 comments on commit 7750e96

Please sign in to comment.