Adding translations to Wifi
authork.stepaniuk <k.stepaniuk@samsung.com>
Sun, 5 Apr 2020 09:50:22 +0000 (11:50 +0200)
committerk.stepaniuk <k.stepaniuk@samsung.com>
Mon, 6 Apr 2020 14:20:00 +0000 (16:20 +0200)
Signed-off-by: k.stepaniuk <k.stepaniuk@samsung.com>
Oobe/Oobe/Managers/MultiResourceManager.cs [new file with mode: 0644]
Oobe/Oobe/Oobe.cs
Oobe/Oobe/Oobe.csproj
Oobe/OobeWifi/Controls/Wifi/ButtonStyles.cs
Oobe/OobeWifi/Controls/Wifi/Translations.Designer.cs [new file with mode: 0644]
Oobe/OobeWifi/Controls/Wifi/Translations.pl-PL.resx [new file with mode: 0644]
Oobe/OobeWifi/Controls/Wifi/Translations.resx [new file with mode: 0644]
Oobe/OobeWifi/Controls/Wifi/WifiPasswordPopup.cs
Oobe/OobeWifi/Controls/Wifi/WifiView.cs
Oobe/OobeWifi/OobeWifi.csproj

diff --git a/Oobe/Oobe/Managers/MultiResourceManager.cs b/Oobe/Oobe/Managers/MultiResourceManager.cs
new file mode 100644 (file)
index 0000000..f78962f
--- /dev/null
@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Reflection;
+using System.Resources;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Oobe.Managers
+{
+    public class MultiResourceManager : ResourceManager
+    {
+        public MultiResourceManager(string baseName, Assembly assembly)
+            : base(baseName, assembly)
+        {
+        }
+
+        public override string? GetString(string name)
+        {
+            return base.GetString(name)
+                ?? OobeWifi.Controls.Wifi.Translations.ResourceManager.GetString(name);
+        }
+
+        public override string? GetString(string name, CultureInfo culture)
+        {
+            return base.GetString(name, culture)
+                ?? OobeWifi.Controls.Wifi.Translations.ResourceManager.GetString(name, culture);
+        }
+    }
+}
index db689527bcbc6e1ecd50e63ba5f1677327e5d49a..388724fea7c4a852d00065ddeabba8c96e10d862 100644 (file)
@@ -3,6 +3,7 @@ using Tizen.NUI.Components;
 using System;
 using System.Globalization;
 using OobeCommon.Resources;
+using Oobe.Managers;
 
 namespace Oobe
 {
@@ -36,17 +37,20 @@ namespace Oobe
         {
             void SetLanguage()
             {
-                try {
+                try
+                {
                     string language = Tizen.System.SystemSettings.LocaleLanguage.Replace("_", "-");
                     var culture = CultureInfo.CreateSpecificCulture(language);
                     CultureInfo.CurrentCulture = culture;
                     Translations.Culture = culture;
-                } catch (Exception e)
+                    OobeWifi.Controls.Wifi.Translations.Culture = culture;
+                }
+                catch (Exception e)
                 {
                     Tizen.Log.Debug("oobe", "Setting Language failed:" + e.Message);
                 }
             }
-            NUIApplication.MultilingualResourceManager = Translations.ResourceManager;
+            NUIApplication.MultilingualResourceManager = new MultiResourceManager("OobeCommon.Resources.Translations", typeof(Translations).Assembly);
             Tizen.System.SystemSettings.LocaleLanguageChanged += (s, e) => SetLanguage();
             SetLanguage();
         }
index 36c2b0ec0175b0fc901bb970a57e534ba5a2b800..4f6d89417231ea5f73e9c32472e5a97dbaa40ee2 100644 (file)
@@ -3,6 +3,7 @@
   <PropertyGroup>
     <OutputType>Exe</OutputType>
     <TargetFramework>tizen80</TargetFramework>
+    <LangVersion>8.0</LangVersion>
     <TargetFrameworkIdentifier>Tizen</TargetFrameworkIdentifier>
   </PropertyGroup>
 
index 26a2ca4906ea1b9bd7d8b6cdbc54c3ad51bb939a..3e2c1ed64d8b82882b1a0a147618ea4bfa1ae285 100644 (file)
@@ -34,7 +34,7 @@ namespace Oobe.Wifi.Controls.Wifi
                     Pressed = 24.0f
                 },
                 EnableMarkup = true,
