SQLpage
SQLpage copied to clipboard
Feature request: Internationalization
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.