Esempio n. 1
0
        public void ChangeLanguage(CultureInfo value)
        {
            string langFile = MakeFileLink(value.Name);

            //_LangContent = LangContent.Read(langFile);
            LangContent = LangContent.Load(langFile);
        }
Esempio n. 2
0
        // Vérifie si le fichier existe et est à jour, sinon fait le nécessaire
        static void CheckFile(string appFolder, string langName)
        {
            LangContent langObj;
            string      langFile = Path.Combine(appFolder, langName, _FileName);

            try
            {
                langObj = LangContent.Load(langFile);

                if (string.IsNullOrEmpty(langObj.Version) || !langObj.Version.Equals(Common.LangVersion))
                {
                    throw new Exception("Bad Version");
                }
            }
            catch
            {
                switch (langName)
                {
                case "fr-FR":
                    langObj = LangContent.DefaultFrench();
                    break;

                default:
                    langObj = LangContent.Default();
                    break;
                }

                langObj.Save(langFile);
            }
        }
Esempio n. 3
0
        public object TranslateValue(string key)
        {
            if (LangContent == null)
            {
                LangContent = LangContent.Default();
            }

            var property = typeof(LangContent).GetProperty(key);

            if (property != null)
            {
                return(property.GetValue(LangContent));
            }
            else
            {
                return($"problem_{key}");
            }
        }
Esempio n. 4
0
        /*
         * internal static void Check(string lang)
         * {
         *  string langFile = Path.Combine(
         *                  AppDomain.CurrentDomain.BaseDirectory, Common.LangFolder, $"Lang.{lang}.xml");
         *
         *  if (File.Exists(langFile) && XML.XMLLang.ShortLoad(langFile).Version.Equals(Common.LangVersion))
         *      return;
         *
         *  if (lang.Equals("en-EN"))
         *      XML.XMLLang.Make_ENVersion();
         *  else if (lang.Equals("fr-FR"))
         *      XML.XMLLang.Make_FRVersion();
         * }*/

        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        internal static LangContent MakeDefault()
        {
            LangContent lang = new LangContent()
            {
                //
                Long_Credits =
                    "#Crédits, Thanks to:\r\n" +
                    "\t- My dear daughter waiting about her father, meanwhile i pack roms... In order to make her discover my youthness.\r\n" +
                    "\t- My ex/wife (she don't want to leave but it's useful, it's something between us) :D.\r\n" +
                    "\t- My beloved cats, those again here, those who left to early ... \r\n" +
                    "\t- DotNetZip creator, very good job, amazing ! \r\n" +
                    "\t- SevenZip creator, big thanks & bravo ! \r\n" +
                    "\r\n\r\n\r\n\t\t\t\t\t\tGreetings.",
                Long_Help =
                    "Step to the left, step to the righ, clap your hands....Ok... sorry... " +
                    "\r\n\r\nIt's a bacic to help you." +
                    "\r\n\r\nWhat is it for... nothing, get out of the way ^^:" +
                    "\r\n\t- In short, it get ONE rom, its images and its xml data to build a compressed file with everything." +
                    "\r\n\t- Be careful, it will not be the same structure but (update) the unpacker is out to help you if you want to reinject" +
                    "\r\n\t- No, it does not affect your info, files, images, etc." +
                    "\r\n\r\n#1: Go to settings to select the Lauchbox folder." +
                    "\r\n\r\n#2: Select an output directory where to put the pack !!! DON'T SELECT the LauncherBox folder !!!" +
                    "\r\n\r\n#3: Optional you can specify the compression algorithm" +
                    "\r\n\r\n#4: The following steps are intuitive, you select the machine, then the game ... go.",
                Long_Rulz =
                    "Two rules:\n" +
                    "- Each Manual must be in a folder having the same system name AS the name in launchbox.\n" +
                    @"    ex: F:\CheadCodes\Sega Megadrive\ && in LaunchBox the system is named Sega Megadrive => Enter F:\CheadCodes\ \n" +
                    "-To select the manuals, they must have a name beginning by the Name of the game + \"-\" + (optionnal)something \n" +
                    @"    ex: For Sonic, Cheadcode archive must begin by 'Sonic-'\n\n" +
                    "Note: As much archive as you want.",
            };

            lang.SetDefault(Common.LangVersion);

            return(lang);
        }
