Automatic phrase type based on it's name

Automatic phrase type based on it's name

Imported from: http://groups.google.com/group/in-portal-dev/browse_thread/thread/c1e6865488461ef6#

I think, that we need a way for In-Portal to automatically guess phrase type based on:

  • user action (that leads to user to phrase adding/editing screen)

  • phrase name (that is entered by user)

By User Action

  • translation phrase while on Front-End (special translate link OR orange edit button) - "Front-End" type;

  • toolbar button "Add" click in phrase list in administrative console - "Admin" type.

By Phrase Name

  • phrase name starts with "lu_" - "Front-End" type;

  • phrase name starts with "la_" - "Admin" type.

Detection by phrase name overrides detection by user action, since it's bad style to mark phrases, that starts with "lu_" belonging to administrative console. 

When both "Phrase Name" and "Phrase Type" fields are visible on phrase adding/editing form, then I also suggest to place "*onblur*" event on "Phrase Name" field to change "Phrase Type", when user starts to enter phrase translation.

In this case we could make "Phrase Type" field read-only to user. There is one small problem with that: phrases, that have "Both" type. We should eliminate that as soon as possible, but in this scheme their type will be changed automatically based on their name.

Related Tasks

https://in-portal.atlassian.net/browse/INP-826

Comments