Adding multi language support 40/304340/4 accepted/tizen/unified/20240118.114132
authortarunkumarmahay1999 <tarun.mahay@samsung.com>
Tue, 16 Jan 2024 07:22:48 +0000 (12:52 +0530)
committertarunkumarmahay1999 <tarun.mahay@samsung.com>
Tue, 16 Jan 2024 10:19:02 +0000 (15:49 +0530)
Change-Id: Ibc153463450c8e1f357020cc65cea42688c9cd80
Signed-off-by: tarunkumarmahay1999 <tarun.mahay@samsung.com>
13 files changed:
TaskBar/Common/MultiResourceManager.cs [new file with mode: 0644]
TaskBar/Common/Resources.cs
TaskBar/Models/AppInfoModel.cs
TaskBar/TaskBar.cs
TaskBar/TaskBar.csproj
TaskBar/TextResources/LanguageResources.Designer.cs [new file with mode: 0644]
TaskBar/TextResources/LanguageResources.en-US.resx [new file with mode: 0644]
TaskBar/TextResources/LanguageResources.ko-KR.resx [new file with mode: 0644]
TaskBar/TextResources/LanguageResources.resx [new file with mode: 0644]
TaskBar/ViewModels/QuickAccessViewModel.cs
TaskBar/Views/AppItemView.cs
TaskBar/Views/MainView.cs
packaging/org.tizen.taskbar-1.0.0.tpk