-                Text = "CANCEL", //change to TranslatableText alter adding translations
+                TranslatableText = "WIFI_CANCEL",
                 TextColor = new Selector<Color>
                 {
                     Normal = new Color(0.0f, 20.0f / 255.0f, 71 / 255.0f, 1.0f),
@@ -103,7 +103,7 @@ namespace Oobe.Wifi.Controls.Wifi
                     Pressed = 24.0f
                 },
                 TextColor = Color.White,
-                Text = "OK", //change to TranslatableText alter adding translations
+                TranslatableText = "WIFI_OK",
                 FontFamily = GetNavigationFont(),
             },
             Size2D = new Size2D(240, 72),
diff --git a/Oobe/OobeWifi/Controls/Wifi/Translations.Designer.cs b/Oobe/OobeWifi/Controls/Wifi/Translations.Designer.cs
new file mode 100644 (file)
index 0000000..fff8d09
--- /dev/null
@@ -0,0 +1,144 @@
+//------------------------------------------------------------------------------
+// <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 OobeWifi.Controls.Wifi {
+    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", "16.0.0.0")]
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    public class Translations {
+        
+        private static global::System.Resources.ResourceManager resourceMan;
+        
+        private static global::System.Globalization.CultureInfo resourceCulture;
+        
+        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+        internal Translations() {
+        }
+        
+        /// <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("OobeWifi.Controls.Wifi.Translations", typeof(Translations).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 new....
+        /// </summary>
+        public static string WIFI_ADD_NEW_NETWORK {
+            get {
+                return ResourceManager.GetString("WIFI_ADD_NEW_NETWORK", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to CANCEL.
+        /// </summary>
+        public static string WIFI_CANCEL {
+            get {
+                return ResourceManager.GetString("WIFI_CANCEL", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to Connection failed..
+        /// </summary>
+        public static string WIFI_CONNECTION_FAILED {
+            get {
+                return ResourceManager.GetString("WIFI_CONNECTION_FAILED", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to Enter password.
+        /// </summary>
+        public static string WIFI_ENTER_PASSWORD {
+            get {
+                return ResourceManager.GetString("WIFI_ENTER_PASSWORD", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to Enter password to join.
+        /// </summary>
+        public static string WIFI_ENTER_PASSWORD_TO_JOIN {
+            get {
+                return ResourceManager.GetString("WIFI_ENTER_PASSWORD_TO_JOIN", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to Invalid password.
+        /// </summary>
+        public static string WIFI_INVALID_PASSWORD {
+            get {
+                return ResourceManager.GetString("WIFI_INVALID_PASSWORD", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to OK.
+        /// </summary>
+        public static string WIFI_OK {
+            get {
+                return ResourceManager.GetString("WIFI_OK", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to Scanning....
+        /// </summary>
+        public static string WIFI_SCANNING {
+            get {
+                return ResourceManager.GetString("WIFI_SCANNING", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to To see available networks, turn on Wi - Fi..
+        /// </summary>
+        public static string WIFI_TURN_ON_WIFI {
+            get {
+                return ResourceManager.GetString("WIFI_TURN_ON_WIFI", resourceCulture);
+            }
+        }
+    }
+}
diff --git a/Oobe/OobeWifi/Controls/Wifi/Translations.pl-PL.resx b/Oobe/OobeWifi/Controls/Wifi/Translations.pl-PL.resx
new file mode 100644 (file)
index 0000000..27c7247
--- /dev/null
@@ -0,0 +1,147 @@
+<?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="WIFI_ADD_NEW_NETWORK" xml:space="preserve">
+    <value>Dodaj nową,,,</value>
+  </data>
+  <data name="WIFI_CANCEL" xml:space="preserve">
+    <value>ANULUJ</value>
+  </data>
+  <data name="WIFI_CONNECTION_FAILED" xml:space="preserve">
+    <value>Połączenie nieudane.</value>
+  </data>
+  <data name="WIFI_ENTER_PASSWORD" xml:space="preserve">
+    <value>Wprowadź hasło</value>
+  </data>
+  <data name="WIFI_ENTER_PASSWORD_TO_JOIN" xml:space="preserve">
+    <value>Wprowadź hasło aby połączyć z</value>
+  </data>
+  <data name="WIFI_INVALID_PASSWORD" xml:space="preserve">
+    <value>Hasło nieprawidłowe</value>
+  </data>
+  <data name="WIFI_OK" xml:space="preserve">
+    <value>ZATWIERDŹ</value>
+  </data>
+  <data name="WIFI_SCANNING" xml:space="preserve">
+    <value>Skanowanie...</value>
+  </data>
+  <data name="WIFI_TURN_ON_WIFI" xml:space="preserve">
+    <value>Aby zobaczyć dostępne sieci, włącz Wi - Fi.</value>
+  </data>
+</root>
\ No newline at end of file
diff --git a/Oobe/OobeWifi/Controls/Wifi/Translations.resx b/Oobe/OobeWifi/Controls/Wifi/Translations.resx
new file mode 100644 (file)
index 0000000..0e912e5
--- /dev/null
@@ -0,0 +1,147 @@
+<?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="WIFI_ADD_NEW_NETWORK" xml:space="preserve">
+    <value>Add new...</value>
+  </data>
+  <data name="WIFI_CANCEL" xml:space="preserve">
+    <value>CANCEL</value>
+  </data>
+  <data name="WIFI_CONNECTION_FAILED" xml:space="preserve">
+    <value>Connection failed.</value>
+  </data>
+  <data name="WIFI_ENTER_PASSWORD" xml:space="preserve">
+    <value>Enter password</value>
+  </data>
+  <data name="WIFI_ENTER_PASSWORD_TO_JOIN" xml:space="preserve">
+    <value>Enter password to join</value>
+  </data>
+  <data name="WIFI_INVALID_PASSWORD" xml:space="preserve">
+    <value>Invalid password</value>
+  </data>
+  <data name="WIFI_OK" xml:space="preserve">
+    <value>OK</value>
+  </data>
+  <data name="WIFI_SCANNING" xml:space="preserve">
+    <value>Scanning...</value>
+  </data>
+  <data name="WIFI_TURN_ON_WIFI" xml:space="preserve">
+    <value>To see available networks, turn on Wi - Fi.</value>
+  </data>
+</root>
\ No newline at end of file
index a4a2800e071f6ce628e526ad8b1a060ceba94fb4..26806e94597a455188430460853bf5f70d270e1a 100644 (file)
@@ -6,6 +6,7 @@ using Tizen.NUI.Components;
 using OobeCommon;
 using Tizen.Network.WiFi;
 using Oobe.Common.Styles;
+using OobeWifi.Controls.Wifi;
 
 namespace Oobe.Wifi.Controls.Wifi
 {
@@ -58,7 +59,7 @@ namespace Oobe.Wifi.Controls.Wifi
             {
                 Size = new Size(808, 35),
                 Position = new Position(0, 19),
-                Text = "Enter password",
+                TranslatableText = "WIFI_ENTER_PASSWORD",
                 PixelSize = 28,
                 TextColor = new Color(0, 0x14 / 255.0f, 0x47 / 255.0f, 1.0f),
                 FontFamily = "BreezeSans",
@@ -72,7 +73,8 @@ namespace Oobe.Wifi.Controls.Wifi
             {
                 Size = new Size(808, 26),
                 Position = new Position(0, 68),
-                Text = $"Enter password to join \"{wifiAp.NetworkInformation.Essid}\"",
+                //no translatableText because of dynamic content
+                Text = $"{Translations.WIFI_ENTER_PASSWORD_TO_JOIN} \"{wifiAp.NetworkInformation.Essid}\"",
                 PixelSize = 20,
                 TextColor = new Color(0, 0x14 / 255.0f, 0x47 / 255.0f, 1.0f),
                 FontFamily = "BreezeSans",
@@ -86,7 +88,7 @@ namespace Oobe.Wifi.Controls.Wifi
             {
                 Size = new Size(120, 16),
                 Position = new Position(116, 166),
-                Text = "Invalid password",
+                TranslatableText = "WIFI_INVALID_PASSWORD",
                 PixelSize = 12,
                 TextColor = new Color(0xAA / 255.0f, 0x18 / 255.0f, 0x18 / 255.0f, 1.0f),
                 FontFamily = "BreezeSans",
@@ -132,7 +134,7 @@ namespace Oobe.Wifi.Controls.Wifi
                     wifiAp.SecurityInformation.SetPassphrase(Password);
                     var task = wifiAp.ConnectAsync();
                     await task;
-                    if(task.Status == TaskStatus.Faulted)
+                    if (task.Status == TaskStatus.Faulted)
                     {
                         throw task.Exception;
                     }
index 27c3bba55f10392db828e62dda9ce071e3ecc228..2cb086c9e6f9311b6c24b2367d63f98696aaf251 100644 (file)
@@ -64,8 +64,9 @@ namespace Oobe.Wifi.Controls.Wifi
                 Size = new Size(42, 42),
             });
 
-            manualWifi.Add(new TextLabel("Add new...")
+            manualWifi.Add(new TextLabel()
             {
+                TranslatableText = "WIFI_ADD_NEW_NETWORK",
                 Position = new Position(87, 29),
                 PixelSize = 20f,
                 TextColor = new Color(0, 0x0C / 255f, 0x2B / 255f, 1.0f),
@@ -183,16 +184,16 @@ namespace Oobe.Wifi.Controls.Wifi
             void turnOff(string message)
             {
                 listView.Hide();
-                prompt.Text = message;
+                prompt.TranslatableText = message;
                 prompt.Show();
             }
             if (State.IsTurnedOn)
                 turnOn();
             else
-                turnOff("To see available networks, turn on Wi - Fi.");
-            State.OnTurnedOff += () => turnOff("To see available networks, turn on Wi - Fi.");
+                turnOff("WIFI_TURN_ON_WIFI");
+            State.OnTurnedOff += () => turnOff("WIFI_TURN_ON_WIFI");
             State.OnTurnedOn += () => turnOn();
-            State.OnTurningOnFailed += () => turnOff("Connection failed.");
+            State.OnTurningOnFailed += () => turnOff("WIFI_CONNECTION_FAILED");
             return view;
         }
 
@@ -210,8 +211,9 @@ namespace Oobe.Wifi.Controls.Wifi
                 Margin = new Extents(0, 0, 1, 0),
                 BackgroundImage = System.IO.Path.Combine(NUIApplication.Current.DirectoryInfo.Resource, "12_icon_scanning.png"),
             });
-            view.Add(new TextLabel("Scanning...")
+            view.Add(new TextLabel()
             {
+                TranslatableText = "WIFI_SCANNING",
                 Margin = new Extents(17, 0, 0, 0),
                 PixelSize = 19f,
                 TextColor = new Color(0, 14.0f / 255.0f, 47.0f / 255.0f, 1.0f),
index 61bf45dee7ab33b9948bdffb22b2b7cd3e255b05..e7153bdf27b3ff297444230893fcfc3cba5d9305 100644 (file)
   <ItemGroup>\r
     <ProjectReference Include="..\OobeCommon\OobeCommon.csproj" />\r
   </ItemGroup>\r
+\r
+  <ItemGroup>\r
+    <Compile Update="Controls\Wifi\Translations.Designer.cs">\r
+      <DesignTime>True</DesignTime>\r
+      <AutoGen>True</AutoGen>\r
+      <DependentUpon>Translations.resx</DependentUpon>\r
+    </Compile>\r
+  </ItemGroup>\r
+\r
+  <ItemGroup>\r
+    <EmbeddedResource Update="Controls\Wifi\Translations.pl-PL.resx">\r
+      <Generator>PublicResXFileCodeGenerator</Generator>\r
+    </EmbeddedResource>\r
+    <EmbeddedResource Update="Controls\Wifi\Translations.resx">\r
+      <Generator>PublicResXFileCodeGenerator</Generator>\r
+      <LastGenOutput>Translations.Designer.cs</LastGenOutput>\r
+    </EmbeddedResource>\r
+  </ItemGroup>\r
 </Project>\r