// Path: old Files/src/fr/tikione/steam/cleaner/Main.java
// public class Main {
// 
// 	public static final String CONF_ENCODING = StandardCharsets.UTF_8.name();
// 	public static final String CONF_NEWLINE = "\r\n";
// 	public static final Locale SYS_LOCALE = Locale.getDefault();
// 	public static boolean ARG_PORTABLE;
// 	public static boolean BUNDLED_JVM;
// 
// 	/**
// 	 * The application launcher. Starts GUI.
// 	 *
// 	 * @param args command-line arguments.
// 	 */
// 	public static void main(String[] args) {
// 		
// 		// Detect bundled JVM.
// 		File jre = new File("./jre/");
// 		BUNDLED_JVM = jre.isDirectory() && jre.exists();
// 
// 		Log.info("-------------------------------------------------");
// 		Log.info("Application started; version is " + Version.VERSION
// 				+ "; default encoding is " + CONF_ENCODING
// 				+ "; default locale is " + SYS_LOCALE.toString()
// 				+ "; bundledJVM " + (BUNDLED_JVM ? "present" : "not found, will use system JVM"));
// 		try {
// 			javax.swing.UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
// 		} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException e) {
// 			Log.error(e);
// 		}
// 		try {
// 			JFrameMain gui = new JFrameMain();
// 			gui.setVisible(true);
// 		} catch (IOException | InfinitiveLoopException ex) {
// 			Log.error(ex);
// 		}
// 	}
// 
// 	/** Suppresses default constructor, ensuring non-instantiability. */
// 	private Main() {
// 	}
// }
// 
// Path: src/fr/tikione/steam/cleaner/util/conf/I18nEncoding.java
// public class I18nEncoding {
// 
//     /** Singleton handler. */
//     private static final I18nEncoding i18nEncoding;
// 
//     /** File to use for configuration loading and saving. */
//     private final File configFile;
// 
//     /** Configuration object. */
//     private final Ini ini;
// 
//     static {
//         // Singleton creation.
//         try {
//             i18nEncoding = new I18nEncoding();
//         } catch (IOException ex) {
//             Log.error(ex);
//             throw new RuntimeException(ex);
//         }
//     }
// 
//     /**
//      * Get the configuration handler as a singleton.
//      *
//      * @return the configuration handler singleton.
//      */
//     public static synchronized I18nEncoding getInstance() {
//         return i18nEncoding;
//     }
// 
//     /**
//      * Load application configuration file.
//      *
//      * @throws IOException if an I/O error occurs while retrieving the internal default configuration file.
//      */
//     private I18nEncoding()
//             throws IOException {
//         configFile = new File("conf/i18n/encoding.ini");
//         ini = new Ini();
//         ini.getConfig().enableParseLineConcat(true);
//         ini.getConfig().enableReadUnicodeEscConv(true);
//         ini.load(configFile, Main.CONF_ENCODING);
//     }
// 
//     public String getLngEncoding(String locale)
//             throws CharConversionException,
//                    InfinitiveLoopException {
//         return ini.getKeyValue(Main.CONF_ENCODING, "", locale);
//     }
// }


import fr.tikione.ini.InfinitiveLoopException;
import fr.tikione.ini.Ini;
import fr.tikione.steam.cleaner.Main;
import fr.tikione.steam.cleaner.util.conf.I18nEncoding;
import java.io.CharConversionException;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.PatternSyntaxException;
            return " ??? ";
        }
    }

    public static List<CountryLanguage> getAvailLangList()
            throws IOException,
                   CharConversionException,
                   InfinitiveLoopException {
        List<CountryLanguage> langList = new ArrayList<>(2);
        File i18nFolder = new File(CONF_BASEPATH);
        File[] langFiles = i18nFolder.listFiles((File dir, String name) -> name.endsWith(CONF_EXT) && !name.equalsIgnoreCase("encoding.ini"));
        Ini langIni = new Ini();
        for (File langFile : langFiles) {
            langIni.load(langFile, Main.CONF_ENCODING);
            String langDesc = langIni.getKeyValue(" ??? ", "", "name");
            String langFilename = langFile.getName();
            langFilename = langFilename.substring(0, langFilename.indexOf('.'));
            langList.add(new CountryLanguage(langFilename, langDesc));
        }
        return langList;
    }

    @SuppressWarnings("CallToThreadDumpStack")
    public static String getSystemLangIfAvailable(List<CountryLanguage> availLangList) {
        String sysLang = DEFAULT_LANGCODE;
        try {
            String userLanguage = System.getProperty("user.language");
            String userCountry = System.getProperty("user.country");
            String userLocale = userLanguage + "_" + userCountry;
            SEARCH_LANG:
// Path: old Files/src/fr/tikione/steam/cleaner/Main.java
// public class Main {
// 
// 	public static final String CONF_ENCODING = StandardCharsets.UTF_8.name();
// 	public static final String CONF_NEWLINE = "\r\n";
// 	public static final Locale SYS_LOCALE = Locale.getDefault();
// 	public static boolean ARG_PORTABLE;
// 	public static boolean BUNDLED_JVM;
// 
// 	/**
// 	 * The application launcher. Starts GUI.
// 	 *
// 	 * @param args command-line arguments.
// 	 */
// 	public static void main(String[] args) {
// 		
// 		// Detect bundled JVM.
// 		File jre = new File("./jre/");
// 		BUNDLED_JVM = jre.isDirectory() && jre.exists();
// 
// 		Log.info("-------------------------------------------------");
// 		Log.info("Application started; version is " + Version.VERSION
// 				+ "; default encoding is " + CONF_ENCODING
// 				+ "; default locale is " + SYS_LOCALE.toString()
// 				+ "; bundledJVM " + (BUNDLED_JVM ? "present" : "not found, will use system JVM"));
// 		try {
// 			javax.swing.UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
// 		} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException e) {
// 			Log.error(e);
// 		}
// 		try {
// 			JFrameMain gui = new JFrameMain();
// 			gui.setVisible(true);
// 		} catch (IOException | InfinitiveLoopException ex) {
// 			Log.error(ex);
// 		}
// 	}
// 
// 	/** Suppresses default constructor, ensuring non-instantiability. */
// 	private Main() {
// 	}
// }
// 
// Path: src/fr/tikione/steam/cleaner/util/conf/I18nEncoding.java
// public class I18nEncoding {
// 
//     /** Singleton handler. */
//     private static final I18nEncoding i18nEncoding;
// 
//     /** File to use for configuration loading and saving. */
//     private final File configFile;
// 
//     /** Configuration object. */
//     private final Ini ini;
// 
//     static {
//         // Singleton creation.
//         try {
//             i18nEncoding = new I18nEncoding();
//         } catch (IOException ex) {
//             Log.error(ex);
//             throw new RuntimeException(ex);
//         }
//     }
// 
//     /**
//      * Get the configuration handler as a singleton.
//      *
//      * @return the configuration handler singleton.
//      */
//     public static synchronized I18nEncoding getInstance() {
//         return i18nEncoding;
//     }
// 
//     /**
//      * Load application configuration file.
//      *
//      * @throws IOException if an I/O error occurs while retrieving the internal default configuration file.
//      */
//     private I18nEncoding()
//             throws IOException {
//         configFile = new File("conf/i18n/encoding.ini");
//         ini = new Ini();
//         ini.getConfig().enableParseLineConcat(true);
//         ini.getConfig().enableReadUnicodeEscConv(true);
//         ini.load(configFile, Main.CONF_ENCODING);
//     }
// 
//     public String getLngEncoding(String locale)
//             throws CharConversionException,
//                    InfinitiveLoopException {
//         return ini.getKeyValue(Main.CONF_ENCODING, "", locale);
//     }
// }


// Path: old Files/src/fr/tikione/steam/cleaner/util/Translation.java
import fr.tikione.ini.InfinitiveLoopException;
import fr.tikione.ini.Ini;
import fr.tikione.steam.cleaner.Main;
import fr.tikione.steam.cleaner.util.conf.I18nEncoding;
import java.io.CharConversionException;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.PatternSyntaxException;

            return " ??? ";
        }
    }

    public static List<CountryLanguage> getAvailLangList()
            throws IOException,
                   CharConversionException,
                   InfinitiveLoopException {
        List<CountryLanguage> langList = new ArrayList<>(2);
        File i18nFolder = new File(CONF_BASEPATH);
        File[] langFiles = i18nFolder.listFiles((File dir, String name) -> name.endsWith(CONF_EXT) && !name.equalsIgnoreCase("encoding.ini"));
        Ini langIni = new Ini();
        for (File langFile : langFiles) {
            langIni.load(langFile, Main.CONF_ENCODING);
            String langDesc = langIni.getKeyValue(" ??? ", "", "name");
            String langFilename = langFile.getName();
            langFilename = langFilename.substring(0, langFilename.indexOf('.'));
            langList.add(new CountryLanguage(langFilename, langDesc));
        }
        return langList;
    }

    @SuppressWarnings("CallToThreadDumpStack")
    public static String getSystemLangIfAvailable(List<CountryLanguage> availLangList) {
        String sysLang = DEFAULT_LANGCODE;
        try {
            String userLanguage = System.getProperty("user.language");
            String userCountry = System.getProperty("user.country");
            String userLocale = userLanguage + "_" + userCountry;
            SEARCH_LANG:
            for (CountryLanguage lang : availLangList) {