r93663 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r93662‎ | r93663 | r93664 >
Date:22:01, 1 August 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
added alias file and added hash field to TM table for invalidation of locally cached data
Modified paths:
  • /trunk/extensions/LiveTranslate/LiveTranslate.hooks.php (modified) (history)
  • /trunk/extensions/LiveTranslate/LiveTranslate.i18n.alias.php (added) (history)
  • /trunk/extensions/LiveTranslate/LiveTranslate.php (modified) (history)
  • /trunk/extensions/LiveTranslate/LiveTranslate.sql (modified) (history)
  • /trunk/extensions/LiveTranslate/RELEASE-NOTES (modified) (history)
  • /trunk/extensions/LiveTranslate/api/ApiImportTranslationMemories.php (modified) (history)
  • /trunk/extensions/LiveTranslate/sql/LT_IndexWordTranslation.sql (modified) (history)
  • /trunk/extensions/LiveTranslate/sql/LT_addTMField.sql (modified) (history)
  • /trunk/extensions/LiveTranslate/sql/LT_addTMHashField.sql (added) (history)

Diff [purge]

Index: trunk/extensions/LiveTranslate/sql/LT_IndexWordTranslation.sql
@@ -1 +1,5 @@
 2+-- Adds word translation index on the live_translate table.
 3+-- Licence: GNU GPL v3+
 4+-- Author: Jeroen De Dauw < jeroendedauw@gmail.com >
 5+
26 CREATE INDEX word_translation ON /*$wgDBprefix*/live_translate (word_id, word_language);
Index: trunk/extensions/LiveTranslate/sql/LT_addTMField.sql
@@ -1,2 +1,6 @@
 2+-- Adds the memory_id field to the live_translate table, introduced in version 0.4.
 3+-- Licence: GNU GPL v3+
 4+-- Author: Jeroen De Dauw < jeroendedauw@gmail.com >
 5+
26 ALTER TABLE /*_*/live_translate ADD COLUMN memory_id INT(4) unsigned NOT NULL;
37 UPDATE /*_*/live_translate SET memory_id = 1;
\ No newline at end of file
Index: trunk/extensions/LiveTranslate/sql/LT_addTMHashField.sql
@@ -0,0 +1,5 @@
 2+-- Adds the memory_version_hash field to the live_translate_memories table. Change made in version 1.2.
 3+-- Licence: GNU GPL v3+
 4+-- Author: Jeroen De Dauw < jeroendedauw@gmail.com >
 5+
 6+ALTER TABLE /*_*/live_translate_memories ADD COLUMN memory_version_hash VARCHAR(255) NOT NULL default '...';
Property changes on: trunk/extensions/LiveTranslate/sql/LT_addTMHashField.sql
___________________________________________________________________
Added: svn:eol-style
17 + native
Index: trunk/extensions/LiveTranslate/LiveTranslate.php
@@ -43,6 +43,7 @@
4444 unset( $useExtensionPath );
4545
4646 $wgExtensionMessagesFiles['LiveTranslate'] = $egLiveTranslateIP . '/LiveTranslate.i18n.php';
 47+$wgExtensionAliasesFiles['LiveTranslate'] = $egLiveTranslateIP . '/LiveTranslate.i18n.alias.php';
4748 $wgExtensionMessagesFiles['LiveTranslateMagic'] = $egLiveTranslateIP . '/LiveTranslate.i18n.magic.php';
4849
4950 $wgAutoloadClasses['LiveTranslateHooks'] = $egLiveTranslateIP . '/LiveTranslate.hooks.php';
Index: trunk/extensions/LiveTranslate/LiveTranslate.hooks.php
@@ -230,6 +230,12 @@
231231 'memory_id',
232232 $egLiveTranslateIP . '/sql/LT_addTMField.sql'
233233 );
 234+
 235+ $wgExtNewFields[] = array(
 236+ 'live_translate_memories',
 237+ 'memory_version_hash',
 238+ $egLiveTranslateIP . '/sql/LT_addTMHashField.sql'
 239+ );
234240 }
235241 else {
236242 $updater->addExtensionUpdate( array(
@@ -260,6 +266,14 @@
261267 $egLiveTranslateIP . '/sql/LT_addTMField.sql',
262268 true
263269 ) );
 270+
 271+ $updater->addExtensionUpdate( array(
 272+ 'addField',
 273+ 'live_translate_memories',
 274+ 'memory_version_hash',
 275+ $egLiveTranslateIP . '/sql/LT_addTMHashField.sql',
 276+ true
 277+ ) );
264278 }
265279 }
266280
Index: trunk/extensions/LiveTranslate/RELEASE-NOTES
@@ -7,6 +7,7 @@
88 === Version 1.2 ===
99 2011-xx-xx
1010
 11+* Added i18n alias file.
1112 * Added TMX admin user rights group.
1213
1314 === Version 1.1.1 ===
Index: trunk/extensions/LiveTranslate/LiveTranslate.i18n.alias.php
@@ -0,0 +1,23 @@
 2+<?php
 3+
 4+/**
 5+ * Aliases for the special pages of the Live Translate extension.
 6+ *
 7+ * @file LiveTranslate.i18n.alias.php
 8+ * @ingroup LiveTranslate
 9+ *
 10+ * @licence GNU GPL v3+
 11+ * @author Jeroen De Dauw < jeroendedauw@gmail.com >
 12+ */
 13+
 14+$specialPageAliases = array();
 15+
 16+/** English (English) */
 17+$specialPageAliases['en'] = array(
 18+ 'LiveTranslate' => array( 'LiveTranslate' ),
 19+);
 20+
 21+/**
 22+ * For backwards compatibility with MediaWiki 1.15 and earlier.
 23+ */
 24+$aliases =& $specialPageAliases;
\ No newline at end of file
Property changes on: trunk/extensions/LiveTranslate/LiveTranslate.i18n.alias.php
___________________________________________________________________
Added: svn:eol-style
125 + native
Index: trunk/extensions/LiveTranslate/api/ApiImportTranslationMemories.php
@@ -131,7 +131,8 @@
132132 'live_translate_memories',
133133 array(
134134 'memory_lang_count' => $tm->getLanguageAmount(),
135 - 'memory_tu_count' => $wordId
 135+ 'memory_tu_count' => $wordId,
 136+ 'memory_version_hash' => uniqid(),
136137 ),
137138 array( 'memory_id' => $memoryId )
138139 );
Index: trunk/extensions/LiveTranslate/LiveTranslate.sql
@@ -1,4 +1,6 @@
22 -- MySQL version of the database schema for the Live Translate extension.
 3+-- Licence: GNU GPL v3+
 4+-- Author: Jeroen De Dauw < jeroendedauw@gmail.com >
35
46 -- Special translations table.
57 CREATE TABLE IF NOT EXISTS /*$wgDBprefix*/live_translate (
@@ -16,7 +18,8 @@
1719 memory_location VARCHAR(255) NOT NULL,
1820 memory_local INT(1) unsigned NOT NULL,
1921 memory_lang_count INT(2) unsigned NOT NULL,
20 - memory_tu_count INT(8) unsigned NOT NULL
 22+ memory_tu_count INT(8) unsigned NOT NULL,
 23+ memory_version_hash VARCHAR(255) NOT NULL default '...'
2124 ) /*$wgDBTableOptions*/;
2225
23 -INSERT INTO /*$wgDBprefix*/live_translate_memories VALUES (NULL, 0, "Live Translate Dictionary", 1, 0, 0);
\ No newline at end of file
 26+INSERT INTO /*$wgDBprefix*/live_translate_memories VALUES (NULL, 0, "Live Translate Dictionary", 1, 0, 0, "...");
\ No newline at end of file

Status & tagging log