Esempio n. 5
0
        internal static LangContent DefaultFrench()
        {
            LangContent lang = new LangContent()
            {
                Choose_Games  = "Choisir un/des jeu(x)",
                Choose_System = "Choisissez un système (Consoles)",
                //
                Comp_Lvl = "Niveau de compression",
                Comp_Moy = "Rapide",
                Comp_Zip = "Compression Zip",
                Comp_7Z  = "Compression 7Zip",
                //
                Opt_CopyClones = "Copie des clones",
                Opt_CopyCheats = "Copie des cheatcodes",
                Opt_EnXB       = "Copie XML amélioré",
                Opt_OriXB      = "Copie XML originel",
                Opt_TViewF     = "Fichier d'arborescence",
                Opt_Window     = "Fenêtre de traçage",
                //
                Q_KeepIt    = "Voulez vous le garder ?",
                Q_Pack      = "Packer ce jeu",
                Q_PackGames = "Etes vous sûr(e) de vouloir packer ces jeux ?",
                //
                S_ArchiveName = "Nom d'archive",

                S_EnterYourCC    = "Entrez vos codes de triche",
                S_GameStatus     = "Etat du jeu",
                S_GameStatus4    = "Etat du jeu pour",
                S_GameTitle      = "Titre du jeu",
                S_GiveArchName   = "Donnez un nom d'archive",
                S_MainLAppBroken = "Lien de l'application principale cassé",
                S_SearchFor      = "Recherche de",
                S_WidthLimit     = "Limite de largeur",
                //
                Word_Active  = "Activé",
                Word_Extract = "Extraire",
                Word_Format  = "Formatter",
                Word_Params  = "Paramètres",
                Word_Region  = "Région",
                Word_Title   = "Titre",

                //
                Long_Credits =
                    "#Crédits, Merci à:\r\n" +
                    "\t- Ma petite puce qui patiente pendant que papa fait des packs de rom... Afin de lui faire découvrir mon adolescence.\r\n" +
                    "\t- Mon ex - femme(qui se tape l'incruste, mais c'est pratique) :D.\r\n" +
                    "\t- Mes chachats, ceux qui sont là, ceux qui sont partis trop tôt... \r\n" +
                    "\t- Le créateur de DotNetZip, très bon job, vraiment balaise! \r\n" +
                    "\t- Le créateur de SevenZip, merci et bravo ! \r\n" +
                    "\r\n\r\n\r\n\t\t\t\t\t\tAmitiés.",
                Long_Help =
                    "Step to the left, step to the righ, clap your hands....Ok... sorry... " +
                    "\r\n\r\nC'est une version basique pour vous aider." +
                    "+\r\n\r\nA quoi ça sert...  a rien, barrez vous ^ ^:" +
                    "\r\n\t- Bref, ça récupère UNE rom, ses images et ses datas xml pour construire un zip avec le tout." +
                    "\r\n\t- Attention, ça ne sera pas la même structure mais (update) l'unpacker est sorti pour vous aider si vous voulez réinjecter" +
                    "\r\n\t- Non, ça n'altère en rien vos infos, vos fichiers, vos images, etc" +
                    "\r\n\r\n#1: Allez dans les paramètres pour sélectionner le dossier de Lauchbox." +
                    "\r\n\r\n#2: Selectionner un répertoire de sortie où mettre le pack. !!! NE SELECTIONNEZ PAS le dossier LauncherBox !!!" +
                    "\r\n\r\n#3: Optionnel vous pouvez spécifier l'algorithme de compression" +
                    "\r\n\r\n#4: Les étapes suivantes sont intuitives, vous sélectionez la machine, puis le jeu... go.",
                Long_Rulz =
                    "Deux règles:" + Environment.NewLine +
                    "-Chaque Manuel doit être dans un dossier ayant le même nom de système que le nom dans LaunchBox." + Environment.NewLine +
                    @"    ex: F:\CheadCodes\Sega Megadrive\ && dans LaunchBox le système est nommée Sega Megadrive => Entrez F:\CheadCodes\" + Environment.NewLine +
                    "-Pour sélectionner les manuels, ils doivent avoir un nom commençant par le Nom du jeu + \"-\" + (optionnel)quelque chose." + Environment.NewLine +
                    @"    ex: Pour Sonic, l'Archive Cheadcode doit commencer par  'Sonic-'" + Environment.NewLine + Environment.NewLine +
                    "Note: Autant d'archives que vous voulez.",
            };

            lang.SetFrenchDefault(Common.LangVersion);
            return(lang);
        }