Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add runtime localization support #1036

Merged
merged 6 commits into from
Aug 8, 2018
Merged

Commits on Jul 31, 2018

  1. feat: add runtime localization support

    This patch adds support for runtime localization. A user may now provide a `locale` object (in the same shape as the locales in `/locale/*.json`) to `axe.configure()`.
    
    For example:
    
    ```js
    axe.configure({
      locale: {
        rules: {
          'some-rule': {
            help: 'the help message',
            description: 'the description'
          }
        },
        checks: {
          [...]
        }
      }
    })
    ```
    
    These locale strings are run thru `doT`, enabling template support. For example:
    
    ```js
    axe.configure({
      locale: {
        rules: {
          foo: {
            help: 'some help',
            description: 'foo: {{~it.data:value}} {{=value}}{{~}}.'
          }
        },
        checks: {
          bar: {
            pass: 'the pass message',
            fail: 'something useful: {{~it.data:value}} {{=value}}{{~}}.'
          }
        }
      }
    })
    ```
    
    Upon calling `axe.reset()`, any custom locale will be reset to the "default" axe-core shipped with.
    stephenmathieson committed Jul 31, 2018
    Configuration menu
    Copy the full SHA
    2dbcf8d View commit details
    Browse the repository at this point in the history

Commits on Aug 2, 2018

  1. Configuration menu
    Copy the full SHA
    1067f4a View commit details
    Browse the repository at this point in the history

Commits on Aug 8, 2018

  1. Configuration menu
    Copy the full SHA
    b5b64d8 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8b2c704 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    a60a9ef View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    e036e85 View commit details
    Browse the repository at this point in the history