-
Notifications
You must be signed in to change notification settings - Fork 0
provide axLocalize directive #38
Comments
Implemented on BREAKING CHANGENote: Strictly speaking, this is not a breaking change within the adapter, but rather a breaking change to LaxarJS UiKit, where the The AngularJS directive
Previous Usage (LaxarJS v1)In the widget controller: function Controller( $scope ) {
// This creates $scope.i18n *implicitly*
var localize = patterns.i18n.handlerFor( $scope ).scopeLocaleFromFeature( 'i18n', {
onChange: function() {
$scope.localValue = localize( $scope.features.someI18nValue );
}
} ).localizer();
} In the template: <p>{{ localValue }}</p>
<p>{{ features.otherI18nValue | axLocalize:i18n }}</p> New Usage (LaxarJS v2)In the widget controller: function Controller( $scope, axI18n ) {
// Create $scope.i18n *explicitly*
$scope.i18n = axI18n;
axI18n.whenLocaleChanged( () => {
$scope.localValue = axI18n.localize( $scope.features.someI18nValue );
} );
} The template looks just like before, but <p>{{ localValue }}</p>
<p>{{ features.otherI18nValue | axLocalize:i18n }}</p> More Breaking ChangesTogether with LaxarJS/laxar#429, this has the following implications:
|
@x1B: Looks great! Care to push a draft so I can give it a try in LaxarJS/laxar-html-display-widget#11? |
It was determined that axI18n is not big enough in LaxarJS v2 to warrant a standalone module (since the UiKit related i18n stuff is now part of laxar-uikit, again).
What remains is basically
axLocalize
. If feasible, let's try to find a LaxarJS v1 compatible solution based on the axI18n injection.The text was updated successfully, but these errors were encountered: