Skip to content

Commit

Permalink
adding NOTE to locale feature describing issues which came up in code…
Browse files Browse the repository at this point in the history
… review
  • Loading branch information
grawk committed Jun 10, 2015
1 parent 4493bf5 commit 9d9ea2b
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -379,9 +379,10 @@ Other than that, the nemo-view uses nemo-locatex internally, so if you change yo
* value: the expected value for the element
* returns: Promise which resolves to true when the expected text matches

## Using LOCALE specific locators
## Using locator specialization

You can specify different locator strings/strategies based on locale. To do so, first modify the entry you wish to be locale-specific:
You can specify different locator strings/strategies based on the `data.locale` configuration value.
To do so, first modify the entry you wish to be specialized:

```js
{
Expand Down Expand Up @@ -409,11 +410,15 @@ changes to
}
```

In order to specify a locale, you need to set the `nemo.data.locale` property. This can either be done directly in the
configuration file, or it can be set "on the fly" with the following command:
You can set the `data.locale` property as follows:

```js
nemo._config.set('data:locale', 'DE');
```

For a working example, refer to the unit tests for the locale feature (found in `test/locale.js`) in this module.

_NOTE: This feature is a carry-over from earlier versions of nemo-view. It is understood now that the above feature does
not actually represent "locale" specificity as defined by bcp47 (https://tools.ietf.org/html/bcp47). See discussion
[here](https://github.com/paypal/nemo-view/pull/32) and issue [here](https://github.com/paypal/nemo-view/issues/33).
Follow along as we discuss a backwards compatible way to resolve this unfortunate nomenclature error.

0 comments on commit 9d9ea2b

Please sign in to comment.