Skip to content

Instantly share code, notes, and snippets.

@rubenv
Created March 26, 2014 08:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rubenv/9779008 to your computer and use it in GitHub Desktop.
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
Copy link
Author

rubenv commented Mar 26, 2014

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