Use more convenient name for the primary key in "translation" table

This commit is contained in:
Dmitriy Simushev 2014-07-14 10:35:50 +00:00
parent 14e709be37
commit 1a3062f2f9
2 changed files with 3 additions and 3 deletions

View File

@ -112,7 +112,7 @@ requestcallback:
# Contains updated translations
translation:
fields:
stringid: "int NOT NULL auto_increment PRIMARY KEY"
translationid: "int NOT NULL auto_increment PRIMARY KEY"
locale: "varchar(5) NOT NULL"
context: "varchar(256) NOT NULL DEFAULT ''"
source: "text COLLATE utf8_bin"

View File

@ -60,7 +60,7 @@ class TranslationController extends AbstractController
$strings = $this->loadStrings($target);
foreach ($strings as $key => $item) {
$strings[$key] = array(
'id' => $item['stringid'],
'id' => $item['translationid'],
'source' => htmlentities($item['source']),
'translation' => (empty($item['translation'])
? "<font color=\"#c13030\"><b>absent</b></font>"
@ -229,7 +229,7 @@ class TranslationController extends AbstractController
protected function loadString($id)
{
$string = Database::getInstance()->query(
"SELECT * FROM {translation} WHERE stringid = :id",
"SELECT * FROM {translation} WHERE translationid = :id",
array(':id' => $id),
array('return_rows' => Database::RETURN_ONE_ROW)
);