In-Portal Issue Tracker - In-Portal CMS
Viewing Issue Advanced Details
1094 [In-Portal CMS] Optimization feature request N/A 2011-08-08 12:06 2011-11-30 08:17
alex  
alex  
normal  
closed 5.1.3-RC1  
fixed  
 
none 5.1.3  
https://groups.google.com/d/topic/in-portal-dev/qsJlsjcAl3I/discussion
Changed a way how helping phrases (hints) are stored
0
0001094: Optimizing storage of help phrases
Then maybe we need to implement site-wide inline help system. We already have ability to add descriptive hint about field/configuration variable usage, but we rarely actually use that ability.

Since any translatable text on a website is a phrase, then adding a lot of helping text will double (in worst case) language pack size.

To solve that problem before we get to it I'm proposing to add HintTranslation column into Phrase table, right after Translation column that we have already. This way every phrase we created can have hint translation stored under the same name as phrase is stored currently.

To determine what translation (regular or hint) should be used I'm proposing to add "hint:" in front of phrase name to get it's hint translation instead of actual translation. For example:

* <inp2:m_Phrase name="la_fld_Name"/> - returns just la_fld_Name phrase translation;
* <inp2:m_Phrase name="hint:la_fld_Name"/> - returns a hint translation, associated with la_fld_Name phrase.

In case, when la_fld_Name phrase's translation should have different hints on different forms, then we'll use same old approach, when phrase la_hint_AnotherHintForName is created and specified directly to inp_edit_box block via hint_label parameter in template. When not specified, then we'll assume, that hint phrase is "hint:" + phrase for field name (e.g. la_fld_Name in this case).


Another thing, that could be automated this way is actual "la_fld_Name" phrase. In 99% cases, when field name is Name, then corresponding phrase to show is "la_fld_Name". This way regular form field code in template would became <inp2:m_RenderElement name="inp_edit_box" field="Name"/> instead of <inp2:m_RenderElement name="inp_edit_box" field="Name" title="la_fld_Name" hint_label="la_hint_Name"/>.

Of course if we need to do a manual override, then ability to specify "title" parameter will stay.


Same way we can get rid of specifying "la_col_Name" in every grid column definition, however in 99% cases it matches "la_col_" + FieldName formula.
Some more ideas that were implemented:
1. added "Hint Phrase" and "Column Phrase" textarea on phrase translation form
2. to use phrase hint translation use <inp2:m_Phrase name="hint:la_fld_FieldName"/>
3. to use phrase column translation use <inp2:m_Phrase name="column:la_fld_FieldName"/>
4. most of "la_col_FieldName" were deleted and their translation was set as "column phrase" for corrsponding "la_fld_FieldName" phrases
4. added hint support for "form submissions" & "custom fields"


This way only 1 phrase will have 3 translation:
1. main translation
2. associated hint translation
3. associated column heading translation


TODO
I wasn't able to remove "title" attribute in "inp_edit_*" block on edit templates due lack of time.
Goal is to remove title="la_fld_FieldName" when tag contains field="FieldName".
related to 0000285closed  (5.1.0)alex Translation system refactoring 
parent of 0001242closed  (5.2.0)alex Hint Translation Not Available When Not in Debug Mode 
parent of 0001246closed  (5.2.0)alex Fix unit config generator to produce column phrase compatible grid declaration 
related to 0001024closed  (5.2.0)alex Phrase type detection based on it's name 
patch phrase_storage_automation_core.patch (184,220) 2011-08-09 12:29
http://tracker.in-portal.org/file_download.php?file_id=1095&type=bug
patch phrase_storage_automation_modules.patch (281,860) 2011-08-09 12:33
http://tracker.in-portal.org/file_download.php?file_id=1096&type=bug
patch phrase_storage_automation_incommerce_only.patch (126,722) 2011-08-09 12:42
http://tracker.in-portal.org/file_download.php?file_id=1097&type=bug
patch phrase_storage_automation_install-Dmitry.patch (4,732) 2011-09-06 22:23
http://tracker.in-portal.org/file_download.php?file_id=1122&type=bug
patch phrase_storage_automation_Themes_Advanced-Dmitry.patch (2,881) 2011-09-06 22:24
http://tracker.in-portal.org/file_download.php?file_id=1123&type=bug
png 2011-09-06_2216-EmptyColumns.png (109,836) 2011-09-06 22:24
http://tracker.in-portal.org/file_download.php?file_id=1124&type=bug
png

patch phrase_storage_automation_core_v2.patch (182,027) 2011-09-17 06:14
http://tracker.in-portal.org/file_download.php?file_id=1136&type=bug
patch phrase_storage_automation_modules_v2.patch (229,703) 2011-09-17 06:15
http://tracker.in-portal.org/file_download.php?file_id=1137&type=bug
patch phrase_storage_automation_themes_v2.patch (2,881) 2011-09-17 06:15
http://tracker.in-portal.org/file_download.php?file_id=1138&type=bug
patch phrase_storage_automation_core_v3.patch (187,204) 2011-09-18 08:50
http://tracker.in-portal.org/file_download.php?file_id=1139&type=bug
patch phrase_storage_automation_modules_v3.patch (229,858) 2011-09-18 08:50
http://tracker.in-portal.org/file_download.php?file_id=1140&type=bug
patch untranslated_phrase_hint_fix.patch (434) 2011-11-30 08:16
http://tracker.in-portal.org/file_download.php?file_id=1334&type=bug
Issue History
2012-04-03 05:56 alex Relationship added parent of 0001246
2012-03-31 04:28 alex Relationship added parent of 0001242
2011-11-30 08:18 alex Changeset attached 5.2.x r14810
2011-11-30 08:17 alex Note Added: 0004183
2011-11-30 08:16 alex File Added: untranslated_phrase_hint_fix.patch
2011-09-19 16:08 alex Note Added: 0003772
2011-09-19 16:08 alex Status resolved => closed
2011-09-18 09:37 alex Note Added: 0003760
2011-09-18 09:20 alex Changeset attached 1.1.x r14538
2011-09-18 09:19 alex Changeset attached 5.1.x r14537
2011-09-18 09:19 alex Note Added: 0003759
2011-09-18 09:19 alex Status needs testing => resolved
2011-09-18 09:19 alex Fixed in Version => 5.1.3
2011-09-18 09:19 alex Resolution open => fixed
2011-09-18 09:19 alex Assigned To !COMMUNITY => alex
2011-09-18 09:16 alex Changeset attached 5.1.x r14536
2011-09-18 09:14 alex Changeset attached 5.1.x r14535
2011-09-18 09:13 alex Changeset attached 5.1.x r14534
2011-09-18 09:05 alex Changeset attached 5.1.x r14532
2011-09-18 09:03 alex Changeset attached 5.1.x r14531
2011-09-18 08:54 alex Changeset attached 1.1.x r14529
2011-09-18 08:53 alex Relationship added related to 0000285
2011-09-18 08:51 alex Note Added: 0003758
2011-09-18 08:51 alex Status needs work => needs testing
2011-09-18 08:50 alex File Added: phrase_storage_automation_modules_v3.patch
2011-09-18 08:50 alex File Added: phrase_storage_automation_core_v3.patch
2011-09-17 17:30 Dmitry Note Added: 0003757
2011-09-17 17:30 Dmitry Status needs testing => needs work
2011-09-17 06:26 alex Note Added: 0003756
2011-09-17 06:26 alex Assigned To alex => !COMMUNITY
2011-09-17 06:26 alex Status needs work => needs testing
2011-09-17 06:15 alex File Added: phrase_storage_automation_themes_v2.patch
2011-09-17 06:15 alex File Added: phrase_storage_automation_modules_v2.patch
2011-09-17 06:14 alex File Added: phrase_storage_automation_core_v2.patch
2011-09-06 22:30 Dmitry Target Version Icebox => 5.1.3
2011-09-06 22:30 Dmitry Note Added: 0003719
2011-09-06 22:30 Dmitry Assigned To !COMMUNITY => alex
2011-09-06 22:30 Dmitry Status needs testing => needs work
2011-09-06 22:24 Dmitry File Added: 2011-09-06_2216-EmptyColumns.png
2011-09-06 22:24 Dmitry File Added: phrase_storage_automation_Themes_Advanced-Dmitry.patch
2011-09-06 22:23 Dmitry File Added: phrase_storage_automation_install-Dmitry.patch
2011-09-02 03:11 alex Relationship added related to 0001024
2011-08-10 04:56 alex Issue Monitored: alex
2011-08-10 02:26 alex Additional Information Updated bug_revision_view_page.php?rev_id=791#r791
2011-08-09 13:48 alex Note Edited: 0003650 bug_revision_view_page.php?bugnote_id=0003650#r790
2011-08-09 12:53 alex Note Added: 0003650
2011-08-09 12:53 alex Assigned To => !COMMUNITY
2011-08-09 12:53 alex Developer => alex
2011-08-09 12:53 alex Status active => needs testing
2011-08-09 12:52 alex Issue Monitored: Dmitry
2011-08-09 12:52 alex Note Added: 0003649
2011-08-09 12:51 alex Additional Information Updated bug_revision_view_page.php?rev_id=788#r788
2011-08-09 12:42 alex Note Added: 0003648
2011-08-09 12:42 alex File Added: phrase_storage_automation_incommerce_only.patch
2011-08-09 12:33 alex File Added: phrase_storage_automation_modules.patch
2011-08-09 12:29 alex File Added: phrase_storage_automation_core.patch
2011-08-08 12:06 alex Reference => https://groups.google.com/d/topic/in-portal-dev/qsJlsjcAl3I/discussion
2011-08-08 12:06 alex Change Log Message => Changed a way how helping phrases (hints) are stored
2011-08-08 12:06 alex New Issue

Notes
(0003648)
alex   
2011-08-09 12:42   
Patch "phrase_storage_automation_incommerce_only.patch" should be applied instead of "in-commerce" file changes within "phrase_storage_automation_modules.patch" patch.
(0003649)
alex   
2011-08-09 12:52   
Reminder sent to: Dmitry

Please test. I think that this will fit nicely into In-Portal 5.1.3.
(0003650)
alex   
2011-08-09 12:53   
(edited on: 2011-08-09 13:48)
Language pack size (for admin console) was decreased for almost 300 phrases and now contains less, then 1000 phrases in it.

Make sure to execute PHP upgrade script, that will delete la_col_ phrases OR use clean install.

Upgrade must be tested for sure.

(0003719)
Dmitry   
2011-09-06 22:30   
Good job overall, but some work is still needed:

1. Your parch is missing SQLs in install_schema.sql and upgrades.sql - attached, but need testing.

2. Added minor improvements to phrase_edit.tpl (included my in patch) in Admin so users can edit all 3 translations while in Debug + going through Content Mode. Before, they could see just 1 translation field there.

3. Tested of Upgrade from 5.1.1 failed - see attached screenshot.

4. Added Hint and Column fields to Phrase Editor in Advanced theme
(0003756)
alex   
2011-09-17 06:26   
Please test only 3 "_v2.patch" files, since they contain all other patches within + some fixes.

Fixed:
1. file "inp_ckeditor.js" was added to original patch by mistake - removed
2. hint and column phrase translations were not shown in non-debug mode, when clicking on "Edit Translation" link in "Content Mode" over the label
3. hint and column phrase translations were not shown at all, when editing Phrase from Regional section (not from "Phrases & Labels" section)
4. empty column phrase translations after upgrade


Changed:
1. simple mode of phrase editing (in "Content Mode") doesn't apply, when debug mode is enabled

TODO before commit:
1. replace "5.1.3-RC2" versions produced by _modules_v2.patch file with "5.1.3" version
(0003757)
Dmitry   
2011-09-17 17:30   
Tested successfully with minor issues.

Please fix, attach new patches and commit into 5.1.3:

1. Please make sure in Simple Preset we do NOT show "Hint Phrase" and "Column Phrase" on Edit Translation form in Content Mode + DBG OFF.

2. Modified On field doesn't change when Phrase translated.

3. Make sure to add $ml_helper->createFields('phrases'); to the Upgrades.php script.
(0003758)
alex   
2011-09-18 08:51   
Fixed.

I've noticed that LastChanged column was never changed due bug in phrase translation change detection since In-Portal 5.1.0 release.
(0003759)
alex   
2011-09-18 09:19   
Fix committed to 5.1.x branch. Commit Message:

Fixes 0001094: Optimizing storage of help phrases
(0003760)
alex   
2011-09-18 09:37   
Reminder sent to: Dmitry

I've commited all changes already. If you wish you can test issues, that you've found last again.
(0003772)
alex   
2011-09-19 16:08   
Closing, since 5.1.3 release has been released.
(0004183)
alex   
2011-11-30 08:17   
Patch "untranslated_phrase_hint_fix.patch" fixes case, when hints for untranslated phrases are displayed, but when phrase is translated then hint disappears.