コード例 #1
0
        /// <summary>
        /// Initializes the localization of the plugin
        /// </summary>
        public static void Initialize(LocaleVersion locale)
        {
            String path = "LibraryDepot.Resources." + locale.ToString();
            resources = new ResourceManager(path, Assembly.GetExecutingAssembly());

            //String __path = "ProjectManager.Resources." + locale.ToString();
        }
コード例 #2
0
ファイル: TextHelper.cs プロジェクト: nestle1998/flashdevelop
        /// <summary>
        /// Gets the specified localized string
        /// </summary>
        public static String GetString(String key)
        {
            String result; String prefix;

            if (PluginBase.MainForm == null || PluginBase.MainForm.Settings == null)
            {
                return(key);
            }
            LocaleVersion localeSetting = PluginBase.MainForm.Settings.LocaleVersion;

            if (resourceManager == null || localeSetting != storedLocale)
            {
                storedLocale = localeSetting;
                String path = "PluginCore.PluginCore.Resources." + storedLocale.ToString();
                resourceManager = new ResourceManager(path, Assembly.GetExecutingAssembly());
            }
            prefix = Assembly.GetCallingAssembly().GetName().Name;
            result = resourceManager.GetString(prefix + "." + key);
            if (result == null)
            {
                result = resourceManager.GetString(key);
            }
            if (result == null)
            {
                TraceManager.Add("No localized string found: " + key);
                result = String.Empty;
            }
            return(result);
        }
コード例 #3
0
        /// <summary>
        /// Initializes the localization of the plugin
        /// </summary>
        public static void Initialize(LocaleVersion locale)
        {
            String path = "LibraryDepot.Resources." + locale.ToString();

            resources = new ResourceManager(path, Assembly.GetExecutingAssembly());

            //String __path = "ProjectManager.Resources." + locale.ToString();
        }
コード例 #4
0
 /// <summary>
 /// Gets the specified localized string
 /// </summary>
 public static string GetString(string key)
 {
     string result;
     LocaleVersion localeSetting = PluginBase.MainForm.Settings.LocaleVersion;
     if (resourceManager == null || localeSetting != storedLocale)
     {
         storedLocale = localeSetting;
         Assembly callingAssembly = Assembly.GetCallingAssembly();
         string prefix = callingAssembly.GetName().Name;
         string path = prefix + ".Resources." + storedLocale.ToString();
         resourceManager = new ResourceManager(path, callingAssembly);
     }
     result = resourceManager.GetString(key);
     if (result == null)
         result = key;
     return result;
 }
コード例 #5
0
        /// <summary>
        /// Gets the specified localized string
        /// </summary>
        public static string GetString(string key)
        {
            string        result;
            LocaleVersion localeSetting = PluginBase.MainForm.Settings.LocaleVersion;

            if (resourceManager == null || localeSetting != storedLocale)
            {
                storedLocale = localeSetting;
                Assembly callingAssembly = Assembly.GetCallingAssembly();
                string   prefix          = callingAssembly.GetName().Name;
                string   path            = prefix + ".Resources." + storedLocale.ToString();
                resourceManager = new ResourceManager(path, callingAssembly);
            }
            result = resourceManager.GetString(key);
            if (result == null)
            {
                result = key;
            }
            return(result);
        }
コード例 #6
0
        private static bool TryGetResourceManager(LocaleVersion locale, string testKey, out ResourceManager manager)
        {
            manager = null;

            try
            {
                Assembly callingAssembly = Assembly.GetCallingAssembly();
                string prefix = callingAssembly.GetName().Name;
                string path = prefix + ".Resources." + locale.ToString();

                var testManager = new ResourceManager(path, callingAssembly);
                var testResult = testManager.GetString(testKey);
                manager = testManager;

                return true;
            }
            catch
            {
                return false;
            }
        }
コード例 #7
0
ファイル: TextHelper.cs プロジェクト: Neverbirth/flashdevelop
 /// <summary>
 /// Gets the specified localized string
 /// </summary>
 public static String GetString(String key)
 {
     String result; String prefix;
     if (PluginBase.MainForm == null || PluginBase.MainForm.Settings == null) return key;
     LocaleVersion localeSetting = PluginBase.MainForm.Settings.LocaleVersion;
     if (resourceManager == null || localeSetting != storedLocale)
     {
         storedLocale = localeSetting;
         String path = "PluginCore.PluginCore.Resources." + storedLocale.ToString();
         resourceManager = new ResourceManager(path, Assembly.GetExecutingAssembly());
     }
     prefix = Assembly.GetCallingAssembly().GetName().Name;
     result = resourceManager.GetString(prefix + "." + key);
     if (result == null) result = resourceManager.GetString(key);
     if (result == null)
     {
         TraceManager.Add("No localized string found: " + key);
         result = String.Empty;
     }
     return result;
 }
コード例 #8
0
        private static bool TryGetResourceManager(LocaleVersion locale, string testKey, out ResourceManager manager)
        {
            manager = null;

            try
            {
                Assembly callingAssembly = Assembly.GetCallingAssembly();
                string   prefix          = callingAssembly.GetName().Name;
                string   path            = prefix + ".Resources." + locale.ToString();

                var testManager = new ResourceManager(path, callingAssembly);
                var testResult  = testManager.GetString(testKey);
                manager = testManager;

                return(true);
            }
            catch
            {
                return(false);
            }
        }
コード例 #9
0
ファイル: LocaleHelper.cs プロジェクト: Dsnoi/flashdevelopjp
 /// <summary>
 /// Initializes the localization of the plugin
 /// </summary>
 public static void Initialize(LocaleVersion locale)
 {
     String path = "MultiView.Resources." + locale.ToString();
     resources = new ResourceManager(path, Assembly.GetExecutingAssembly());
 }
コード例 #10
0
        public static void Initialize(LocaleVersion locale)
        {
            String path = "UnitTestPlugin.Source.Localization." + locale.ToString();

            resources = new ResourceManager(path, Assembly.GetExecutingAssembly());
        }
コード例 #11
0
ファイル: LocaleHelper.cs プロジェクト: Dsnoi/flashdevelopjp
        /// <summary>
        /// Initializes the localization of the plugin
        /// </summary>
        public static void Initialize(LocaleVersion locale)
        {
            String path = "PanelFlashViewer.Resources." + locale.ToString();

            resources = new ResourceManager(path, Assembly.GetExecutingAssembly());
        }
コード例 #12
0
        /// <summary>
        /// Initializes the localization of the plugin
        /// </summary>
        public static void Initialize(LocaleVersion locale)
        {
            String path = "FindReplaceEx.Resources." + locale.ToString();

            resources = new ResourceManager(path, Assembly.GetExecutingAssembly());
        }
コード例 #13
0
        /// <summary>
        /// Initializes the localization of the plugin
        /// </summary>
        public static void Initialize(LocaleVersion locale)
        {
            String path = "AutoBuildPlugin.Resources." + locale.ToString();

            resources = new ResourceManager(path, Assembly.GetExecutingAssembly());
        }
コード例 #14
0
        /// <summary>
        /// Initializes the localization of the plugin
        /// </summary>
        public static void Initialize(LocaleVersion locale)
        {
            String path = "ExcludeGenerator.Resources." + locale.ToString();

            resources = new ResourceManager(path, Assembly.GetExecutingAssembly());
        }