GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — fred/src/freenet/l10n/NodeL10n.java at master · hyphanet/fred Expand file tree/ Copy pathNodeL10n.javaMore file actions 66 lines (58 loc) · 1.92 KB / Copy pathNodeL10n.javaFile metadata and controls66 lines (58 loc) · 1.92 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 /* This code is part of Freenet. It is distributed under the GNU General * Public License, version 2 (or at your option any later version). See * http://www.gnu.org/ for further details of the GPL. */ package freenet.l10n; import freenet.l10n.BaseL10n.LANGUAGE; import java.io.File; /** * This is the interface used to localize the Node. It just wraps a BaseL10n * with correct parameters so that this class can entierly be used using * static methods, which is much more practical to use than non-static methods. * * Why doesn't that class extends BaseL10n ? Because it has to be static. * * How to change the language ? Simply create a new NodeL1On object. You don't have * to stock the created object because you can access it using static methods. * @author Artefact2 */ public class NodeL10n { private static BaseL10n b; /** * Initialize the Node localization with the node's default language, and * overrides in the working directory. */ public NodeL10n() { this(LANGUAGE.getDefault(), new File(".")); } /** * Initialize the Node localization. You must also call that constructor * if you want to change the language. * @param lang Language to use. * @see LANGUAGE#mapToLanguage(String) */ public NodeL10n(final LANGUAGE lang, File overrideDir) { NodeL10n.b = new BaseL10n("freenet/l10n/", "freenet.l10n.${lang}.properties", overrideDir.getPath()+File.separator+"freenet.l10n.${lang}.override.properties", lang); } /** * Get the BaseL10n used to localize the node. * @return BaseL10n. * @see BaseL10n */ public static BaseL10n getBase() { if(b==null){ new NodeL10n(); } return b; } /** * Sets the {@link BaseL10n} used to localize the node. * <p> * This method should only be used in tests, via {@code BaseL10nTest#useTestTranslation()}! * * @param baseL10n The {@link BaseL10n} object used for localization */ static void setBase(BaseL10n baseL10n) { b = baseL10n; } } |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |