Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translate admin mode #162

Open
eldoy opened this issue May 3, 2024 · 0 comments
Open

Translate admin mode #162

eldoy opened this issue May 3, 2024 · 0 comments

Comments

@eldoy
Copy link
Owner

eldoy commented May 3, 2024

The idea is to make all text on the site editable. This can be achieved by setting a variable in the orb object.

Add this to app/config/env.yml

localize: true

Then in lib/serve.js send options to orb.

In orb.js, send localize to i18n.t.

In 18n.t wrap the translation in a t tag: <t data-key="pages.index.hero">Translation here</t>

In the browser, make it editable by toggling content-editable on the t tag. Set up a server action to store the changes, but also keep the in localStorage client side to persist them.

A script can unload the changes from the database and write them to file.

An alternative is to actually load the translations from database. Creating another task on that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant