Skip to content

Instantly share code, notes, and snippets.

@rubenv
Created March 26, 2014 08:46
Show Gist options
  • Select an option

  • Save rubenv/9779008 to your computer and use it in GitHub Desktop.

Select an option

Save rubenv/9779008 to your computer and use it in GitHub Desktop.
<!--
Warning: The stuff below will only work if whatever is in type.name has matching string mappings in your .po files.
For instance, if columnTypes is an array in your controller, annotate the strings:
http://angular-gettext.rocketeer.be/dev-guide/annotate-js/
-->
<select ng-model="column.type" ng-options="type.id as translate(type.name) for type in columnTypes"></select>
@rubenv

rubenv commented Mar 26, 2014

Copy link
Copy Markdown
Author

You'll also need to expose translate on the scope:

$rootScope.translate = function(str) {
  return gettextCatalog.getString(str);
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment