Skip to content

Commit

Permalink
#213 cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
syjer committed Oct 18, 2016
1 parent 0dcecc0 commit c3efdda
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions src/main/java/alfio/util/TemplateManager.java
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
/**
* This file is part of alf.io.
*
* <p>
* alf.io is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* <p>
* alf.io is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* <p>
* You should have received a copy of the GNU General Public License
* along with alf.io. If not, see <http://www.gnu.org/licenses/>.
*/
Expand Down Expand Up @@ -287,14 +287,14 @@ void addChild(Node node) {
}

void addText(String text) {
if(text.length() > 0) {
if (text.length() > 0) {
addChild(new TextNode(text));
}
}

void addI18NNode(int startIdx) {
addChild(new I18NNode(startIdx));
currentLevel = currentLevel.children.get(currentLevel.children.size() -1);
currentLevel = currentLevel.children.get(currentLevel.children.size() - 1);
}

void focusToParent() {
Expand All @@ -316,7 +316,7 @@ void addChild(Node node) {
}

public void visit(StringBuilder sb, Locale locale, MessageSource messageSource) {
for(Node node : children) {
for (Node node : children) {
node.visit(sb, locale, messageSource);
}
}
Expand Down Expand Up @@ -345,7 +345,7 @@ static class I18NNode extends Node {
@Override
public void visit(StringBuilder sb, Locale locale, MessageSource messageSource) {
StringBuilder internal = new StringBuilder();
for(Node node : children) {
for (Node node : children) {
node.visit(internal, locale, messageSource);
}

Expand All @@ -354,10 +354,7 @@ public void visit(StringBuilder sb, Locale locale, MessageSource messageSource)
List<String> args = extractParameters(childTemplate);
String text = messageSource.getMessage(key, args.toArray(), locale);

//
//FIXME add support for parameters :)
sb.append(text);
//
}
}

Expand Down

0 comments on commit c3efdda

Please sign in to comment.