From: Anuj Kumar Singh Date: Tue, 16 Jan 2024 06:26:11 +0000 (+0530) Subject: Implement supporting multiple languages X-Git-Tag: accepted/tizen/unified/20240216.161309^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Faccepted%2Ftizen_unified_dev;p=profile%2Fiot%2Fapps%2Fdotnet%2Fsetting-bluetooth.git Implement supporting multiple languages Change-Id: Ic9e45119eb21c5dddf2eb6981cfe913a6f398fe1 Signed-off-by: Anuj Kumar Singh --- diff --git a/SettingBluetooth/SettingBluetooth/Controller/DeviceController.cs b/SettingBluetooth/SettingBluetooth/Controller/DeviceController.cs index 4da444d..105908d 100644 --- a/SettingBluetooth/SettingBluetooth/Controller/DeviceController.cs +++ b/SettingBluetooth/SettingBluetooth/Controller/DeviceController.cs @@ -1,4 +1,5 @@ -using SettingCore; +using SettingBluetooth.TextResources; +using SettingCore; using System; using System.Collections.Generic; using System.Text; @@ -44,7 +45,7 @@ namespace SettingBluetooth { var disconnectButton = new Button() { - Text = Resources.IDS_BT_SK_DISCONNECT, + Text = ResourceManager.TextResourceManager.NUIGadgetResourceManager.GetString(nameof(Resources.IDS_BT_SK_DISCONNECT)), }; disconnectButton.Clicked += (obj, ev) => { @@ -71,7 +72,7 @@ namespace SettingBluetooth { var disconnectButton = new Button() { - Text = Resources.IDS_BT_SK_DISCONNECT, + Text = ResourceManager.TextResourceManager.NUIGadgetResourceManager.GetString(nameof(Resources.IDS_BT_SK_DISCONNECT)), }; disconnectButton.Clicked += (obj, ev) => { diff --git a/SettingBluetooth/SettingBluetooth/SettingBluetooth.cs b/SettingBluetooth/SettingBluetooth/SettingBluetooth.cs index 39ff969..b6fe957 100644 --- a/SettingBluetooth/SettingBluetooth/SettingBluetooth.cs +++ b/SettingBluetooth/SettingBluetooth/SettingBluetooth.cs @@ -6,6 +6,7 @@ using Tizen.Applications; using Tizen.NUI; using Tizen.NUI.BaseComponents; using Tizen.NUI.Components; +using SettingBluetooth.TextResources; namespace SettingBluetooth { @@ -31,7 +32,7 @@ namespace SettingBluetooth public override string ProvideIconPath() => GetResourcePath("images/bluetooth-icon.svg"); - public override string ProvideTitle() => "Bluetooth"; + public override string ProvideTitle() => NUIGadgetResourceManager.GetString(nameof(Resources.IDS_BT_BODY_BLUETOOTH)); public SettingBluetooth() : base(NUIGadgetType.Normal) { @@ -46,12 +47,14 @@ namespace SettingBluetooth ViewStyle viewStyle = GetButtonViewStyle(); mScanButton = new Button() { - Text = Resources.IDS_BT_SK_SCAN, + Text = this.NUIGadgetResourceManager.GetString(nameof(Resources.IDS_BT_SK_SCAN)), IsEnabled = BtModel.IsEnabled, }; mScanButton.Clicked += AdapterController.ScanButtonClicked; mScanButton.ApplyStyle(viewStyle); + ResourceManager.TextResourceManager = this; + return BtMainView.Create(); } diff --git a/SettingBluetooth/SettingBluetooth/SettingBluetooth.csproj b/SettingBluetooth/SettingBluetooth/SettingBluetooth.csproj index 69ad7e6..c1870c5 100644 --- a/SettingBluetooth/SettingBluetooth/SettingBluetooth.csproj +++ b/SettingBluetooth/SettingBluetooth/SettingBluetooth.csproj @@ -17,4 +17,29 @@ + + + True + True + Resources.resx + + + + + + PublicResXFileCodeGenerator + + + PublicResXFileCodeGenerator + + + PublicResXFileCodeGenerator + Resources.Designer.cs + + + + + + + diff --git a/SettingBluetooth/SettingBluetooth/TextResources/Resources.Designer.cs b/SettingBluetooth/SettingBluetooth/TextResources/Resources.Designer.cs new file mode 100644 index 0000000..283fede --- /dev/null +++ b/SettingBluetooth/SettingBluetooth/TextResources/Resources.Designer.cs @@ -0,0 +1,318 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace SettingBluetooth.TextResources { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // 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 Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + static private string mResourcePath = ""; + + static public void SetPath(string path) + { + mResourcePath = path; + } + static public string GetPath() + { + return mResourcePath; + } + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [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("SettingBluetooth.TextResources.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to Cancel. + /// + public static string IDS_BR_SK_CANCEL { + get { + return ResourceManager.GetString("IDS_BR_SK_CANCEL", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Available devices. + /// + public static string IDS_BT_BODY_AVAILABLE_DEVICES { + get { + return ResourceManager.GetString("IDS_BT_BODY_AVAILABLE_DEVICES", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Bluetooth. + /// + public static string IDS_BT_BODY_BLUETOOTH { + get { + return ResourceManager.GetString("IDS_BT_BODY_BLUETOOTH", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Connection options. + /// + public static string IDS_BT_BODY_CONNECTION_OPTIONS { + get { + return ResourceManager.GetString("IDS_BT_BODY_CONNECTION_OPTIONS", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Details. + /// + public static string IDS_BT_BODY_DETAILS { + get { + return ResourceManager.GetString("IDS_BT_BODY_DETAILS", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Device name. + /// + public static string IDS_BT_BODY_DEVICENAME { + get { + return ResourceManager.GetString("IDS_BT_BODY_DEVICENAME", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Disconnecting.... + /// + public static string IDS_BT_BODY_DISCONNECTING { + get { + return ResourceManager.GetString("IDS_BT_BODY_DISCONNECTING", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Media audio. + /// + public static string IDS_BT_BODY_MEDIA_AUDIO { + get { + return ResourceManager.GetString("IDS_BT_BODY_MEDIA_AUDIO", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Paired. + /// + public static string IDS_BT_BODY_PAIRED { + get { + return ResourceManager.GetString("IDS_BT_BODY_PAIRED", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Paired devices. + /// + public static string IDS_BT_BODY_PAIRED_DEVICES { + get { + return ResourceManager.GetString("IDS_BT_BODY_PAIRED_DEVICES", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Rename. + /// + public static string IDS_BT_BODY_RENAME { + get { + return ResourceManager.GetString("IDS_BT_BODY_RENAME", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Scanning for devices.... + /// + public static string IDS_BT_BODY_SCANNING_FOR_DEVICES_ING { + get { + return ResourceManager.GetString("IDS_BT_BODY_SCANNING_FOR_DEVICES_ING", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Turn on Bluetooth to see a list of devices you can pair with or have already paired with.. + /// + public static string IDS_BT_BODY_TURN_ON_BLUETOOTH_TO_SEE_A_LIST_OF_DEVICES_YOU_CAN_PAIR_WITH_OR_HAVE_ALREADY_PAIRED_WITH { + get { + return ResourceManager.GetString("IDS_BT_BODY_TURN_ON_BLUETOOTH_TO_SEE_A_LIST_OF_DEVICES_YOU_CAN_PAIR_WITH_OR_HAVE_" + + "ALREADY_PAIRED_WITH", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Use for. + /// + public static string IDS_BT_BODY_USE_FOR { + get { + return ResourceManager.GetString("IDS_BT_BODY_USE_FOR", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Your device ({0}) is currently visible to nearby devices.. + /// + public static string IDS_BT_BODY_YOUR_DEVICE_IS_CURRENTLY_VISIBLE_TO_NEARBY_DEVICES { + get { + return ResourceManager.GetString("IDS_BT_BODY_YOUR_DEVICE_IS_CURRENTLY_VISIBLE_TO_NEARBY_DEVICES", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Tizen. + /// + public static string IDS_BT_BODY_YOUR_DEVICE_IS_CURRENTLY_VISIBLE_TO_NEARBY_DEVICES_MODEL_NAME { + get { + return ResourceManager.GetString("IDS_BT_BODY_YOUR_DEVICE_IS_CURRENTLY_VISIBLE_TO_NEARBY_DEVICES_MODEL_NAME", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Disconnect device. + /// + public static string IDS_BT_HEADER_DISCONNECT_DEVICE_ABB { + get { + return ResourceManager.GetString("IDS_BT_HEADER_DISCONNECT_DEVICE_ABB", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unpair. + /// + public static string IDS_BT_OPT_UNPAIR { + get { + return ResourceManager.GetString("IDS_BT_OPT_UNPAIR", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Searching services.... + /// + public static string IDS_BT_POP_SEARCHING_SERVICES_ING { + get { + return ResourceManager.GetString("IDS_BT_POP_SEARCHING_SERVICES_ING", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Connected. + /// + public static string IDS_BT_SBODY_CONNECTED_M_STATUS { + get { + return ResourceManager.GetString("IDS_BT_SBODY_CONNECTED_M_STATUS", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Connecting.... + /// + public static string IDS_BT_SBODY_CONNECTING_ING { + get { + return ResourceManager.GetString("IDS_BT_SBODY_CONNECTING_ING", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Disconnect. + /// + public static string IDS_BT_SK_DISCONNECT { + get { + return ResourceManager.GetString("IDS_BT_SK_DISCONNECT", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Scan. + /// + public static string IDS_BT_SK_SCAN { + get { + return ResourceManager.GetString("IDS_BT_SK_SCAN", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Stop. + /// + public static string IDS_BT_SK_STOP { + get { + return ResourceManager.GetString("IDS_BT_SK_STOP", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Turning off Bluetooth.... + /// + public static string IDS_ST_BODY_TURNING_OFF_BLUETOOTH { + get { + return ResourceManager.GetString("IDS_ST_BODY_TURNING_OFF_BLUETOOTH", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Turning on Bluetooth.... + /// + public static string IDS_ST_BODY_TURNING_ON_BLUETOOTH { + get { + return ResourceManager.GetString("IDS_ST_BODY_TURNING_ON_BLUETOOTH", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This will end your connection with {0}.. + /// + public static string IDS_WMGR_POP_THIS_WILL_END_YOUR_CONNECTION_WITH_PS { + get { + return ResourceManager.GetString("IDS_WMGR_POP_THIS_WILL_END_YOUR_CONNECTION_WITH_PS", resourceCulture); + } + } + } +} diff --git a/SettingBluetooth/SettingBluetooth/TextResources/Resources.en-US.resx b/SettingBluetooth/SettingBluetooth/TextResources/Resources.en-US.resx new file mode 100644 index 0000000..f12a509 --- /dev/null +++ b/SettingBluetooth/SettingBluetooth/TextResources/Resources.en-US.resx @@ -0,0 +1,201 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Cancel + + + Available devices + + + Bluetooth + + + Connection options + + + Details + + + Device name + + + Disconnecting... + + + Media audio + + + Paired + + + Paired devices + + + Rename + + + Scanning for devices... + + + Turn on Bluetooth to see a list of devices you can pair with or have already paired with. + + + Use for + + + Your device ({0}) is currently visible to nearby devices. + + + Tizen + + + Disconnect device + + + Unpair + + + Searching services... + + + Connected + + + Connecting... + + + Disconnect + + + Scan + + + Stop + + + Turning off Bluetooth... + + + Turning on Bluetooth... + + + This will end your connection with {0}. + + diff --git a/SettingBluetooth/SettingBluetooth/TextResources/Resources.ko-KR.resx b/SettingBluetooth/SettingBluetooth/TextResources/Resources.ko-KR.resx new file mode 100644 index 0000000..2c3d8c3 --- /dev/null +++ b/SettingBluetooth/SettingBluetooth/TextResources/Resources.ko-KR.resx @@ -0,0 +1,201 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 취소 + + + 연결 가능한 디바이스 + + + 블루투스 + + + 연결 옵션 + + + 상세정보 + + + 디바이스 이름 + + + 연결을 해제하는 중... + + + 미디어 오디오 + + + 등록됨 + + + 등록된 디바이스 + + + 개명 + + + 디바이스 찾는 중... + + + 블루투스를 켜면 페어링할 수 있거나 이미 페어링된 장치 목록이 표시됩니다. + + + 에 사용 + + + 장치 ({0})는 현재 근처의 장치에서 볼 수 있습니다. + + + 타이젠 + + + 디바이스 연결 해제 + + + 등록 해제 + + + 서비스 검색 중... + + + 연결됨 + + + 연결 중... + + + 연결 해제 + + + 찾기 + + + 중지 + + + 블루투스를 끄고... + + + 블루투스를 켜면... + + + {0} 디바이스 연결을 해제합니다. + + diff --git a/SettingBluetooth/SettingBluetooth/TextResources/Resources.resx b/SettingBluetooth/SettingBluetooth/TextResources/Resources.resx new file mode 100644 index 0000000..f12a509 --- /dev/null +++ b/SettingBluetooth/SettingBluetooth/TextResources/Resources.resx @@ -0,0 +1,201 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Cancel + + + Available devices + + + Bluetooth + + + Connection options + + + Details + + + Device name + + + Disconnecting... + + + Media audio + + + Paired + + + Paired devices + + + Rename + + + Scanning for devices... + + + Turn on Bluetooth to see a list of devices you can pair with or have already paired with. + + + Use for + + + Your device ({0}) is currently visible to nearby devices. + + + Tizen + + + Disconnect device + + + Unpair + + + Searching services... + + + Connected + + + Connecting... + + + Disconnect + + + Scan + + + Stop + + + Turning off Bluetooth... + + + Turning on Bluetooth... + + + This will end your connection with {0}. + + diff --git a/SettingBluetooth/SettingBluetooth/View/BtDetailView.cs b/SettingBluetooth/SettingBluetooth/View/BtDetailView.cs index 2fb9614..96cd841 100644 --- a/SettingBluetooth/SettingBluetooth/View/BtDetailView.cs +++ b/SettingBluetooth/SettingBluetooth/View/BtDetailView.cs @@ -1,4 +1,5 @@ -using System; +using SettingBluetooth.TextResources; +using System; using System.Collections.Generic; using System.Text; using Tizen; @@ -51,7 +52,7 @@ namespace SettingBluetooth var unpairButton = new DefaultLinearItem() { WidthSpecification = LayoutParamPolicies.MatchParent, - Text = Resources.IDS_BT_OPT_UNPAIR, + Text = ResourceManager.TextResourceManager.NUIGadgetResourceManager.GetString(nameof(Resources.IDS_BT_OPT_UNPAIR)), }; unpairButton.Clicked += (obj, ev) => { @@ -64,7 +65,7 @@ namespace SettingBluetooth var useForHeader = new DefaultLinearItem() { WidthSpecification = LayoutParamPolicies.MatchParent, - Text = Resources.IDS_BT_BODY_USE_FOR, + Text = ResourceManager.TextResourceManager.NUIGadgetResourceManager.GetString(nameof(Resources.IDS_BT_BODY_USE_FOR)), Margin = new Extents(8, 0, 0, 0).SpToPx(), }; useForHeader.Label.TextColor = Color.Grey; @@ -90,7 +91,7 @@ namespace SettingBluetooth var mediaAudioItem = new DefaultLinearItem() { WidthSpecification = LayoutParamPolicies.MatchParent, - Text = Resources.IDS_BT_BODY_MEDIA_AUDIO, + Text = ResourceManager.TextResourceManager.NUIGadgetResourceManager.GetString(nameof(Resources.IDS_BT_BODY_MEDIA_AUDIO)), }; var mediaAudioSwitch = new Switch() { @@ -116,7 +117,7 @@ namespace SettingBluetooth var label = new TextLabel { WidthSpecification = LayoutParamPolicies.MatchParent, - Text = Resources.IDS_BT_BODY_RENAME, + Text = ResourceManager.TextResourceManager.NUIGadgetResourceManager.GetString(nameof(Resources.IDS_BT_BODY_RENAME)), Margin = new Extents(16, 0, 0, 0).SpToPx(), }; @@ -160,7 +161,7 @@ namespace SettingBluetooth { var appBar = new AppBar() { - Title = Resources.IDS_BT_BODY_DETAILS, + Title = ResourceManager.TextResourceManager.NUIGadgetResourceManager.GetString(nameof(Resources.IDS_BT_BODY_DETAILS)), }; AppBarStyle appBarStyle = (AppBarStyle)ThemeManager.GetStyle("Tizen.NUI.Components.AppBar"); Button backButton = new Button(((AppBarStyle)appBarStyle).BackButton); diff --git a/SettingBluetooth/SettingBluetooth/View/BtDeviceView.cs b/SettingBluetooth/SettingBluetooth/View/BtDeviceView.cs index b23660f..be3b190 100644 --- a/SettingBluetooth/SettingBluetooth/View/BtDeviceView.cs +++ b/SettingBluetooth/SettingBluetooth/View/BtDeviceView.cs @@ -1,3 +1,4 @@ +using SettingBluetooth.TextResources; using ElmSharp.Accessible; using SettingCore; using System; @@ -211,8 +212,8 @@ namespace SettingBluetooth public DeviceSource() { Log.Info(SettingBluetooth.LogTag, "DeviceSource created"); - mSearched = new DeviceCollection(Resources.IDS_BT_BODY_SCANNING_FOR_DEVICES_ING); - mPaired = new DeviceCollection(Resources.IDS_BT_BODY_PAIRED_DEVICES); + mSearched = new DeviceCollection(ResourceManager.TextResourceManager.NUIGadgetResourceManager.GetString(nameof(Resources.IDS_BT_BODY_SCANNING_FOR_DEVICES_ING))); + mPaired = new DeviceCollection(ResourceManager.TextResourceManager.NUIGadgetResourceManager.GetString(nameof(Resources.IDS_BT_BODY_PAIRED_DEVICES))); this.Add(mSearched); } @@ -314,20 +315,20 @@ namespace SettingBluetooth break; case BtDeviceState.Pairing: case BtDeviceState.Connecting: - device.State = Resources.IDS_BT_SBODY_CONNECTING_ING; + device.State = ResourceManager.TextResourceManager.NUIGadgetResourceManager.GetString(nameof(Resources.IDS_BT_SBODY_CONNECTING_ING)); break; case BtDeviceState.Unpairing: case BtDeviceState.Disconnecting: - device.State = Resources.IDS_BT_BODY_DISCONNECTING; + device.State = ResourceManager.TextResourceManager.NUIGadgetResourceManager.GetString(nameof(Resources.IDS_BT_BODY_DISCONNECTING)); break; case BtDeviceState.Paired: - device.State = Resources.IDS_BT_BODY_PAIRED; + device.State = ResourceManager.TextResourceManager.NUIGadgetResourceManager.GetString(nameof(Resources.IDS_BT_BODY_PAIRED)); break; case BtDeviceState.Connected: - device.State = Resources.IDS_BT_SBODY_CONNECTED_M_STATUS; + device.State = ResourceManager.TextResourceManager.NUIGadgetResourceManager.GetString(nameof(Resources.IDS_BT_SBODY_CONNECTED_M_STATUS)); break; case BtDeviceState.ServiceSearching: - device.State = Resources.IDS_BT_POP_SEARCHING_SERVICES_ING; + device.State = device.State = ResourceManager.TextResourceManager.NUIGadgetResourceManager.GetString(nameof(Resources.IDS_BT_POP_SEARCHING_SERVICES_ING)); break; } //Log.Info(LogTag, "Device(" + btDevice.Address + ") updated. state: " + device.State); diff --git a/SettingBluetooth/SettingBluetooth/View/BtMainView.cs b/SettingBluetooth/SettingBluetooth/View/BtMainView.cs index 302bdbd..abdd960 100644 --- a/SettingBluetooth/SettingBluetooth/View/BtMainView.cs +++ b/SettingBluetooth/SettingBluetooth/View/BtMainView.cs @@ -1,4 +1,5 @@ -using System; +using SettingBluetooth.TextResources; +using System; using System.Collections.Generic; using System.Linq; using Tizen; @@ -43,22 +44,22 @@ namespace SettingBluetooth internal static void ShowBtOffMessage() { - mBtMessage.Text = Resources.IDS_BT_BODY_TURN_ON_BLUETOOTH_TO_SEE_A_LIST_OF_DEVICES_YOU_CAN_PAIR_WITH_OR_HAVE_ALREADY_PAIRED_WITH; + mBtMessage.Text = ResourceManager.TextResourceManager.NUIGadgetResourceManager.GetString(nameof(Resources.IDS_BT_BODY_TURN_ON_BLUETOOTH_TO_SEE_A_LIST_OF_DEVICES_YOU_CAN_PAIR_WITH_OR_HAVE_ALREADY_PAIRED_WITH)); } internal static void ShowBtOnMessage() { - mBtMessage.Text = string.Format(Resources.IDS_BT_BODY_YOUR_DEVICE_IS_CURRENTLY_VISIBLE_TO_NEARBY_DEVICES, BtModel.Name); + mBtMessage.Text = string.Format(ResourceManager.TextResourceManager.NUIGadgetResourceManager.GetString(nameof(Resources.IDS_BT_BODY_YOUR_DEVICE_IS_CURRENTLY_VISIBLE_TO_NEARBY_DEVICES)), ResourceManager.TextResourceManager.NUIGadgetResourceManager.GetString(nameof(Resources.IDS_BT_BODY_YOUR_DEVICE_IS_CURRENTLY_VISIBLE_TO_NEARBY_DEVICES_MODEL_NAME))); } internal static void ShowBtTurningOnMessage() { - mBtMessage.Text = Resources.IDS_ST_BODY_TURNING_ON_BLUETOOTH; + mBtMessage.Text = ResourceManager.TextResourceManager.NUIGadgetResourceManager.GetString(nameof(Resources.IDS_ST_BODY_TURNING_ON_BLUETOOTH)); } internal static void ShowBtTurningOffMessage() { - mBtMessage.Text = Resources.IDS_ST_BODY_TURNING_OFF_BLUETOOTH; + mBtMessage.Text = ResourceManager.TextResourceManager.NUIGadgetResourceManager.GetString(nameof(Resources.IDS_ST_BODY_TURNING_OFF_BLUETOOTH)); } private static void BtModelOperationStateChanged(object obj, BtOperationStateChangedEventArgs ev) @@ -83,12 +84,12 @@ namespace SettingBluetooth break; case BtOperationState.Searching: BtDeviceView.RemoveAllSearchedDevices(); - BtDeviceView.UpdateSearchedTitle(Resources.IDS_BT_BODY_SCANNING_FOR_DEVICES_ING); - BtDeviceView.UpdateScanButtonText(Resources.IDS_BT_SK_STOP); + BtDeviceView.UpdateSearchedTitle(ResourceManager.TextResourceManager.NUIGadgetResourceManager.GetString(nameof(Resources.IDS_BT_BODY_SCANNING_FOR_DEVICES_ING))); + BtDeviceView.UpdateScanButtonText(ResourceManager.TextResourceManager.NUIGadgetResourceManager.GetString(nameof(Resources.IDS_BT_SK_STOP))); break; case BtOperationState.Searched: - BtDeviceView.UpdateSearchedTitle(Resources.IDS_BT_BODY_AVAILABLE_DEVICES); - BtDeviceView.UpdateScanButtonText(Resources.IDS_BT_SK_SCAN); + BtDeviceView.UpdateSearchedTitle(ResourceManager.TextResourceManager.NUIGadgetResourceManager.GetString(nameof(Resources.IDS_BT_BODY_AVAILABLE_DEVICES))); + BtDeviceView.UpdateScanButtonText(ResourceManager.TextResourceManager.NUIGadgetResourceManager.GetString(nameof(Resources.IDS_BT_SK_SCAN))); break; case BtOperationState.Pairing: break; @@ -118,7 +119,7 @@ namespace SettingBluetooth var onOffItem = new DefaultLinearItem { WidthSpecification = LayoutParamPolicies.MatchParent, - Text = Resources.IDS_BT_BODY_BLUETOOTH, + Text = ResourceManager.TextResourceManager.NUIGadgetResourceManager.GetString(nameof(Resources.IDS_BT_BODY_BLUETOOTH)), }; onOffItem.Label.HorizontalAlignment = HorizontalAlignment.Begin; diff --git a/SettingBluetooth/SettingBluetooth/View/ResourceManager.cs b/SettingBluetooth/SettingBluetooth/View/ResourceManager.cs new file mode 100644 index 0000000..5f8fa3e --- /dev/null +++ b/SettingBluetooth/SettingBluetooth/View/ResourceManager.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using SettingBluetooth; + +namespace SettingBluetooth +{ + public class ResourceManager + { + public static SettingBluetooth TextResourceManager; + } +} diff --git a/SettingBluetooth/SettingBluetooth/View/Resources.cs b/SettingBluetooth/SettingBluetooth/View/Resources.cs deleted file mode 100644 index 66e6579..0000000 --- a/SettingBluetooth/SettingBluetooth/View/Resources.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace SettingBluetooth -{ - static class Resources - { - static private string mResourcePath = ""; - - static public void SetPath(string path) - { - mResourcePath = path; - } - static public string GetPath() - { - return mResourcePath; - } - - static public string IDS_BT_BODY_SCANNING_FOR_DEVICES_ING = "Scanning for devices..."; - static public string IDS_ST_BODY_TURNING_OFF_BLUETOOTH = "Turning off Bluetooth..."; - static public string IDS_ST_BODY_TURNING_ON_BLUETOOTH = "Turning on Bluetooth..."; - static public string IDS_BT_SK_STOP = "Stop"; - static public string IDS_BT_BODY_AVAILABLE_DEVICES = "Available devices"; - static public string IDS_BT_SK_SCAN = "Scan"; - static public string IDS_BT_BODY_BLUETOOTH = "Bluetooth"; - static public string IDS_BT_BODY_PAIRED_DEVICES = "Paired devices"; - static public string IDS_BT_SBODY_CONNECTING_ING = "Connecting..."; - static public string IDS_BT_BODY_DISCONNECTING = "Disconnecting"; - static public string IDS_BT_BODY_PAIRED = "Paired"; - static public string IDS_BT_SBODY_CONNECTED_M_STATUS = "Connected"; - static public string IDS_BT_POP_SEARCHING_SERVICES_ING = "Searching services..."; - static public string IDS_BT_BODY_DETAILS = "Details"; - static public string IDS_BT_BODY_DEVICENAME = "Device name"; - static public string IDS_BT_OPT_UNPAIR = "Unpair"; - static public string IDS_BT_BODY_USE_FOR = "Use for"; - static public string IDS_BT_BODY_MEDIA_AUDIO = "Media audio"; - static public string IDS_BT_SK_DISCONNECT = "Disconnect"; - static public string IDS_BT_HEADER_DISCONNECT_DEVICE_ABB = "Disconnect device"; - static public string IDS_WMGR_POP_THIS_WILL_END_YOUR_CONNECTION_WITH_PS = "This will end your connection with {0}."; - static public string IDS_BT_BODY_TURN_ON_BLUETOOTH_TO_SEE_A_LIST_OF_DEVICES_YOU_CAN_PAIR_WITH_OR_HAVE_ALREADY_PAIRED_WITH - = "Turn on Bluetooth to see a list of devices you can pair with or have already paired with."; - static public string IDS_BT_BODY_YOUR_DEVICE_IS_CURRENTLY_VISIBLE_TO_NEARBY_DEVICES - = "Your device ({0}) is currently visible to nearby devices."; - static public string IDS_BT_BODY_RENAME = "Rename"; - } -} diff --git a/SettingBluetooth/SettingBluetooth/tizen-manifest.xml b/SettingBluetooth/SettingBluetooth/tizen-manifest.xml index 165532d..d126af7 100644 --- a/SettingBluetooth/SettingBluetooth/tizen-manifest.xml +++ b/SettingBluetooth/SettingBluetooth/tizen-manifest.xml @@ -9,7 +9,9 @@ /> + + - + diff --git a/packaging/org.tizen.cssetting-bluetooth-1.9.0.rpk b/packaging/org.tizen.cssetting-bluetooth-1.9.0.rpk index d9f1a0e..fe04699 100644 Binary files a/packaging/org.tizen.cssetting-bluetooth-1.9.0.rpk and b/packaging/org.tizen.cssetting-bluetooth-1.9.0.rpk differ