Uploaded image for project: 'In-Portal CMS'
  1. In-Portal CMS
  2. INP-894

Optimizing storage of help phrases

    XMLWordPrintable

    Details

    • Additional information:
      Hide

      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

      [b]TODO[/b]
      I wasn't able to remove "title" attribute in "inp_edit_*" block on edit templates due lack of time.
      Goal is to remove [b]title="la_fld_FieldName"[/b] when tag contains [b]field="FieldName"[/b].

      Show
      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 [b] TODO [/b] I wasn't able to remove "title" attribute in "inp_edit_*" block on edit templates due lack of time. Goal is to remove [b] title="la_fld_FieldName" [/b] when tag contains [b] field="FieldName" [/b] .
    • Change Log Message:
      Changed a way how helping phrases (hints) are stored
    • External issue ID:
      1094
    • Copy Issue Key:
    • Patch Instructions:

      Patches must be submitted through Phabricator.

      Description

      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 [b]HintTranslation[/b] column into [b]Phrase[/b] table, right after [b]Translation[/b] 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 "[b]hint:[/b]" 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 [b]inp_edit_box[/b] block via [b]hint_label[/b] parameter in template. When not specified, then we'll assume, that hint phrase is "[b]hint:[/b]" + 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 [b]Name[/b], then corresponding phrase to show is "la_fld_[b]Name[/b]". This way regular form field code in template would became [b]<inp2:m_RenderElement name="inp_edit_box" field="Name"/>[/b] instead of [b]<inp2:m_RenderElement name="inp_edit_box" field="Name" title="la_fld_Name" hint_label="la_hint_Name"/>[/b].

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

      Same way we can get rid of specifying "[b]la_col_Name[/b]" in every grid column definition, however in 99% cases it matches "[b]la_col_[/b]" + [b]FieldName[/b] formula.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                alex Alex
                Reporter:
                alex Alex
                Developer:
                Alex
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: