zurb/foundation — Issue #252: Orbit nav button text can't be changed
Author: ctorgalson
Created: 2012-01-25 04:02:39+00:00
State: open

In Orbit 1.3.0, there's no way to alter the "Left" and "Right" text used to manually move from one slide to the next. This is minor issue when localizing a site using Orbit into a non-English language. In e.g. Drupal, you'd usually insert translatable text in Javascript like this:

```javascript
var translatableElement = '

' + Drupal.t('Translatable Text') + '

';
```

The easiest way to do this in Orbit is to move the variable "directionalNavHTML" into the "defaults" object, and changing all calls for "this.directionalNavHTML" to "this.options.directionalNavHTML". This has the slight disadvantage that anyone implementing Orbit who changes the setting may break the nav (e.g. by assigning classes other than 'left' or 'right').

On the other hand, it would be possible to provide overridable defaults just for the actual text 'Left' and 'Right', but since the directional nav markup is provided **before** the options object is merged with the defaults object, it would necessitate rearranging a bunch of code.