Unexpected output: Affected paths: relative - resubmit patch.
⚙ D156 INP-1505 - Restore e-mail template translation sync code removed during merge
Page MenuHomeIn-Portal Phabricator

INP-1505 - Restore e-mail template translation sync code removed during merge
ClosedPublic

Authored by alex on Oct 8 2015, 6:22 AM.

Details

Test Plan
NOTE: Here is how it should work for both Phrases & E-mail Templates, but I'll explain using Phrases.
NOTE: Pick any phrase for tests and use it only.

Some common logic that is used:

  • the Translation in Sync and Translate From Language fields are never shown for primary language
  • the Source ... fields always show value (and have that language in title) from translation source language (if non set will fallback to primary)
  • each phrase have it's own translation state
  • saving phrase (even without translation change) would make it in sync automatically
  • saving as primary would force other translation of same phrase to look back into that language for original translation (during editing only, no effect when phrases are used on other pages)

Part 1

  1. create 2 more languages to result in 3 languages total
  2. show (via column picker) the Translation in Sync and Translate From Language columns in grid
  3. confirm, that for picked phrase:
    • Translation in Sync says Yes
    • Translate From Language is empty

Part 2

  1. select primary language in dropdown above the grid
  2. open picked phrase for editing
  3. confirm, that same language is auto-selected in editing form language dropdown
  4. confirm, that Translation in Sync field isn't shown
  5. confirm, that Source ... fields (see next part) are not shown
  6. change translation
  7. press Save
  8. confirm, that for that phrase record:
    • Translation in Sync says Yes
    • Translate From Language is empty

Part 3

  1. select non-primary language in dropdown above the grid
  2. open picked phrase for editing
  3. confirm, that same language is auto-selected in editing form language dropdown
  4. confirm, that Translation in Sync field is shown and has Yes value
  5. confirm, that below each translatable input/textarea there is another field added:
    • looks like label (might have grey background and black border for e-mail templates)
    • has title in this format: "Source {FieldTitle} (from {LanguageTitle}):"
      • {FieldTitle} is title of above shown field
      • {LanguageTitle} is primary language name
  6. change translation
  7. press Save
  8. confirm, that for that phrase record:
    • Translation in Sync says Yes
    • Translate From Language is empty

Part 4

  1. select primary language in dropdown above the grid
  2. open picked phrase for editing
  3. confirm, that same language is auto-selected in editing form language dropdown
  4. confirm, that Translation in Sync field isn't shown
  5. confirm, that Source ... fields are not shown
  6. change translation
  7. press Use as Primary
  8. confirm, that for that phrase record:
    • Translation in Sync says Yes
    • Translate From Langauge is empty
  9. for each non-primary language: select language in dropdown above the grid
  10. confirm, that for that phrase record:
    • Translation in Sync says No
    • Translate From Langauge says LanguageTitle (the LanguageTitle is name of primary language)

Part 5

  1. select non-primary language in dropdown above the grid
  2. open picked phrase for editing
  3. confirm, that same language is auto-selected in editing form language dropdown
  4. confirm, that Translation in Sync shows and has No value
  5. confirm, that below each translatable input/textarea there is another field added:
    • looks like label (might have grey background and black border for e-mail templates)
    • has title in this format: "Source {FieldTitle} (from {LanguageTitle}):"
      • {FieldTitle} is title of above shown field
      • {LanguageTitle} is primary language name
  6. change translation
  7. press Save
  8. confirm, that for that phrase record on that non-primary language:
    • Translation in Sync says Yes
    • Translate From Langauge is empty
  9. select other non-prmary language in dropdown above the grid
  10. confirm, that for that phrase record and other non-primary language:
    • Translation in Sync says No
    • Translate From Langauge says LanguageTitle (the LanguageTitle is name of primary language)

Part 6

  1. repeat Part 4 and Part 5, but this time press Use as Primary during phrase editing on non-primary language
  2. confirm, that in places where LangaugeTitle was used that language (for which Use as Primary was used):
    • is shown instead of primary language in "Source ..." field titles
    • used to get original translation in "Source ..." field values
    • shown as "Translate From Language" column/field value

Part 7

  1. disable Custom module
  2. start adding new phrase/e-mail template
  3. confirm, that Core module was selected automatically
  4. enable Custom module
  5. start adding new phrase/e-mail template
  6. confirm, that Custom module was selected automatically

Part 8

  1. change interface preset to simple
  2. confirm, that Translation in Sync and Translate From Language columns are hidden from grid
  3. confirm, that Translation in Sync and Source ... fields are hidden from editing form
  4. confirm, that Use as Primary button is hidden from editing form

Diff Detail

Repository
rINP In-Portal
Branch
/in-portal/branches/5.3.x
Lint
Lint ErrorsExcuse: CS fixes not included, because only previously existing code is brought back as-is
SeverityLocationCodeMessage
Erroradmin/system_presets/simple/email_templates_email-template.php:21PHPCS.E.CodingStandard.Array.Array.SpaceAfterKeywordCodingStandard.Array.Array.SpaceAfterKeyword
Erroradmin/system_presets/simple/email_templates_email-template.php:21PHPCS.E.Generic.PHP.LowerCaseKeyword.FoundGeneric.PHP.LowerCaseKeyword.Found
Erroradmin/system_presets/simple/email_templates_email-template.php:55PHPCS.E.CodingStandard.Array.Array.SpaceAfterKeywordCodingStandard.Array.Array.SpaceAfterKeyword
Erroradmin/system_presets/simple/email_templates_email-template.php:55PHPCS.E.Generic.PHP.LowerCaseKeyword.FoundGeneric.PHP.LowerCaseKeyword.Found
Errorcore/units/email_templates/email_template_eh.php:254PHPCS.E.CodingStandard.Commenting.FunctionComment.InvalidReturnCodingStandard.Commenting.FunctionComment.InvalidReturn
Errorcore/units/email_templates/email_template_eh.php:257PHPCS.E.CodingStandard.NamingConventions.ValidFunctionName.PublicUnderscoreCodingStandard.NamingConventions.ValidFunctionName.PublicUnderscore
Errorcore/units/email_templates/email_template_eh.php:259PHPCS.E.CodingStandard.Array.Array.SpaceAfterKeywordCodingStandard.Array.Array.SpaceAfterKeyword
Errorcore/units/email_templates/email_template_eh.php:259PHPCS.E.Generic.PHP.LowerCaseKeyword.FoundGeneric.PHP.LowerCaseKeyword.Found
Errorcore/units/email_templates/email_template_eh.php:261PHPCS.E.CodingStandard.WhiteSpace.ControlStructureSpacing.SpaceBeforeCloseBraceCodingStandard.WhiteSpace.ControlStructureSpacing.SpaceBeforeCloseBrace
Errorcore/units/email_templates/email_template_eh.php:261PHPCS.E.CodingStandard.WhiteSpace.ControlStructureSpacing.SpacingAfterOpenBraceCodingStandard.WhiteSpace.ControlStructureSpacing.SpacingAfterOpenBrace
Errorcore/units/email_templates/email_template_eh.php:334PHPCS.E.CodingStandard.WhiteSpace.ControlStructureSpacing.SpaceBeforeCloseBraceCodingStandard.WhiteSpace.ControlStructureSpacing.SpaceBeforeCloseBrace
Errorcore/units/email_templates/email_template_eh.php:334PHPCS.E.CodingStandard.WhiteSpace.ControlStructureSpacing.SpacingAfterOpenBraceCodingStandard.WhiteSpace.ControlStructureSpacing.SpacingAfterOpenBrace
Errorcore/units/email_templates/email_template_eh.php:437PHPCS.E.CodingStandard.Commenting.FunctionComment.InvalidReturnCodingStandard.Commenting.FunctionComment.InvalidReturn
Errorcore/units/email_templates/email_template_eh.php:442PHPCS.E.CodingStandard.Array.Array.SpaceAfterKeywordCodingStandard.Array.Array.SpaceAfterKeyword
Errorcore/units/email_templates/email_template_eh.php:442PHPCS.E.Generic.PHP.LowerCaseKeyword.FoundGeneric.PHP.LowerCaseKeyword.Found
Errorcore/units/email_templates/email_template_eh.php:727PHPCS.E.CodingStandard.Commenting.DocComment.TagValueIndentCodingStandard.Commenting.DocComment.TagValueIndent
Errorcore/units/email_templates/email_template_eh.php:727PHPCS.E.CodingStandard.Commenting.FunctionComment.MissingParamCommentCodingStandard.Commenting.FunctionComment.MissingParamComment
Errorcore/units/email_templates/email_template_eh.php:728PHPCS.E.CodingStandard.Commenting.DocComment.NonParamGroupCodingStandard.Commenting.DocComment.NonParamGroup
Errorcore/units/email_templates/email_template_eh.php:729PHPCS.E.CodingStandard.Commenting.DocComment.NonParamGroupCodingStandard.Commenting.DocComment.NonParamGroup
Errorcore/units/email_templates/email_template_eh.php:741PHPCS.E.CodingStandard.Classes.ClassDeclaration.SpaceBeforeCloseBraceCodingStandard.Classes.ClassDeclaration.SpaceBeforeCloseBrace
Errorcore/units/email_templates/email_template_tp.php:105PHPCS.E.CodingStandard.Commenting.FunctionComment.IncorrectParamVarNameCodingStandard.Commenting.FunctionComment.IncorrectParamVarName
Errorcore/units/email_templates/email_template_tp.php:105PHPCS.E.CodingStandard.Commenting.FunctionComment.MissingParamCommentCodingStandard.Commenting.FunctionComment.MissingParamComment
Warningadmin/system_presets/simple/email_templates_email-template.php:21PHPCS.W.CodingStandard.Array.Array.LastCommaCodingStandard.Array.Array.LastComma
Warningadmin/system_presets/simple/email_templates_email-template.php:38PHPCS.W.CodingStandard.Array.Array.NoLastCommaCodingStandard.Array.Array.NoLastComma
Warningcore/units/email_templates/email_template_eh.php:335PHPCS.W.Generic.Files.LineLength.TooLongGeneric.Files.LineLength.TooLong
Unit
No Unit Test Coverage
Build Status
Buildable 214
Build 214: arc lint + arc unit

Event Timeline

alex updated this revision to Diff 372.Oct 8 2015, 6:22 AM
alex retitled this revision from to INP-1505 - Restore e-mail template translation sync code removed during merge.
alex updated this object.
alex edited the test plan for this revision. (Show Details)
alex added 1 JIRA issue(s): INP-1505.
alex edited the test plan for this revision. (Show Details)Oct 8 2015, 6:23 AM
alex edited edge metadata.
alex edited the test plan for this revision. (Show Details)
alex edited the test plan for this revision. (Show Details)
alex edited the test plan for this revision. (Show Details)
alex edited the test plan for this revision. (Show Details)Oct 8 2015, 6:38 AM
glebs accepted this revision.Oct 16 2015, 2:28 AM
glebs edited edge metadata.
This revision is now accepted and ready to land.Oct 16 2015, 2:28 AM
This revision was automatically updated to reflect the committed changes.