11-26-2016, 08:46 PM
I don't see why that would be a problem.
I guess I have 2 thoughts...
1. Are you planning on offering non-English languages? If not, I don't see a major benefit.
2. You could also just do the db language stuff for your own pages and leave userspice stuff alone.
To answer your question, if I were doing the language in the db, I would...
a. Make a db table per page.
b. Give each new language its own row in the database.
Then you could have something where the user stores their preferred language in the user table and then for each page search something like...
Then every time you want to insert text, just use the column name
I guess I have 2 thoughts...
1. Are you planning on offering non-English languages? If not, I don't see a major benefit.
2. You could also just do the db language stuff for your own pages and leave userspice stuff alone.
To answer your question, if I were doing the language in the db, I would...
a. Make a db table per page.
b. Give each new language its own row in the database.
Then you could have something where the user stores their preferred language in the user table and then for each page search something like...
Code:
$langQ = $db->query("SELECT * FROM pagename WHERE lang = ?",array($user->data()->lang));
Code:
$lang = $langQ->first();
Then every time you want to insert text, just use the column name
Code:
<?=$lang->colname;?>