Uploaded image for project: 'Rules Repository'
  1. Rules Repository
  2. RSPEC-1926

Labels should be defined in the resource bundle

    XMLWordPrintable

    Details

    • Type: Bug Detection
    • Status: Active
    • Resolution: Unresolved
    • Labels:
    • Message:
      Define this label in the resource bundle.
    • List of parameters:
      • key: attributes
        • description: Attributes
        • default: outputLabel.value, outputText.value
    • Default Severity:
      Major
    • Impact:
      Low
    • Likelihood:
      High
    • Legacy Key:
      InternationalizationCheck
    • Covered Languages:
      HTML
    • Remediation Function:
      Constant/Issue
    • Constant Cost:
      15min

      Description

      Web applications can be made available in multiple languages through the use of internationalization. This allows the server to plug in the correct version of a piece of text based on the language chosen, but it requires that internationalization messages be used instead of hard-coded text.

      Noncompliant Code Example

        <form method="post">
          <label for="username">Username:</label>  <!-- Noncompliant -->
          <input type="text" id="username" name="username">
          <br>
          <label for="password">Password:</label>  <!-- Noncompliant -->
          <input type="password" id="password" name="password">
          <br>
          <input type="submit" name="submit" value="${buttonValue}">
        </form>
      

      Compliant Solution

        <form method="post">
          <label for="username"><fmt:message key="login.label.username" />:</label>
          <input type="text" id="username" name="username">
          <br>
          <label for="password"><fmt:message key="login.label.password" />:</label>
          <input type="password" id="password" name="password">
          <br>
          <input type="submit" name="submit" value="${buttonValue}">
        </form>
      

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            ann.campbell.2 Ann Campbell
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: