The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Moving Languages to Database
#2
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...

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;?>
  Reply


Messages In This Thread
Moving Languages to Database - by Brandin - 11-26-2016, 08:22 PM
Moving Languages to Database - by mudmin - 11-26-2016, 08:46 PM
Moving Languages to Database - by Brandin - 11-26-2016, 10:23 PM
Moving Languages to Database - by winterswolf - 11-29-2016, 06:25 AM
Moving Languages to Database - by Brandin - 11-29-2016, 01:09 PM
Moving Languages to Database - by mudmin - 11-29-2016, 02:02 PM
Moving Languages to Database - by Brandin - 11-29-2016, 02:03 PM
Moving Languages to Database - by mudmin - 11-29-2016, 02:09 PM
Moving Languages to Database - by mudmin - 11-29-2016, 02:12 PM
Moving Languages to Database - by Brandin - 11-29-2016, 02:14 PM
Moving Languages to Database - by mudmin - 11-29-2016, 02:24 PM
Moving Languages to Database - by Brandin - 11-29-2016, 03:17 PM
Moving Languages to Database - by mudmin - 11-29-2016, 03:19 PM
Moving Languages to Database - by Brandin - 02-05-2017, 02:59 PM
Moving Languages to Database - by Brandin - 02-11-2017, 05:09 PM
Moving Languages to Database - by mudmin - 02-11-2017, 10:30 PM
Moving Languages to Database - by Brandin - 02-12-2017, 08:33 PM
Moving Languages to Database - by Brandin - 02-13-2017, 03:02 AM
Moving Languages to Database - by Brandin - 02-13-2017, 03:17 AM
Moving Languages to Database - by Brandin - 07-18-2017, 12:41 AM
Moving Languages to Database - by firestorm - 07-19-2017, 07:17 AM
Moving Languages to Database - by Brandin - 07-19-2017, 12:07 PM
Moving Languages to Database - by karsen - 07-21-2017, 06:39 PM
Moving Languages to Database - by firestorm - 07-21-2017, 07:08 PM
Moving Languages to Database - by Brandin - 07-22-2017, 10:08 PM
Moving Languages to Database - by karsen - 07-22-2017, 11:41 PM
Moving Languages to Database - by Brandin - 07-23-2017, 05:46 PM
Moving Languages to Database - by firestorm - 07-23-2017, 09:26 PM
Moving Languages to Database - by Brandin - 07-24-2017, 12:17 AM

Forum Jump:


Users browsing this thread: 2 Guest(s)