Skip to content

Commit

Permalink
Update i18n addon to flow classes.
Browse files Browse the repository at this point in the history
  • Loading branch information
simpletasks committed Apr 28, 2019
1 parent 65ca548 commit de4c933
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
3 changes: 2 additions & 1 deletion addons/i18n/src/main/java/org/vaadin/spring/i18n/I18N.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
import org.springframework.context.ApplicationContext;
import org.springframework.context.NoSuchMessageException;

import com.vaadin.ui.UI;
import com.vaadin.flow.component.UI;


/**
* Helper class for resolving messages in a Vaadin UI. This is effectively a wrapper around
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@

import java.util.Locale;

import com.vaadin.ui.Component;
import com.vaadin.ui.HasComponents;
import com.vaadin.ui.UI;
import com.vaadin.flow.component.Component;
import com.vaadin.flow.component.UI;

/**
* Implementation of {@link Translatable} intended to be used as a delegate by an owning {@link UI}.
Expand Down Expand Up @@ -50,11 +49,7 @@ private void updateMessageStrings(Locale locale, Component component) {
if (component instanceof Translatable) {
((Translatable) component).updateMessageStrings(locale);
}
if (component instanceof HasComponents) {
for (Component child : (HasComponents) component) {
updateMessageStrings(locale, child);
}
}
component.getChildren().forEach(child -> updateMessageStrings(locale, child));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

import java.util.Locale;

import com.vaadin.server.VaadinRequest;
import com.vaadin.ui.UI;
import com.vaadin.flow.component.UI;
import com.vaadin.flow.server.VaadinRequest;

/**
* Base class intended to make it easier to write UIs that needs to support changing the locale on the fly.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@
*/
package org.vaadin.spring.i18n;

import com.vaadin.ui.UI;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.springframework.context.ApplicationContext;
import org.springframework.context.NoSuchMessageException;

import com.vaadin.flow.component.UI;

import java.util.Locale;

import static org.junit.Assert.assertEquals;
Expand Down

0 comments on commit de4c933

Please sign in to comment.