[CrOS Settings Languages] Remove unnecessary separator line in dialog box

Currently there is an unnecessary separator between the checkboxes
and buttons present on the dialog box when hovering over the single language.
This CL removes that separator, and reveals iff there is more than 1 selected
language.

Bug: 927667
Change-Id: I6907b2d88386105320872849c41c70f5c2a613fc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1524333
Commit-Queue: Regan Hsu <hsuregan@chromium.org>
Reviewed-by: Steven Bennetts <stevenjb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#642045}
diff --git a/chrome/browser/resources/settings/languages_page/languages_page.html b/chrome/browser/resources/settings/languages_page/languages_page.html
index a16b7623..bbc7609 100644
--- a/chrome/browser/resources/settings/languages_page/languages_page.html
+++ b/chrome/browser/resources/settings/languages_page/languages_page.html
@@ -91,7 +91,7 @@
 
       #uiLanguageItem cr-policy-indicator {
         float: right;
-        margin-left: 20px;
+        margin-inline-start: 20px;
       }
 
       .name-with-error-list {
@@ -365,7 +365,7 @@
                       detailLanguage_, languages.translateTarget)]]">
                 $i18n{offerToTranslateInThisLanguage}
               </cr-checkbox>
-              <hr>
+              <hr hidden="[[!shouldShowDialogSeparator_(languages.enabled.*)]]">
               <button class="dropdown-item" role="menuitem"
                   on-click="onMoveToTopTap_"
                   hidden="[[isNthLanguage_(
diff --git a/chrome/browser/resources/settings/languages_page/languages_page.js b/chrome/browser/resources/settings/languages_page/languages_page.js
index 2fdcb73..5ce1ef7 100644
--- a/chrome/browser/resources/settings/languages_page/languages_page.js
+++ b/chrome/browser/resources/settings/languages_page/languages_page.js
@@ -168,6 +168,17 @@
   },
 
   /**
+   * Used to determine whether to show the separator between checkbox settings
+   * and move buttons in the dialog menu.
+   * @return {boolean} True if there is currently more than one selected
+   *     language.
+   * @private
+   */
+  shouldShowDialogSeparator_: function() {
+    return this.languages != undefined && this.languages.enabled.length > 1;
+  },
+
+  /**
    * Used to determine which "Move" buttons to show for ordering enabled
    * languages.
    * @param {number} n