diff --git a/TaskBar/Common/MultiResourceManager.cs b/TaskBar/Common/MultiResourceManager.cs
new file mode 100644 (file)
index 0000000..746c72c
--- /dev/null
@@ -0,0 +1,29 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Globalization;
+using System.Reflection;
+using System.Resources;
+
+namespace TaskBar.Common
+{
+    public class MultiResourceManager : ResourceManager
+    {
+        public MultiResourceManager(string baseName, Assembly assembly)
+            : base(baseName, assembly)
+        {
+        }
+
+        public override string GetString(string name)
+        {
+            return base.GetString(name)
+                ?? TextResources.LanguageResources.ResourceManager.GetString(name);
+        }
+
+        public override string GetString(string name, CultureInfo culture)
+        {
+            return base.GetString(name, culture)
+                ?? TextResources.LanguageResources.ResourceManager.GetString(name, culture);
+        }
+    }
+}
index 46dbed7419d02ac8fec98e28bde58767d7b743d1..6ee20eb56b80de9c9e2f7aa8ab5fd15db94abd80 100644 (file)
@@ -18,8 +18,19 @@ using Tizen.NUI;
 
 namespace TaskBar.Common
 {
-    class Resources
+    static class Resources
     {
+        public static class Text
+        {
+            public const string OpenApp = "IDS_OPEN";
+            public const string UnpinApp = "IDS_UNPIN";
+            public const string CloseApp = "IDS_CLOSE";
+            public const string PinApp = "IDS_PIN";
+            public const string ClearNotification = "IDS_CLEAR";
+            public const string UninstallApp = "IDS_UNINSTALL";
+            public const string AddApps = "IDS_ADD_APPS";
+        }
+
         public const string LogTag = "TaskBar";
         public const string LightPlatformThemeId = "org.tizen.default-light-theme";
         public const string DarkPlatformThemeId = "org.tizen.default-dark-theme";
index 9186ab25ca05882156b70978405ac12a7d391371..dbaed87efdb07c786c1380368a8eea8424d0cd68 100644 (file)
@@ -21,6 +21,7 @@ using Tizen.Applications.NotificationEventListener;
 using Tizen.NUI.Binding;
 using TaskBar.Common;
 using TaskBar.Core;
+using TaskBar.TextResources;
 
 namespace TaskBar.Models
 {
@@ -124,22 +125,22 @@ namespace TaskBar.Models
             string itemText = (string)selectedItemText;
             switch (itemText)
             {
-                case "Open":
+                case Resources.Text.OpenApp:
                     OnAppSelect(selectedItemText);
                     break;
-                case "Close":
+                case Resources.Text.CloseApp:
                     TaskBarAppsLauncher.CloseApplication(ApplicationId);
                     break;
-                case "Pin to task bar":
+                case Resources.Text.PinApp:
                     PinAppClicked?.Invoke();
                     break;
-                case "Unpin from task bar":
+                case Resources.Text.UnpinApp:
                     UnpinAppClicked?.Invoke();
                     break;
-                case "Uninstall app":
+                case Resources.Text.UninstallApp:
                     UninstallAppClicked?.Invoke();
                     break;
-                case "Clear notifications":
+                case Resources.Text.ClearNotification:
                     DeleteAllNotifications();
                     break;
                 default:
@@ -163,7 +164,7 @@ namespace TaskBar.Models
         {
             List<string> menuItems = new List<string>
             {
-                "Open", IsPinned ? "Unpin from task bar" : "Pin to task bar", "Close", "Uninstall app"
+                Resources.Text.OpenApp, IsPinned ? Resources.Text.UnpinApp : Resources.Text.PinApp, Resources.Text.CloseApp, Resources.Text.UninstallApp
             };
             MoreMenuItems = menuItems;
         }
index ed6457cc1be9c1e00958b6cacd6e783fab347351..56aed6c04501e8301a6a8f8f2009f7d04329c966 100644 (file)
@@ -20,6 +20,8 @@ using Tizen.NUI.WindowSystem.Shell;
 using TaskBar.Common;
 using TaskBar.Core;
 using TaskBar.Views;
+using System.Globalization;
+using System;
 
 namespace TaskBar
 {
@@ -37,6 +39,7 @@ namespace TaskBar
         protected override void OnCreate()
         {
             base.OnCreate();
+            SetupLanguage();
             window = GetDefaultWindow();
             List<Window.WindowOrientation> list = new List<Window.WindowOrientation>
             {
@@ -62,6 +65,27 @@ namespace TaskBar
             window.OrientationChanged += OnOrientationChanged;
         }
 
+        private void SetupLanguage()
+        {
+            void SetLanguage()
+            {
+                try
+                {
+                    string language = Tizen.System.SystemSettings.LocaleLanguage.Replace("_", "-");
+                    var culture = CultureInfo.CreateSpecificCulture(language);
+                    CultureInfo.CurrentCulture = culture;
+                    TextResources.LanguageResources.Culture = culture;
+                }
+                catch (Exception e)
+                {
+                    Tizen.Log.Error(Resources.LogTag, "Setting Language failed" + e.Message);
+                }
+            }
+            MultilingualResourceManager = new MultiResourceManager("Taskbar.TextResources.LanguageResources", typeof(TextResources.LanguageResources).Assembly);
+            Tizen.System.SystemSettings.LocaleLanguageChanged += (s, e) => SetLanguage();
+            SetLanguage();
+        }
+
         private void OnOrientationChanged(object sender, WindowOrientationChangedEventArgs e)
         {
             DeviceInfo.Instance.UpdateDeviceInfo();
index b025d510d01f05db53913af1a185974a2aed4e9e..ff8399bbb7721b381e07a29ba4b2ba390ef0a50e 100644 (file)
     <PackageReference Include="Tizen.NET" Version="11.0.0.17918" />
   </ItemGroup>
 
+  <ItemGroup>
+    <Compile Update="TextResources\LanguageResources.Designer.cs">
+      <DesignTime>True</DesignTime>
+      <AutoGen>True</AutoGen>
+      <DependentUpon>LanguageResources.resx</DependentUpon>
+    </Compile>
+  </ItemGroup>
+
+  <ItemGroup>
+    <EmbeddedResource Update="TextResources\LanguageResources.en-US.resx">
+      <Generator>PublicResXFileCodeGenerator</Generator>
+    </EmbeddedResource>
+    <EmbeddedResource Update="TextResources\LanguageResources.ko-KR.resx">
+      <Generator>PublicResXFileCodeGenerator</Generator>
+    </EmbeddedResource>
+    <EmbeddedResource Update="TextResources\LanguageResources.resx">
+      <Generator>PublicResXFileCodeGenerator</Generator>
+      <LastGenOutput>LanguageResources.Designer.cs</LastGenOutput>
+    </EmbeddedResource>
+  </ItemGroup>
+
 </Project>
diff --git a/TaskBar/TextResources/LanguageResources.Designer.cs b/TaskBar/TextResources/LanguageResources.Designer.cs
new file mode 100644 (file)
index 0000000..dcc22bb
--- /dev/null
@@ -0,0 +1,126 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//     Runtime Version:4.0.30319.42000
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace TaskBar.TextResources {
+    using System;
+    
+    
+    /// <summary>
+    ///   A strongly-typed resource class, for looking up localized strings, etc.
+    /// </summary>
+    // This class was auto-generated by the StronglyTypedResourceBuilder
+    // class via a tool like ResGen or Visual Studio.
+    // To add or remove a member, edit your .ResX file then rerun ResGen
+    // with the /str option, or rebuild your VS project.
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    public class LanguageResources {
+        
+        private static global::System.Resources.ResourceManager resourceMan;
+        
+        private static global::System.Globalization.CultureInfo resourceCulture;
+        
+        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+        internal LanguageResources() {
+        }
+        
+        /// <summary>
+        ///   Returns the cached ResourceManager instance used by this class.
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        public static global::System.Resources.ResourceManager ResourceManager {
+            get {
+                if (object.ReferenceEquals(resourceMan, null)) {
+                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("TaskBar.TextResources.LanguageResources", typeof(LanguageResources).Assembly);
+                    resourceMan = temp;
+                }
+                return resourceMan;
+            }
+        }
+        
+        /// <summary>
+        ///   Overrides the current thread's CurrentUICulture property for all
+        ///   resource lookups using this strongly typed resource class.
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        public static global::System.Globalization.CultureInfo Culture {
+            get {
+                return resourceCulture;
+            }
+            set {
+                resourceCulture = value;
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to Add Apps.
+        /// </summary>
+        public static string IDS_ADD_APPS {
+            get {
+                return ResourceManager.GetString("IDS_ADD_APPS", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to Clear notifications.
+        /// </summary>
+        public static string IDS_CLEAR {
+            get {
+                return ResourceManager.GetString("IDS_CLEAR", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to Close.
+        /// </summary>
+        public static string IDS_CLOSE {
+            get {
+                return ResourceManager.GetString("IDS_CLOSE", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to Open.
+        /// </summary>
+        public static string IDS_OPEN {
+            get {
+                return ResourceManager.GetString("IDS_OPEN", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to Pin to taskbar.
+        /// </summary>
+        public static string IDS_PIN {
+            get {
+                return ResourceManager.GetString("IDS_PIN", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to Uninstall app.
+        /// </summary>
+        public static string IDS_UNINSTALL {
+            get {
+                return ResourceManager.GetString("IDS_UNINSTALL", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to Unpin from taskbar.
+        /// </summary>
+        public static string IDS_UNPIN {
+            get {
+                return ResourceManager.GetString("IDS_UNPIN", resourceCulture);
+            }
+        }
+    }
+}
diff --git a/TaskBar/TextResources/LanguageResources.en-US.resx b/TaskBar/TextResources/LanguageResources.en-US.resx
new file mode 100644 (file)
index 0000000..8c99d5a
--- /dev/null
@@ -0,0 +1,141 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <data name="IDS_ADD_APPS" xml:space="preserve">
+    <value>Add Apps</value>
+  </data>
+  <data name="IDS_CLEAR" xml:space="preserve">
+    <value>Clear notifications</value>
+  </data>
+  <data name="IDS_CLOSE" xml:space="preserve">
+    <value>Close</value>
+  </data>
+  <data name="IDS_OPEN" xml:space="preserve">
+    <value>Open</value>
+  </data>
+  <data name="IDS_PIN" xml:space="preserve">
+    <value>Pin to taskbar</value>
+  </data>
+  <data name="IDS_UNINSTALL" xml:space="preserve">
+    <value>Uninstall app</value>
+  </data>
+  <data name="IDS_UNPIN" xml:space="preserve">
+    <value>Unpin from taskbar</value>
+  </data>
+</root>
\ No newline at end of file
diff --git a/TaskBar/TextResources/LanguageResources.ko-KR.resx b/TaskBar/TextResources/LanguageResources.ko-KR.resx
new file mode 100644 (file)
index 0000000..fd71972
--- /dev/null
@@ -0,0 +1,141 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <data name="IDS_ADD_APPS" xml:space="preserve">
+    <value>앱 추가</value>
+  </data>
+  <data name="IDS_CLEAR" xml:space="preserve">
+    <value>알림 지우기</value>
+  </data>
+  <data name="IDS_CLOSE" xml:space="preserve">
+    <value>닫기</value>
+  </data>
+  <data name="IDS_OPEN" xml:space="preserve">
+    <value>열기</value>
+  </data>
+  <data name="IDS_PIN" xml:space="preserve">
+    <value>작업표시줄에 추가</value>
+  </data>
+  <data name="IDS_UNINSTALL" xml:space="preserve">
+    <value>앱 삭제</value>
+  </data>
+  <data name="IDS_UNPIN" xml:space="preserve">
+    <value>작업표시줄에서 제거</value>
+  </data>
+</root>
\ No newline at end of file
diff --git a/TaskBar/TextResources/LanguageResources.resx b/TaskBar/TextResources/LanguageResources.resx
new file mode 100644 (file)
index 0000000..8c99d5a
--- /dev/null
@@ -0,0 +1,141 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <data name="IDS_ADD_APPS" xml:space="preserve">
+    <value>Add Apps</value>
+  </data>
+  <data name="IDS_CLEAR" xml:space="preserve">
+    <value>Clear notifications</value>
+  </data>
+  <data name="IDS_CLOSE" xml:space="preserve">
+    <value>Close</value>
+  </data>
+  <data name="IDS_OPEN" xml:space="preserve">
+    <value>Open</value>
+  </data>
+  <data name="IDS_PIN" xml:space="preserve">
+    <value>Pin to taskbar</value>
+  </data>
+  <data name="IDS_UNINSTALL" xml:space="preserve">
+    <value>Uninstall app</value>
+  </data>
+  <data name="IDS_UNPIN" xml:space="preserve">
+    <value>Unpin from taskbar</value>
+  </data>
+</root>
\ No newline at end of file
index 1175d894055f08cf0789893fda15fadebde80663..683117bcc79653d4c23be52630d74eee4dcbe630 100644 (file)
@@ -22,6 +22,7 @@ using Tizen.Applications.NotificationEventListener;
 using Tizen.NUI;
 using TaskBar.Common;
 using TaskBar.Models;
+using TaskBar.TextResources;
 
 namespace TaskBar.ViewModels
 {
@@ -154,16 +155,16 @@ namespace TaskBar.ViewModels
                 List<string> moreMenuList = new List<string>();
                 if (item.Key != "back")
                 {
-                    moreMenuList.Add("Open");
+                    moreMenuList.Add(Resources.Text.OpenApp);
                 }
                 if (item.Key == "notifications")
                 {
-                    moreMenuList.Add("Clear notifications");
-                    moreMenuList.Add("Close");
+                    moreMenuList.Add(Resources.Text.ClearNotification);
+                    moreMenuList.Add(Resources.Text.CloseApp);
                 }
                 else if (item.Key == "apps" || item.Key == "settings")
                 {
-                    moreMenuList.Add("Close");
+                    moreMenuList.Add(Resources.Text.CloseApp);
                 }
                 appInfoModel.MoreMenuItems = moreMenuList;
                 buttons.Add(appInfoModel);
index f82fb5f7101b478c9d320d7c0c889d9985dc6fbc..41691e72d98610db43c328894ba7149a7199d457 100644 (file)
@@ -22,6 +22,7 @@ using Tizen.NUI.BaseComponents;
 using Tizen.NUI.Binding;
 using Tizen.NUI.Components;
 using TaskBar.Common;
+using TaskBar.TextResources;
 
 namespace TaskBar.Views
 {
@@ -141,7 +142,7 @@ namespace TaskBar.Views
                     Normal = Resources.NormalMenuItemTextColor,
                 };
                 item.TextColorSelector = colors;
-                if (item.Text == "Uninstall app")
+                if (item.Text == Resources.Text.UninstallApp)
                 {
                     item.TextColor = Resources.UninstallMenuItemTextColor;
                 }
@@ -215,7 +216,7 @@ namespace TaskBar.Views
             {
                 foreach (MenuItem item in moreMenu.Items as List<MenuItem>)
                 {
-                    if (item.Text == "Close")
+                    if (item.TranslatableText == Resources.Text.CloseApp)
                     {
                         item.IsEnabled = showIndicator;
                     }
@@ -273,13 +274,13 @@ namespace TaskBar.Views
                             FontFamily = "BreezeSans",
                             HorizontalAlignment = HorizontalAlignment.Begin,
                             VerticalAlignment = VerticalAlignment.Center,
-                            Text = menuItemName,
+                            TranslatableText = menuItemName,
                         },
                         IsSelectable = false,
                     };
                     MenuItem item = new MenuItem(buttonStyle);
 
-                    if (menuItemName == "Close")
+                    if (menuItemName == Resources.Text.CloseApp)
                     {
                         item.IsEnabled = showIndicator;
                     }
@@ -298,7 +299,7 @@ namespace TaskBar.Views
         private void OnItemClicked(object sender, ClickedEventArgs e)
         {
             MenuItem item = sender as MenuItem;
-            string itemText = item.Text;
+            string itemText = item.TranslatableText;
             DisposeMenuItems();
             DisposeMoreMenu();
             MenuItemSelectCommand.Execute(itemText);
index 52085ac94f53b4cc55178238c6a54f3697562bde..e9fd9ceea4e1728b6d80299aa12cb7576ded3ed2 100644 (file)
@@ -22,6 +22,7 @@ using Tizen.NUI.Components;
 using TaskBar.Common;
 using TaskBar.Core;
 using TaskBar.ViewModels;
+using TaskBar.TextResources;
 
 namespace TaskBar.Views
 {
@@ -219,7 +220,7 @@ namespace TaskBar.Views
                     FontFamily = "BreezeSans",
                     HorizontalAlignment = HorizontalAlignment.Begin,
                     VerticalAlignment = VerticalAlignment.Center,
-                    Text = "Add Apps",
+                    TranslatableText = Resources.Text.AddApps,
                 },
                 IsSelectable = false,
             };
index 86c9d510dce70fa02d6848a4fa7d2ec364b68693..732aa55c001ab0afce6cf9bdede316d9fc0a9dd1 100644 (file)
Binary files a/packaging/org.tizen.taskbar-1.0.0.tpk and b/packaging/org.tizen.taskbar-1.0.0.tpk differ