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

Feature request: Internationalization #619

Open
maekoos opened this issue Sep 23, 2024 · 0 comments
Open

Feature request: Internationalization #619

maekoos opened this issue Sep 23, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@maekoos
Copy link

maekoos commented Sep 23, 2024

It would be really nice to have sqlpage handle internationalization for us. Maybe using a cookie for switching between languages and fallback to Accept-Language, and a json file in sqlpage directory for adding translations for each locale.

Right now the only option would be to use a (temporary?) table or write a function for handling this, which would require manually reading from the headers and cookies for every single text on the web page.

I'm thinking something like this:

SELECT 'text' AS component, sqlpage.i18n('home_title') as title;
{
  "en": { "home_title": "Welcome!" },
  "sv": { "home_title": "Välkommen!" }
}

Wouldn't be too hard to implement and should be sufficient for pretty much all applications.

@maekoos maekoos added the enhancement New feature or request label Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant