All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.freedesktop.dbus.Gettext Maven / Gradle / Ivy

Go to download

Slightly improved version of the Java DBus library provided by freedesktop.org (https://dbus.freedesktop.org/doc/dbus-java/). Changes: - Fixed lot's of Java warnings - Fixed broken 'Gettext' feature (Exceptions on unsupported languages, usage of "_" as method name). - Renamed some classes/methods/variables to comply with Java naming scheme. - Removed usage of proprietary logger and replaced it with sl4fj. - Renamed/refactored some parts to be more 'Java' like (e.g. naming, shadowing) - Fixed problems with DbusConnection.getConnection(SESSION) when using display export (e.g. SSH X11 forward)

There is a newer version: 3.3.2
Show newest version
/*
 * Pescetti Pseudo-Duplimate Generator
 *
 * Copyright (C) 2007 Matthew Johnson
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License Version 2 as published by
 * the Free Software Foundation.  This program 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 Lesser General Public License for more details.  You should have received a
 * copy of the GNU Lesser General Public License along with this program; if not,
 * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA  02111-1307, USA.
 *
 * To Contact me, please email [email protected]
 *
 */
package org.freedesktop.dbus;

import java.util.ResourceBundle;

public final class Gettext {
    private static ResourceBundle myResources;

    private Gettext() {

    }

    static {
        try {
            myResources = ResourceBundle.getBundle("dbusjava_localized");
        } catch (Exception _ex) {
            // suppress exception if language could not be found
        }
    }

    public static String t(String s) {
        if (myResources == null) {
            return s;
        }
        return myResources.getString(s);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy