I need comments on my solution of a website localization system.
Table Content:
Field Type Null Key Default Extra
id int(11) NO PRI NULL auto_increment
Page varchar(30) YES NULL
Locale varchar(10) YES NULL
Data longtext YES NULL
My thought is to store each page and each locale into the Content table. For example:
index.php en_GB {data}
index.php de_DE {data}
The Data field would consist of a json_encoded array in which the text of each of the page elements would be stored. For example:
$data['Headline1'] = 'The Headline';
$data['Welcome'] = 'The welcome text.';
I have yet to implement it, but I plan on using memcached to improve performance – and from the little I know this is the perfect kind of data to use it on since it is not prone to be updated very often.
Is this good or bad, should it all be scrapped? Comments please!
Some notes:
Something along the likes of: