Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 118294 Details for
Bug 230949
Possibly Incorrect strings not identified in the UI
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Patch v1
patch.txt (text/plain), 14.45 KB, created by
Denis Roy
on 2008-11-19 13:19:25 EST
(
hide
)
Description:
Patch v1
Filename:
MIME Type:
Creator:
Denis Roy
Created:
2008-11-19 13:19:25 EST
Size:
14.45 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.babel >Index: server/html/js/projectString.js >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.babel/server/html/js/projectString.js,v >retrieving revision 1.26 >diff -u -r1.26 projectString.js >--- server/html/js/projectString.js 17 Nov 2008 19:05:07 -0000 1.26 >+++ server/html/js/projectString.js 19 Nov 2008 18:17:07 -0000 >@@ -204,7 +204,13 @@ > > updateStringTableCurrentTranslation: function(stringTableIndex,trans){ > this.tableDom.rows[stringTableIndex].cells[1].innerHTML = trans; >- } >+ }, >+ >+ updateStringTableFuzzy: function(stringTableIndex, fuzzy){ >+ if(fuzzy == 1) { >+ this.tableDom.rows[stringTableIndex].cells[1].innerHTML = '<img src="images/fuzzy.png" />' + this.tableDom.rows[stringTableIndex].cells[1].innerHTML; >+ } >+ }, > //$stringTableIndex > }; > >@@ -232,10 +238,16 @@ > values.string = "<div style='width: 100%; overflow: hidden;'>"+temp+"</div>"; > > temp = this.data['translationString'] ? this.data['translationString'] : '' >+ >+ if(this.data['fuzzy'] == 1 && this.data['nontranslatable'] != 1) { >+ temp = "<img src='images/fuzzy.png' title='Possibly incorrect' />" + temp; >+ } >+ > values.translation = "<div style='width: 100%; overflow: hidden;'>"+temp+"</div>"; > values.translator = this.data['translator'] ? this.data['translator'] : ''; > values.createdon = this.data['createdOn']; > values.stringname = this.data['stringname']; >+ values.fuzzy = this.data['fuzzy'] > > var lineDome = YAHOO.projectStringsManager.createHTML(values,tableDom); > this.domElem = lineDome; >Index: server/html/js/translation.js >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.babel/server/html/js/translation.js,v >retrieving revision 1.13 >diff -u -r1.13 translation.js >--- server/html/js/translation.js 2 Aug 2008 02:26:32 -0000 1.13 >+++ server/html/js/translation.js 19 Nov 2008 18:17:07 -0000 >@@ -83,6 +83,7 @@ > function translationSumbit(allornot,translationIndex){ > var target = document.getElementById('translation-form'); > var tr_value = target.translation.value; >+ var fuzzy_value = (target.fuzzy_checkbox.checked ? 1 : 0); > > var callback = > { >@@ -91,6 +92,7 @@ > success: function(o) { > var response = eval("("+o.responseText+")"); > YAHOO.projectStringsManager.updateStringTableCurrentTranslation(translationIndex, response.translationString); >+ YAHOO.projectStringsManager.updateStringTableFuzzy(translationIndex, fuzzy_value); > target.innerHTML = response.translationArea; > }, > failure: function(o) { >@@ -99,9 +101,9 @@ > } > > YAHOO.tranlsation.posted = true; >- > var post = "string_id="+target.string_id.value+ > "&translation="+sub(tr_value)+ >+ "&fuzzy="+fuzzy_value+ > "&translate_action="+allornot; > spin(); > var request = YAHOO.util.Connect.asyncRequest('POST', "callback/setStringTranslation.php", callback, post); >Index: server/html/callback/setStringTranslation.php >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.babel/server/html/callback/setStringTranslation.php,v >retrieving revision 1.22 >diff -u -r1.22 setStringTranslation.php >--- server/html/callback/setStringTranslation.php 17 Jul 2008 16:10:42 -0000 1.22 >+++ server/html/callback/setStringTranslation.php 19 Nov 2008 18:17:07 -0000 >@@ -17,6 +17,7 @@ > > $string_id = $App->getHTTPParameter("string_id", "POST"); > $translation = $App->getHTTPParameter("translation", "POST"); >+$fuzzy_state = $App->getHTTPParameter("fuzzy", "POST"); > > $language_id = $_SESSION["language"]; > $project_id = $_SESSION['project']; >@@ -54,6 +55,7 @@ > language_id = '".addslashes($language_id)."', > value = '".addslashes($translation)."', > userid = '".addslashes($user_id)."', >+ possibly_incorrect = '".addslashes($fuzzy_state)."', > created_on = NOW() > "; > $res = mysql_query($query,$dbh); >@@ -119,6 +121,7 @@ > language_id = '".addslashes($row['language_id'])."' , > value = '".addslashes($translation)."', > userid = '".addslashes($user_id)."', >+ possibly_incorrect = '".addslashes($fuzzy_state)."', > created_on = NOW() > "; > $res2 = mysql_query($query,$dbh); >@@ -153,6 +156,7 @@ > string_id = '".addslashes($row['string_id'])."', > language_id = '".addslashes($language)."' , > value = '".addslashes($translation)."', >+ possibly_incorrect = '".addslashes($fuzzy_state)."', > userid = '".addslashes($user_id)."', > created_on = NOW() > "; >@@ -165,26 +169,28 @@ > if(!$do_nothing) { > # Find all string_id's that have the same binary value as the one we're translating > # *and* have no translation yet, and update those too. >- $sql = "SELECT s.string_id, COUNT(t.string_id) AS tr_count >- FROM strings AS s >- LEFT JOIN translations AS t ON t.string_id = s.string_id AND t.language_id = '".addslashes($language_id)."' >- WHERE BINARY s.value = (select value from strings where string_id = '".addslashes($string_id)."') >- AND s.is_active = 1 AND t.value IS NULL GROUP BY s.string_id HAVING tr_count = 0"; >- >- $res = mysql_query($sql, $dbh); >- $str_count = mysql_affected_rows(); >- >- while($myrow = mysql_fetch_assoc($res)) { >- $sql = "insert into >- translations >- set >- string_id = " . $myrow['string_id'] . ", >- language_id = '".addslashes($language_id)."', >- value = '".addslashes($translation)."', >- userid = '".addslashes($user_id)."', >- created_on = NOW()"; >- mysql_query($sql, $dbh); >- $affected_rows += mysql_affected_rows(); >+ if(!$fuzzy_state) { >+ $sql = "SELECT s.string_id, COUNT(t.string_id) AS tr_count >+ FROM strings AS s >+ LEFT JOIN translations AS t ON t.string_id = s.string_id AND t.language_id = '".addslashes($language_id)."' >+ WHERE BINARY s.value = (select value from strings where string_id = '".addslashes($string_id)."') >+ AND s.is_active = 1 AND t.value IS NULL GROUP BY s.string_id HAVING tr_count = 0"; >+ >+ $res = mysql_query($sql, $dbh); >+ $str_count = mysql_affected_rows(); >+ >+ while($myrow = mysql_fetch_assoc($res)) { >+ $sql = "insert into >+ translations >+ set >+ string_id = " . $myrow['string_id'] . ", >+ language_id = '".addslashes($language_id)."', >+ value = '".addslashes($translation)."', >+ userid = '".addslashes($user_id)."', >+ created_on = NOW()"; >+ mysql_query($sql, $dbh); >+ $affected_rows += mysql_affected_rows(); >+ } > } > } > >Index: server/html/callback/getStringsforProject.php >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.babel/server/html/callback/getStringsforProject.php,v >retrieving revision 1.23 >diff -u -r1.23 getStringsforProject.php >--- server/html/callback/getStringsforProject.php 17 Nov 2008 19:05:57 -0000 1.23 >+++ server/html/callback/getStringsforProject.php 19 Nov 2008 18:17:07 -0000 >@@ -46,7 +46,8 @@ > strings.value as string, > strings.name as stringName, > strings.non_translatable, >- translations.value as translation >+ translations.value as translation, >+ translations.possibly_incorrect as fuzzy > from > strings, > files >@@ -70,6 +71,7 @@ > strings.name as stringName, > strings.non_translatable, > translations.value as translation, >+ translations.possibly_incorrect as fuzzy, > users.username as translator > from > strings, >@@ -100,6 +102,7 @@ > strings.value as text, > strings.created_on as createdOn, > translations.value as translationString, >+ translations.possibly_incorrect as fuzzy, > users.first_name as first, > users.last_name as last > from >@@ -154,7 +157,7 @@ > if($line['non_translatable']){ > $line['translationString'] = "<span style='font-style: italic;'>non-translatable string"; > $line['nontranslatable'] = true; >- } >+ } > $return[] = $line; > $stringids[$line['stringId']] = 1; > } >Index: server/html/callback/getCurrentStringTranslation.php >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.babel/server/html/callback/getCurrentStringTranslation.php,v >retrieving revision 1.36 >diff -u -r1.36 getCurrentStringTranslation.php >--- server/html/callback/getCurrentStringTranslation.php 2 Aug 2008 02:03:59 -0000 1.36 >+++ server/html/callback/getCurrentStringTranslation.php 19 Nov 2008 18:17:07 -0000 >@@ -30,6 +30,7 @@ > strings.non_translatable, > strings.value as string_value, > translations.value as translation_value, >+ translations.possibly_incorrect as fuzzy, > files.name, > strings.name as token, > max(translations.version) >@@ -149,8 +150,7 @@ > Select some English text above to find similar translations. > </div> > >- <input id='non-translatable-checkbox' type=checkbox name="non_translatable_string" <?= $line['non_translatable'] ? 'checked' : '' ;?>>Non-Translatable >- >+ <input id='non-translatable-checkbox' type=checkbox name="non_translatable_string" <?= $line['non_translatable'] ? 'checked' : '' ;?>>Non-Translatable > </div> > <div id="translation-textarea" class="side-component"> > <?if($line['non_translatable'] == 0){?> >@@ -159,9 +159,13 @@ > [<a id="reset-current-translation-link">Reset</a>] > [<a id="clear-current-translation-link">Clear</a>] > </h4> >+ > <textarea id="current-translation" style='display: inline; width: 320px; height: 150px;' name="translation"><?=(($line['translation_value']));?></textarea> >- <br> >+ <br /> >+ <input id='fuzzy' type=checkbox name="fuzzy_checkbox" <?= $line['fuzzy'] ? 'checked' : '' ;?>> Translation is possibly incorrect >+ <br /> > <button id="allversions" type="submit" name="translateAction" value="All Versions">Submit</button> >+ > <?}else{?> > <h4>Non Translatable String</h4> > <br> >@@ -178,16 +182,20 @@ > > <table> > <?php >- $query = "select value,first_name,last_name,translations.created_on from translations,users where string_id = '".addslashes($line['string_id'])."' and language_id = '".addslashes($language)."' and translations.userid = users.userid order by translations.created_on desc"; >+ $query = "select value,first_name,last_name,translations.created_on, possibly_incorrect as fuzzy from translations,users where string_id = '".addslashes($line['string_id'])."' and language_id = '".addslashes($language)."' and translations.userid = users.userid order by translations.created_on desc"; > $res_history = mysql_query($query,$dbh); > > if(!mysql_num_rows($res_history)){ > print "No history."; > }else{ > while($line = mysql_fetch_array($res_history, MYSQL_ASSOC)){ >+ $fuzzy = ""; >+ if($line['fuzzy'] == 1) { >+ $fuzzy = "<img src='images/fuzzy.png' />"; >+ } > print "<tr>"; > print "<td width='40%'>"; >- print "<div>".nl2br(htmlspecialchars($line['value']))."</div>"; >+ print "<div>$fuzzy".nl2br(htmlspecialchars($line['value']))."</div>"; > print "</td>"; > print "<td width='20%'>"; > print $line['first_name']." ".$line['last_name']; >Index: server/html/content/en_recent_html_list.php >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.babel/server/html/content/en_recent_html_list.php,v >retrieving revision 1.5 >diff -u -r1.5 en_recent_html_list.php >--- server/html/content/en_recent_html_list.php 12 Nov 2008 19:49:33 -0000 1.5 >+++ server/html/content/en_recent_html_list.php 19 Nov 2008 18:17:07 -0000 >@@ -18,6 +18,9 @@ > li { > padding-bottom: 5px; > } >+img { >+ vertical-align: bottom; >+} > </style> > > <?include 'en_recent_html_common.php' ?> >@@ -31,9 +34,15 @@ > $prev_date = substr($myrow['created_on'],0,10); > echo "<h2>$prev_date</h2>"; > } >+ $fuzzy = ""; >+ if($myrow['fuzzy'] == 1) { >+ $fuzzy = "<img src='images/fuzzy.png' /> "; >+ } >+ > echo "<li>" . > substr($myrow['created_on'],11,5) . " " . $myrow['string_value'] . >- " -> " . $myrow['translation'] . >+ " -> " . $myrow['translation'] . >+ $fuzzy . > " [" . $myrow['language'] . ": <a href='translate.php?project=" . $myrow['project_id'] . "&version=" . $myrow['version'] . "&file=" . $myrow['name'] . "&string=" . $myrow['string_key'] . "'>" .$myrow['string_key'] . "</a>] <b>" . > $myrow['project_id'] . " " . > $myrow['version'] . "</b> >Index: server/html/content/en_recent_html_common.php >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.babel/server/html/content/en_recent_html_common.php,v >retrieving revision 1.2 >diff -u -r1.2 en_recent_html_common.php >--- server/html/content/en_recent_html_common.php 21 Jul 2008 14:59:38 -0000 1.2 >+++ server/html/content/en_recent_html_common.php 19 Nov 2008 18:17:07 -0000 >@@ -34,10 +34,13 @@ > <option value="1000">1000</option> > <option value="2000">2000</option> > <option value="5000">5000</option> >+ <option value="10000">10000</option> >+ <option value="20000">20000</option> > </select> translations</td></tr> > <tr><td>Layout <select name="layout"> > <option value="list" <?= $LAYOUT == "list" ? "selected='selected'" : "" ?>>list</option> > <option value="table" <?= $LAYOUT == "table" ? "selected='selected'" : "" ?>>table</option> > </select></td> >+<td><input type="checkbox" name="fuzzy" <?= $FUZZY ? "checked" : "" ?> value="1" /> Show Possibly Incorrect only</td> > </tr> > <tr><td colspan="4"><input type="submit" value="Apply filter" /></td></tr></table></form> >\ No newline at end of file >Index: server/html/recent.php >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.babel/server/html/recent.php,v >retrieving revision 1.8 >diff -u -r1.8 recent.php >--- server/html/recent.php 12 Nov 2008 19:49:33 -0000 1.8 >+++ server/html/recent.php 19 Nov 2008 18:17:07 -0000 >@@ -33,6 +33,12 @@ > if($LANGUAGE_ID == "") { > $LANGUAGE_ID = $_SESSION["language"]; > } >+ >+$FUZZY = $App->getHTTPParameter("fuzzy"); >+if($FUZZY == "" || $FUZZY != 1) { >+ $FUZZY = 0; >+} >+ > if($LANGUAGE_ID == "All") { > $LANGUAGE_ID = ""; > } >@@ -75,6 +81,9 @@ > $where = $App->addAndIfNotNull($where) . "u.userid = "; > $where .= $App->sqlSanitize($USERID, $dbh); > } >+if($FUZZY == 1) { >+ $where = $App->addAndIfNotNull($where) . "t.possibly_incorrect = 1 "; >+} > > if($where != "") { > $where = " WHERE " . $where; >@@ -83,7 +92,8 @@ > > $sql = "SELECT > s.name AS string_key, s.value as string_value, >- t.value as translation, >+ t.value as translation, >+ t.possibly_incorrect as fuzzy, > IF(u.last_name <> '' AND u.first_name <> '', > CONCAT(CONCAT(first_name, ' '), u.last_name), > IF(u.first_name <> '', u.first_name, u.last_name)) AS who,
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 230949
:
99134
| 118294