X-Git-Url: https://code.wpia.club/?a=blobdiff_plain;f=src%2Forg%2Fcacert%2Fgigi%2Foutput%2Ftemplate%2FTranslateCommand.java;h=d291e9d414b3d4ce0111b3edf1c1ff85963b9294;hb=e1c81f89220249a3fa65a4438d7b4c11aaff17f6;hp=7b7014e0775feb537428ed1e2c41af8222072d5c;hpb=4c8b6366533470495cfc5fb384a494cbc61abfea;p=gigi.git diff --git a/src/org/cacert/gigi/output/template/TranslateCommand.java b/src/org/cacert/gigi/output/template/TranslateCommand.java index 7b7014e0..d291e9d4 100644 --- a/src/org/cacert/gigi/output/template/TranslateCommand.java +++ b/src/org/cacert/gigi/output/template/TranslateCommand.java @@ -1,15 +1,25 @@ package org.cacert.gigi.output.template; import java.io.PrintWriter; +import java.util.Collection; import java.util.Map; import org.cacert.gigi.localisation.Language; import org.cacert.gigi.util.HTMLEncoder; -public final class TranslateCommand implements Outputable { +/** + * Wraps a String that needs to be translated before it is printed to the user. + */ +public final class TranslateCommand implements Translatable { private final String raw; + /** + * Creates a new TranslateCommand that wraps the given String. + * + * @param raw + * the String to be translated. + */ public TranslateCommand(String raw) { this.raw = raw; } @@ -19,7 +29,17 @@ public final class TranslateCommand implements Outputable { out.print(HTMLEncoder.encodeHTML(l.getTranslation(raw))); } + /** + * Gets the raw, untranslated String. + * + * @return the raw, untranslated String. + */ public String getRaw() { return raw; } + + @Override + public void addTranslations(Collection s) { + s.add(raw); + } }