Add Translations to app
authorLukasz Stanislawski <lukasz.stanislawski@gmail.com>
Tue, 31 Mar 2020 05:43:08 +0000 (07:43 +0200)
committerLukasz Stanislawski <lukasz.stanislawski@gmail.com>
Tue, 31 Mar 2020 13:44:33 +0000 (15:44 +0200)
Only Wifi control currently do not support translations.

15 files changed:
Oobe/Oobe.Terms/Views/TermsView.cs
Oobe/Oobe.Welcome/WelcomeStep.cs
Oobe/Oobe/Oobe.cs
Oobe/OobeCommon/Controls/CarouselPicker.cs
Oobe/OobeCommon/OobeCommon.csproj
Oobe/OobeCommon/Resources/Translations.Designer.cs [new file with mode: 0644]
Oobe/OobeCommon/Resources/Translations.ko-KR.resx [new file with mode: 0644]
Oobe/OobeCommon/Resources/Translations.pl-PL.resx [new file with mode: 0644]
Oobe/OobeCommon/Resources/Translations.resx [new file with mode: 0644]
Oobe/OobeCommon/Styles/ButtonStyles.cs
Oobe/OobeLanguage/LanguageStep.cs
Oobe/OobeRegion/Model/RegionInfo.cs
Oobe/OobeRegion/RegionStep.cs
Oobe/OobeRegion/res/regions_OOBE.xml
Oobe/OobeWifi/WifiStep.cs

index f80a7bb3f24845fc0e0aaebb39cb2a9d5abec329..8f65ffa3d02cdd2205f2f5fd60917cbee5662700 100644 (file)
@@ -26,7 +26,8 @@ namespace Oobe.Terms.Views
 
             tapGestureDetector = new TapGestureDetector();
 
-            TextLabel title = new TextLabel("Terms and Conditions");
+            TextLabel title = new TextLabel();
+            title.TranslatableText = "TERMS_AND_CONDITIONS";
             title.Position2D = new Position2D(163, 20);
             title.HorizontalAlignment = HorizontalAlignment.Center;
             title.Size2D = new Size2D(857, 63);
@@ -85,7 +86,7 @@ namespace Oobe.Terms.Views
 
             TextLabel guide = new TextLabel();
             guide.Position2D = new Position2D(155, 442);
-            guide.Text = "(You must scroll down and read the whole texts above)";
+            guide.TranslatableText = "YOU_MUST_SCROLL_DOWN_AND_READ_THE_WHOLE_TEXT_ABOVE";
 
             agreeSwitch = new Switch(SwitchStyles.IHaveReadAndAgreeSwitchStyle);
             agreeSwitch.Size2D = new Size2D(24, 24);
@@ -99,7 +100,7 @@ namespace Oobe.Terms.Views
 
             agreeLabel = new TextLabel(TextLabelStyles.IHaveReadAndAgreeTextStyleDisabled);
             agreeLabel.State = States.Disabled;
-            agreeLabel.Text = "I have read and agree to the Terms and Conditions";
+            agreeLabel.TranslatableText = "I_HAVE_READ_AND_AGREE_TO_TERMS_AND_CONDITIONS";
             agreeLabel.Position2D = new Position2D(155, 463);
 
             this.Add(title);
index aedf246241ddf89c1720c6138df58eb47ca35f49..8acf083b5ad45b2b7a6666c47f74aa0e246f7c31 100644 (file)
@@ -12,7 +12,8 @@ namespace Oobe.Welcome
         {\r
             View container = new View();\r
 \r
-            TextLabel title = new TextLabel("Welcome to Tizen IoT!");\r
+            TextLabel title = new TextLabel();\r
+            title.TranslatableText = "WELCOME_TITLE";\r
             title.Position2D = new Position2D(163, 160);\r
             title.Size2D = new Size2D(857, 63);\r
             title.TextColor = new Color(0, 20.0f/255.0f, 71.0f/255.0f, 1.0f);\r
@@ -33,7 +34,7 @@ namespace Oobe.Welcome
 \r
             Button next = new Button(ButtonStyles.Next);\r
             next.Position2D = new Position2D(472, 512);\r
-            next.Text = "GET STARTED";\r
+            next.TranslatableText = "GET_STARTED";\r
             next.ClickEvent += (obj, args) => {\r
                 nav.Finish();\r
             };\r
index 435b4d329651f2a5f9a8500bb206534fd2d61f8d..1bc6d12705ca5fad2c82047ebb8e40757ae27008 100644 (file)
@@ -1,6 +1,8 @@
 using Tizen.NUI;
 using Tizen.NUI.Components;
 using System;
+using System.Globalization;
+using Oobe.Common.Resources;
 
 namespace Oobe
 {
@@ -22,12 +24,33 @@ namespace Oobe
 
         void Initialize()
         {
+            SetupLanguage();
+
             Window.Instance.Type = WindowType.Notification;
             Window.Instance.SetNotificationLevel(NotificationLevel.High);
             processManager = new ProcessManager();
             processManager.Start();
         }
 
+        void SetupLanguage()
+        {
+            void SetLanguage()
+            {
+                try {
+                    string language = Tizen.System.SystemSettings.LocaleLanguage.Replace("_", "-");
+                    var culture = CultureInfo.CreateSpecificCulture(language);
+                    CultureInfo.CurrentCulture = culture;
+                    Translations.Culture = culture;
+                } catch (Exception e)
+                {
+                    Tizen.Log.Debug("oobe", "Setting Language failed:" + e.Message);
+                }
+            }
+            NUIApplication.MultilingualResourceManager = Translations.ResourceManager;
+            Tizen.System.SystemSettings.LocaleLanguageChanged += (s, e) => SetLanguage();
+            SetLanguage();
+        }
+
         static void Main(string[] args)
         {
             var app = new Program();
index aa0673bddc2c5968228cca7fd4942c45f24edb89..203185fddfc0f9e05e79ab78374dd23553ea2dd6 100644 (file)
@@ -184,6 +184,7 @@ namespace Oobe.Common.Controls
             // var view = new TextLabel(Style.CenterText);
             // view.ApplyStyle(Style.CenterText);
             view.Text = item.Text;
+            view.TranslatableText = item.TranslatableText;
             view.Size2D = Style.CenterText?.Size2D ?? new Size2D();
             view.PixelSize = Style.CenterText?.PixelSize ?? 10.0f;
             view.Margin = Style.CenterText?.Margin ?? new Extents();
index f7145b6eaad7b42e30b94f5e928ceec8b7436ed3..b0ab0b44578a16aa74ee3a626e2b77d8fc6527b6 100644 (file)
   </ItemGroup>\r
 \r
   <ItemGroup>\r
-    <Folder Include="res\" />\r
+    <Compile Update="Resources\Translations.Designer.cs">\r
+      <DesignTime>True</DesignTime>\r
+      <AutoGen>True</AutoGen>\r
+      <DependentUpon>Resources\Translations.resx</DependentUpon>\r
+    </Compile>\r
+  </ItemGroup>\r
+\r
+  <ItemGroup>\r
+    <EmbeddedResource Update="Resources\Translations.ko-KR.resx">\r
+      <Generator>PublicResXFileCodeGenerator</Generator>\r
+    </EmbeddedResource>\r
+    <EmbeddedResource Update="Resources\Translations.pl-PL.resx">\r
+      <Generator>PublicResXFileCodeGenerator</Generator>\r
+    </EmbeddedResource>\r
+    <EmbeddedResource Update="Resources\Translations.resx">\r
+      <Generator>PublicResXFileCodeGenerator</Generator>\r
+      <LastGenOutput>Resources\Translations.Designer.cs</LastGenOutput>\r
+    </EmbeddedResource>\r
   </ItemGroup>\r
 </Project>\r
diff --git a/Oobe/OobeCommon/Resources/Translations.Designer.cs b/Oobe/OobeCommon/Resources/Translations.Designer.cs
new file mode 100644 (file)
index 0000000..638af87
--- /dev/null
@@ -0,0 +1,88 @@
+//------------------------------------------------------------------------------
+// <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 Oobe.Common.Resources {
+    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("OobeCommon.Resources.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 Title.
+        /// </summary>
+        public static string _Title {
+            get {
+                return ResourceManager.GetString("_Title", resourceCulture);
+            }
+        }
+
+        /// <summary>
+        ///   Looks up a localized string similar to Title.
+        /// </summary>
+        public static string CONTINUE {
+            get {
+                return ResourceManager.GetString("CONTINUE", resourceCulture);
+            }
+        }
+
+        public static string CHOOSE_LANGUAGE {
+            get {
+                return ResourceManager.GetString("CHOOSE_LANGUAGE", resourceCulture);
+            }
+        }
+
+    }
+}
diff --git a/Oobe/OobeCommon/Resources/Translations.ko-KR.resx b/Oobe/OobeCommon/Resources/Translations.ko-KR.resx
new file mode 100644 (file)
index 0000000..5b6c8ec
--- /dev/null
@@ -0,0 +1,165 @@
+<?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="_Title" xml:space="preserve">
+    <value>변경사항 저장 안 함</value>
+  </data>
+  <data name="CONTINUE" xml:space="preserve">
+    <value>계속하다</value>
+  </data>
+  <data name="PREVIOUS" xml:space="preserve">
+    <value>이전</value>
+  </data>
+  <data name="SKIP" xml:space="preserve">
+    <value>건너 뛰기</value>
+  </data>
+  <data name="GET_STARTED" xml:space="preserve">
+    <value>시작하다</value>
+  </data>
+  <data name="CHOOSE_LANGUAGE" xml:space="preserve">
+    <value>언어 선택</value>
+  </data>
+  <data name="CHOOSE_REGION" xml:space="preserve">
+    <value>선택 지역</value>
+  </data>
+  <data name="TERMS_AND_CONDITIONS" xml:space="preserve">
+    <value>이용 약관</value>
+  </data>
+  <data name="YOU_MUST_SCROLL_DOWN_AND_READ_THE_WHOLE_TEXT_ABOVE" xml:space="preserve">
+    <value>아래로 스크롤하여 위의 전체 텍스트를 읽어야합니다</value>
+  </data>
+  <data name="I_HAVE_READ_AND_AGREE_TO_TERMS_AND_CONDITIONS" xml:space="preserve">
+    <value>이용 약관을 읽었으며 이에 동의합니다</value>
+  </data>
+  <data name="WELCOME_TITLE" xml:space="preserve">
+    <value>환영합니다 Tizen IoT!</value>
+  </data>
+  <data name="CHOOSE_WIFI_NETWORK" xml:space="preserve">
+    <value>WiFi로 연결</value>
+  </data>
+  <data name="UNITED_KINGDOM" xml:space="preserve">
+    <value>영국</value>
+  </data>
+  <data name="SOUTH_KOREA" xml:space="preserve">
+    <value>대한민국</value>
+  </data>
+  <data name="POLAND" xml:space="preserve">
+    <value>폴란드</value>
+  </data>
+</root>
diff --git a/Oobe/OobeCommon/Resources/Translations.pl-PL.resx b/Oobe/OobeCommon/Resources/Translations.pl-PL.resx
new file mode 100644 (file)
index 0000000..f8edcad
--- /dev/null
@@ -0,0 +1,162 @@
+<?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="CONTINUE" xml:space="preserve">
+    <value>DALEJ</value>
+  </data>
+  <data name="PREVIOUS" xml:space="preserve">
+    <value>WSTECZ</value>
+  </data>
+  <data name="SKIP" xml:space="preserve">
+    <value>POMIŃ</value>
+  </data>
+  <data name="GET_STARTED" xml:space="preserve">
+    <value>ROZPOCZNIJ</value>
+  </data>
+  <data name="CHOOSE_LANGUAGE" xml:space="preserve">
+    <value>Wybierz język</value>
+  </data>
+  <data name="CHOOSE_REGION" xml:space="preserve">
+    <value>Wybierz region</value>
+  </data>
+  <data name="TERMS_AND_CONDITIONS" xml:space="preserve">
+    <value>Warunki użytkowania</value>
+  </data>
+  <data name="YOU_MUST_SCROLL_DOWN_AND_READ_THE_WHOLE_TEXT_ABOVE" xml:space="preserve">
+    <value>Musisz przewinąć i przeczytać całą treść</value>
+  </data>
+  <data name="I_HAVE_READ_AND_AGREE_TO_TERMS_AND_CONDITIONS" xml:space="preserve">
+    <value>Przeczytałem i zgadzam się na warunki użytkowania</value>
+  </data>
+  <data name="WELCOME_TITLE" xml:space="preserve">
+    <value>Witaj w Tizen IoT!</value>
+  </data>
+  <data name="CHOOSE_WIFI_NETWORK" xml:space="preserve">
+    <value>Połącz z Wi-Fi</value>
+  </data>
+  <data name="UNITED_KINGDOM" xml:space="preserve">
+    <value>Zjednoczone Królestwo</value>
+  </data>
+  <data name="SOUTH_KOREA" xml:space="preserve">
+    <value>Korea Południowa</value>
+  </data>
+  <data name="POLAND" xml:space="preserve">
+    <value>Polska</value>
+  </data>
+</root>
diff --git a/Oobe/OobeCommon/Resources/Translations.resx b/Oobe/OobeCommon/Resources/Translations.resx
new file mode 100644 (file)
index 0000000..0360203
--- /dev/null
@@ -0,0 +1,165 @@
+<?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="_Title" xml:space="preserve">
+    <value>Title</value>
+  </data>
+  <data name="CONTINUE" xml:space="preserve">
+    <value>CONTINUE</value>
+  </data>
+  <data name="PREVIOUS" xml:space="preserve">
+    <value>PREVIOUS</value>
+  </data>
+  <data name="SKIP" xml:space="preserve">
+    <value>SKIP</value>
+  </data>
+  <data name="GET_STARTED" xml:space="preserve">
+    <value>GET STARTED</value>
+  </data>
+  <data name="CHOOSE_LANGUAGE" xml:space="preserve">
+    <value>Choose language</value>
+  </data>
+  <data name="CHOOSE_REGION" xml:space="preserve">
+    <value>Choose region</value>
+  </data>
+  <data name="TERMS_AND_CONDITIONS" xml:space="preserve">
+    <value>Terms and conditions</value>
+  </data>
+  <data name="YOU_MUST_SCROLL_DOWN_AND_READ_THE_WHOLE_TEXT_ABOVE" xml:space="preserve">
+    <value>You must scroll down and read the whole text above</value>
+  </data>
+  <data name="I_HAVE_READ_AND_AGREE_TO_TERMS_AND_CONDITIONS" xml:space="preserve">
+    <value>I have read and agree to terms and conditions</value>
+  </data>
+  <data name="WELCOME_TITLE" xml:space="preserve">
+    <value>Welcome to Tizen IoT!</value>
+  </data>
+  <data name="CHOOSE_WIFI_NETWORK" xml:space="preserve">
+    <value>Choose Wi-Fi Network</value>
+  </data>
+  <data name="UNITED_KINGDOM" xml:space="preserve">
+    <value>United Kingdom</value>
+  </data>
+  <data name="SOUTH_KOREA" xml:space="preserve">
+    <value>South Korea</value>
+  </data>
+  <data name="POLAND" xml:space="preserve">
+    <value>Poland</value>
+  </data>
+</root>
index e57345c7fd21b427cb8b02a1c1f155cce1bdc84f..79bbeb1fe3aa52e6511cc4ffdbf4fd9aeeccfe24 100644 (file)
@@ -17,7 +17,7 @@ namespace Oobe.Common.Styles
                     Pressed = 24.0f
                 },
                 EnableMarkup = true,
-                Text = "PREVIOUS",
+                TranslatableText = "PREVIOUS",
                 TextColor = new Selector<Color>
                 {
                     Normal = new Color(0.0f, 20.0f / 255.0f, 71 / 255.0f, 1.0f),
@@ -61,7 +61,7 @@ namespace Oobe.Common.Styles
         private static ButtonStyle GetSkipButtonStyle()
         {
             var style = GetNextButtonStyle();
-            style.Text.Text = "SKIP";
+            style.Text.TranslatableText = "SKIP";
             return style;
         }
 
@@ -81,7 +81,7 @@ namespace Oobe.Common.Styles
                     Pressed = 24.0f
                 },
                 TextColor = Color.White,
-                Text = "CONTINUE",
+                TranslatableText = "CONTINUE",
             },
             Size2D = new Size2D(240, 72),
         };
index 157b02f77a4ae053d84771b1831634c6d73f1cef..efab1997c342c873aa0b7684e87821e3a7872aa6 100644 (file)
@@ -6,6 +6,7 @@ using Tizen.NUI.BaseComponents;
 using Oobe.Language.Model;\r
 using Oobe.Common.Controls;\r
 using Oobe.Common.Utils;\r
+using Oobe.Common.Resources;\r
 \r
 namespace Oobe.Language\r
 {\r
@@ -26,7 +27,8 @@ namespace Oobe.Language
         {\r
             View container = new View();\r
 \r
-            TextLabel title = new TextLabel("Choose language");\r
+            TextLabel title = new TextLabel();\r
+            title.TranslatableText = "CHOOSE_LANGUAGE";\r
             title.Position2D = new Position2D(410, 160);\r
             title.Size2D = new Size2D(364, 58);\r
             title.TextColor = new Color(0, 20.0f/255.0f, 71.0f/255.0f, 1.0f);\r
index 5eb44e3b9dd76063643ea8f2a14935457973b4b5..692406e356efcf9edd1c98e6d2c1dd1d2ee51165 100644 (file)
@@ -12,6 +12,8 @@ namespace Oobe.Region.Model
         public string Timezone{ get; set; }
         [XmlAttribute("cityname")]
         public string CityName { get; set; }
+        [XmlAttribute("id")]
+        public string Id { get; set; }
         
     }
-}
\ No newline at end of file
+}
index ad376e4fdf746dd9fbed5222a0986f1a6cf3a2f5..e7ac232c31e73e403a2e45bb1a5e56af1af0ad5e 100644 (file)
@@ -25,7 +25,8 @@ namespace Oobe.Region
         {\r
             View container = new View();\r
 \r
-            TextLabel title = new TextLabel("Choose Region");\r
+            TextLabel title = new TextLabel();\r
+            title.TranslatableText = "CHOOSE_REGION";\r
             title.Position2D = new Position2D(410, 160);\r
             title.Size2D = new Size2D(364, 58);\r
             title.TextColor = new Color(0, 20.0f/255.0f, 71.0f/255.0f, 1.0f);\r
@@ -42,7 +43,7 @@ namespace Oobe.Region
             foreach (RegionInfo info in manager.Regions)\r
             {\r
                 CarouselPickerItemData item = new CarouselPickerItemData();\r
-                item.Text = info.Name;\r
+                item.TranslatableText = info.Id;\r
                 carousel.AddItem(item);\r
             }\r
 \r
index 8a411d84ed9a1583dfa89573be15c64f9bac4547..9e66ab501d2f69765baa43099e7661519dc93a6e 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
 <regions>
-  <region code="en_GB" name="United Kingdom" timezone="Europe/London" />
-  <region code="ko_KR" name="South Korea" timezone="Asia/Seoul" />
-  <region code="pl_PL" name="Poland" timezone="Europe/Warsaw"  />
+  <region code="en_GB" name="United Kingdom" timezone="Europe/London" id="UNITED_KINGDOM" />
+  <region code="ko_KR" name="South Korea" timezone="Asia/Seoul" id="SOUTH_KOREA" />
+  <region code="pl_PL" name="Poland" timezone="Europe/Warsaw" id="POLAND" />
 </regions>
index 07fb085016fa29c062e3c13063b58d1629206366..16f2055366facc42ad458f9f867d4ccd76613eb3 100644 (file)
@@ -21,8 +21,9 @@ namespace Oobe.Wifi
                 },
             };
 
-            view.Add(new TextLabel("Choose Wi-Fi Network")
+            view.Add(new TextLabel()
             {
+                TranslatableText = "CHOOSE_WIFI_NETWORK",
                 Size = new Size(0, 58),
                 WidthResizePolicy = ResizePolicyType.FillToParent,
                 Margin = new Extents(0, 0, 20, 8),