From: Piotr Czaja Date: Fri, 8 Dec 2023 05:34:36 +0000 (+0100) Subject: Add missing translations. X-Git-Tag: accepted/tizen/unified/20231219.041305~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f272e007267f94d7e253226cc9c05ef09fd4e522;p=profile%2Fiot%2Fapps%2Fdotnet%2Fsetting-accessibility.git Add missing translations. Change-Id: I3bbd41ea4c7c4b27eb8a59c1226de7f9d1da1a1c Signed-off-by: Piotr Czaja --- diff --git a/SettingAccessibility/.gitattributes b/SettingAccessibility/.gitattributes index 81d23e1..45df184 100644 --- a/SettingAccessibility/.gitattributes +++ b/SettingAccessibility/.gitattributes @@ -1,4 +1,4 @@ -* text=auto +* text=auto eol=lf *.cs eol=lf *.csproj eol=lf *.sln eol=lf diff --git a/SettingAccessibility/.gitignore b/SettingAccessibility/.gitignore index 881c36d..8d6c692 100644 --- a/SettingAccessibility/.gitignore +++ b/SettingAccessibility/.gitignore @@ -7,3 +7,5 @@ **/.gn **/[Bb]uild/ **/res/allowed/*.dll +**/res/allowed/*/*.dll +*.user diff --git a/SettingAccessibility/SettingAccessibility/LanguageMenu.cs b/SettingAccessibility/SettingAccessibility/LanguageMenu.cs index 017fbe1..64e257b 100644 --- a/SettingAccessibility/SettingAccessibility/LanguageMenu.cs +++ b/SettingAccessibility/SettingAccessibility/LanguageMenu.cs @@ -1,4 +1,5 @@ -using Tizen.NUI; +using SettingAccessibility.TextResources; +using Tizen.NUI; using Tizen.NUI.BaseComponents; using Tizen.NUI.Components; @@ -6,7 +7,7 @@ namespace SettingAccessibility { public class LanguageMenu : SettingCore.MenuGadget { - public override string ProvideTitle() => "Voice Type & Language"; + public override string ProvideTitle() => NUIGadgetResourceManager.GetString(nameof(Resources.IDS_ST_VOICE_TYPE_AND_LANGUAGE)); protected override View OnCreate() { diff --git a/SettingAccessibility/SettingAccessibility/SettingAccessibility.cs b/SettingAccessibility/SettingAccessibility/SettingAccessibility.cs index 4fe5439..b1613e9 100644 --- a/SettingAccessibility/SettingAccessibility/SettingAccessibility.cs +++ b/SettingAccessibility/SettingAccessibility/SettingAccessibility.cs @@ -2,15 +2,17 @@ using Tizen.NUI; using Tizen.NUI.BaseComponents; using Tizen.NUI.Components; +using SettingAccessibility.TextResources; +using Tizen.Uix.Tts; namespace SettingAccessibility { public class SettingAccessibility : SettingCore.MainMenuGadget { - public override Color ProvideIconColor() => new Color(ThemeManager.PlatformThemeId == "org.tizen.default-light-theme" ? "#205493" : "#2560A8"); + public override Color ProvideIconColor() => new Color(IsLightTheme ? "#205493" : "#2560A8"); public override string ProvideIconPath() => GetResourcePath("accessibility-icon.svg"); // TODO: replace fixed string with Resources dictionary - public override string ProvideTitle() => "Talk Back"; + public override string ProvideTitle() => NUIGadgetResourceManager.GetString(nameof(Resources.IDS_ST_HEADER_TALK_BACK)); private static readonly string VCONFKEY_SETAPPL_ACCESSIBILITY_TTS = "db/setting/accessibility/tts"; @@ -23,6 +25,14 @@ namespace SettingAccessibility private View scrollableContent; private IList sections = new List(); + static Dictionary voiceTypeResourceKeys = new Dictionary + { + { Voice.Auto, nameof(Resources.IDS_ST_TTS_VOICE_AUTO)}, + { Voice.Male, nameof(Resources.IDS_ST_TTS_VOICE_MALE)}, + { Voice.Female, nameof(Resources.IDS_ST_TTS_VOICE_FEMALE)}, + { Voice.Child, nameof(Resources.IDS_ST_TTS_VOICE_CHILD)}, + }; + protected override View OnCreate() { base.OnCreate(); @@ -68,7 +78,7 @@ namespace SettingAccessibility Interop.Vconf.GetVconfBool(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, out bool isScreenReaderOn); // TODO: replace fixed string with Resources dictionary - var screenReader = new SettingCore.Views.SwitchListItem("Screen Reader (TTS)", isSelected: isScreenReaderOn); + var screenReader = new SettingCore.Views.SwitchListItem(NUIGadgetResourceManager.GetString(nameof(Resources.IDS_ST_SCREEN_READER_TTS)), isSelected: isScreenReaderOn); screenReader.Switch.SelectedChanged += (s, e) => { Interop.Vconf.SetVconfBool(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, e.IsSelected); @@ -78,8 +88,7 @@ namespace SettingAccessibility var info = new TextLabel { - // TODO: replace fixed string with Resources dictionary - Text = "While Screen reader is enabled, your phone will provide voice feedback.\r\nFor example, Screen reader will tell you what you can interact with on each screen.\r\nTap items to select them and hear what they are, and double tap items\r\nto perform the selected action.", + Text = NUIGadgetResourceManager.GetString(nameof(Resources.IDS_ACCS_BODY_WHILE_SCREEN_READER_IS_ENABLED_YOUR_PHONE_WILL_PROVIDE_VOICE_FEEDBACK_FOR_EXAMPLE_SCREEN_READER_WILL_MSG)), MultiLine = true, PixelSize = 24.SpToPx(), TextColor = new Color("#83868F"), @@ -92,21 +101,18 @@ namespace SettingAccessibility var speedRange = tts.GetSpeedRange(); tts.Dispose(); - // TODO: replace fixed string with Resources dictionary - var language = SettingCore.Views.TextListItem.CreatePrimaryTextItemWithSecondaryText("Voice Type & Language", $"{defaultVoice.VoiceType}, {defaultVoice.Language}"); + var language = SettingCore.Views.TextListItem.CreatePrimaryTextItemWithSecondaryText(NUIGadgetResourceManager.GetString(nameof(Resources.IDS_ST_VOICE_TYPE_AND_LANGUAGE)), $"{GetName(defaultVoice)}, {defaultVoice.Language}"); language.Clicked += (s, e) => { NavigateTo(MenuProvider.TalkBack_Language); }; sections.Add(language); - // TODO: replace fixed string with Resources dictionary - var volume = SettingCore.Views.TextListItem.CreatePrimaryTextItemWithSecondaryText("Volume", "75%"); + var volume = SettingCore.Views.TextListItem.CreatePrimaryTextItemWithSecondaryText(NUIGadgetResourceManager.GetString(nameof(Resources.IDS_ST_TTS_VOICE_VOLUME)), "75%"); volume.IsEnabled = false; sections.Add(volume); - // TODO: replace fixed string with Resources dictionary - var speechRate = new SpeechRateRow("Speech rate", GetResourcePath("walking-icon.svg"), GetResourcePath("running-icon.svg")); + var speechRate = new SpeechRateRow(NUIGadgetResourceManager.GetString(nameof(Resources.IDS_ST_TTS_SPEECH_RATE)), GetResourcePath("walking-icon.svg"), GetResourcePath("running-icon.svg")); speechRate.Slider.MinValue = speedRange.Min; speechRate.Slider.MaxValue = speedRange.Max; // TODO: use actual value from vconf for CurrentValue, instead of speedRange.Normal @@ -119,8 +125,7 @@ namespace SettingAccessibility sections.Add(speechRate); Interop.Vconf.GetVconfBool(VCONFKEY_SETAPPL_ACCESSIBILITY_SCREEN_READER_KEYBOARD_FEEDBACK, out bool keyboardFeedbackValue); - // TODO: replace fixed string with Resources dictionary - var keyboardFeedback = new SettingCore.Views.SwitchListItem("Keyboard feedback", "Always read keyboard input aload", keyboardFeedbackValue); + var keyboardFeedback = new SettingCore.Views.SwitchListItem(NUIGadgetResourceManager.GetString(nameof(Resources.IDS_ST_TTS_KEYBOARD_FEEDBACK)), NUIGadgetResourceManager.GetString(nameof(Resources.IDS_ST_TTS_KEYBOARD_INPUT_ALOAD)), keyboardFeedbackValue); keyboardFeedback.Switch.SelectedChanged += (s, e) => { Interop.Vconf.SetVconfBool(VCONFKEY_SETAPPL_ACCESSIBILITY_SCREEN_READER_KEYBOARD_FEEDBACK, e.IsSelected); @@ -128,8 +133,7 @@ namespace SettingAccessibility sections.Add(keyboardFeedback); Interop.Vconf.GetVconfBool(VCONFKEY_SETAPPL_ACCESSIBILITY_SCREEN_READER_DESCRIPTION, out bool readUsageHintsAloudValue); - // TODO: replace fixed string with Resources dictionary - var readUsageHintsAloud = new SettingCore.Views.SwitchListItem("Read usage hints aloud", isSelected: readUsageHintsAloudValue); + var readUsageHintsAloud = new SettingCore.Views.SwitchListItem(NUIGadgetResourceManager.GetString(nameof(Resources.IDS_ST_TTS_READ_USAGE_HINTS_ALOAD)), isSelected: readUsageHintsAloudValue); readUsageHintsAloud.Switch.SelectedChanged += (s, e) => { Interop.Vconf.SetVconfBool(VCONFKEY_SETAPPL_ACCESSIBILITY_SCREEN_READER_DESCRIPTION, e.IsSelected); @@ -137,8 +141,7 @@ namespace SettingAccessibility sections.Add(readUsageHintsAloud); Interop.Vconf.GetVconfBool(VCONFKEY_SETAPPL_ACCESSIBILITY_SCREEN_READER_HAPTIC, out bool vibrationFeedbackValue); - // TODO: replace fixed string with Resources dictionary - var vibrationFeedback = new SettingCore.Views.SwitchListItem("Vibration feedback", isSelected: vibrationFeedbackValue); + var vibrationFeedback = new SettingCore.Views.SwitchListItem(NUIGadgetResourceManager.GetString(nameof(Resources.IDS_ST_TTS_VIBRATION_FEEDBACK)), isSelected: vibrationFeedbackValue); vibrationFeedback.Switch.SelectedChanged += (s, e) => { Interop.Vconf.SetVconfBool(VCONFKEY_SETAPPL_ACCESSIBILITY_SCREEN_READER_HAPTIC, e.IsSelected); @@ -146,8 +149,7 @@ namespace SettingAccessibility sections.Add(vibrationFeedback); Interop.Vconf.GetVconfBool(VCONFKEY_SETAPPL_ACCESSIBILITY_SCREEN_READER_SOUND_FEEDBACK, out bool soundFeedbackValue); - // TODO: replace fixed string with Resources dictionary - var soundFeedback = new SettingCore.Views.SwitchListItem("Sound feedback", isSelected: soundFeedbackValue); + var soundFeedback = new SettingCore.Views.SwitchListItem(NUIGadgetResourceManager.GetString(nameof(Resources.IDS_ST_TTS_SOUND_FEEDBACK)), isSelected: soundFeedbackValue); soundFeedback.Switch.SelectedChanged += (s, e) => { Interop.Vconf.SetVconfBool(VCONFKEY_SETAPPL_ACCESSIBILITY_SCREEN_READER_SOUND_FEEDBACK, e.IsSelected); @@ -155,7 +157,7 @@ namespace SettingAccessibility sections.Add(soundFeedback); // TODO: replace fixed string with Resources dictionary - var statusBarInformation = SettingCore.Views.TextListItem.CreatePrimaryTextItemWithSubText("Status bar information", "Select which information from indicators shown on the status bar will be read aloud when you triple tap the screen with two fingers, for example, the time and date, the device’s signal strength, Wi-Fi and Bluetooth connections, and the battery power."); + var statusBarInformation = SettingCore.Views.TextListItem.CreatePrimaryTextItemWithSubText(NUIGadgetResourceManager.GetString(nameof(Resources.IDS_ST_TTS_STATUS_BAR_INFO)), NUIGadgetResourceManager.GetString(nameof(Resources.IDS_ST_TTS_STATUS_BAR_INFO_DESCRIPTION))); statusBarInformation.Clicked += (s, e) => { NavigateTo(MenuProvider.TalkBack_StatusBar); @@ -168,5 +170,15 @@ namespace SettingAccessibility scrollableContent.Add(view); } } + + private string GetName(SupportedVoice defaultVoice) + { + if (voiceTypeResourceKeys.TryGetValue(defaultVoice.VoiceType, out string voiceResourceKey)) + { + return NUIGadgetResourceManager.GetString(voiceResourceKey); + } + return defaultVoice.ToString(); + } + } } diff --git a/SettingAccessibility/SettingAccessibility/SettingAccessibility.csproj b/SettingAccessibility/SettingAccessibility/SettingAccessibility.csproj index 0517060..b186239 100644 --- a/SettingAccessibility/SettingAccessibility/SettingAccessibility.csproj +++ b/SettingAccessibility/SettingAccessibility/SettingAccessibility.csproj @@ -1,21 +1,42 @@  - - netcoreapp3.1 - false - - - - portable - - - None - - - - - - + + net6.0 + false + True + + + + portable + + + None + + + + + + + + + + Resources.resx + True + True + + + + + + Resources.Designer.cs + PublicResXFileCodeGenerator + + + + + + + diff --git a/SettingAccessibility/SettingAccessibility/TextResources/Resources.en-US.resx b/SettingAccessibility/SettingAccessibility/TextResources/Resources.en-US.resx new file mode 100644 index 0000000..c072dc8 --- /dev/null +++ b/SettingAccessibility/SettingAccessibility/TextResources/Resources.en-US.resx @@ -0,0 +1,174 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + While Screen reader is enabled, your phone will provide voice feedback. For example, Screen reader will tell you what you can interact with on each screen. Tap items to select them and hear what they are, and double tap items to perform the telated action. + + + Accessibility + + + Talk Back + + + Screen Reader (TTS) + + + Voice Type & Language + + + Auto + + + Male + + + Female + + + Child + + + Volume + + + Speech rate + + + Keyboard feedback + + + Always read keyboard input aload + + + Read usage hints aloud + + + Vibration feedback + + + Sound feedback + + + Status bar information + + + Select which information from indicators shown on the status bar will be read aloud when you triple tap the screen with two fingers, for example, the time and date, the device’s signal strength, Wi-Fi and Bluetooth connections, and the battery power. + + \ No newline at end of file diff --git a/SettingAccessibility/SettingAccessibility/TextResources/Resources.ko-KR.resx b/SettingAccessibility/SettingAccessibility/TextResources/Resources.ko-KR.resx new file mode 100644 index 0000000..e676b26 --- /dev/null +++ b/SettingAccessibility/SettingAccessibility/TextResources/Resources.ko-KR.resx @@ -0,0 +1,175 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + 스크린 리더를 실행하면 음성 피드백을 제공합니다. 예를 들어, 스크린 리더는 각 화면에서 조작할 수 있는 것을 말해줍니다. 항목을 한 번 누르면 들을 수 있고, 두 번 누르면 관련 항목의 작업을 수행합니다. + + + 접근성 + + + Talk Back + + + 텍스트 음성 변환 (TTS) + + + 목소리 타입 & 언어 + + + 자동 + + + 남성 + + + 여성 + + + 아동 + + + 음량 + + + 읽어주는 속도 + + + 키보드 피드백 + + + 키보드 입력 항상 읽기 + + + 사용 힌트 읽기 + + + 진동 피드백 + + + 소리 피드백 + + + 상태표시줄 정보 + + + 두 손가락으로 세번 탭하면 상태표시줄에 표시된 항목 중 어느 정보를 읽을 지 설정합니다. 예를 들면 날짜 및 시간, 디바이스 연결 상태, Wi-Fi 및 블루투스 연결, 배터리 상태 등을 읽을 수 있습니다. + + + \ No newline at end of file diff --git a/SettingAccessibility/SettingAccessibility/TextResources/Resources.resx b/SettingAccessibility/SettingAccessibility/TextResources/Resources.resx new file mode 100644 index 0000000..c072dc8 --- /dev/null +++ b/SettingAccessibility/SettingAccessibility/TextResources/Resources.resx @@ -0,0 +1,174 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + While Screen reader is enabled, your phone will provide voice feedback. For example, Screen reader will tell you what you can interact with on each screen. Tap items to select them and hear what they are, and double tap items to perform the telated action. + + + Accessibility + + + Talk Back + + + Screen Reader (TTS) + + + Voice Type & Language + + + Auto + + + Male + + + Female + + + Child + + + Volume + + + Speech rate + + + Keyboard feedback + + + Always read keyboard input aload + + + Read usage hints aloud + + + Vibration feedback + + + Sound feedback + + + Status bar information + + + Select which information from indicators shown on the status bar will be read aloud when you triple tap the screen with two fingers, for example, the time and date, the device’s signal strength, Wi-Fi and Bluetooth connections, and the battery power. + + \ No newline at end of file diff --git a/SettingAccessibility/SettingAccessibility/tizen-manifest.xml b/SettingAccessibility/SettingAccessibility/tizen-manifest.xml index eb26a00..dd5674e 100644 --- a/SettingAccessibility/SettingAccessibility/tizen-manifest.xml +++ b/SettingAccessibility/SettingAccessibility/tizen-manifest.xml @@ -4,7 +4,10 @@ res-type="org.tizen.appfw.gadget.setting-accessibility" res-version="1.5.0"> - + + + + - + diff --git a/packaging/org.tizen.cssetting-accessibility-1.1.0.rpk b/packaging/org.tizen.cssetting-accessibility-1.1.0.rpk index 1d51d06..4401382 100644 Binary files a/packaging/org.tizen.cssetting-accessibility-1.1.0.rpk and b/packaging/org.tizen.cssetting-accessibility-1.1.0.rpk differ