localization

Localization with String interpolation in SwiftUI

戏子无情 提交于 2021-02-07 13:57:39
问题 I am trying to localize my SwiftUI Watch app. I don't have any problems with static strings. I use LocalizedKeyStrings in my Text views and add my translations in Localizable.strings files. For example: Text("history") in Localizable.strings: "history" = "Historique"; Result : "Historique" But I also want to localize stings using interpolation. For example: Text("startCustom \(format: "%.1f",customDistance)") In Localizable.strings, I have tried with different syntax: "startCustom %@" =

IOS/iPhone: Nested Localizable.strings Files?

核能气质少年 提交于 2021-02-07 13:19:37
问题 I'm creating an app that will have a number of variants. These variants will be controlled by a few strings in multiple Localizable.strings files. However, 90% of the strings will remain the same. I'd like to have it so that each of the unique Localizable.strings files imports the "master" one, so that I don't have to go through each of the app variant files when I want to change a common string. Is this possible? 回答1: Two alternatives: Use custom wrapper functions around NSLocalizedString

Translate attributed string

纵然是瞬间 提交于 2021-02-07 11:36:30
问题 I have a UILabel with an attributed string. Here is a printscreen of it: Now, I have to translate this attributed string to english and italian. I am searching for a way to do this. Can I build this attributed string in code part by part? I have only found a solution where the whole string is set and then the attributes are set by range. But when I translate the string, I don't know the range anymore, because the words are longer or smaller. 回答1: Another option is to create localized .rtf

Load “loose” localized resources at runtime?

别等时光非礼了梦想. 提交于 2021-02-07 10:47:35
问题 I have a web service which supplies me with a generated .resx (XML only) which I then convert to binary a .resources file. I am currently generating an assembly file with that using al.exe . Here are my arguments: /t:lib /c:{culture} /embed:"{.resource input}" /out:"{.dll output}" Loading this assembly in via Assembly.LoadFrom(file) works fine, but I believe that my assembly is not properly generated. It has no type, namespace, or methods to invoke and therefor no ResourceManager apparently.

Multiliteration implementation with inaccurate distance data

烂漫一生 提交于 2021-02-07 10:20:36
问题 I am trying to create an android smartphone application which uses Apples iBeacon technology to determine the current indoor location of itself. I already managed to get all available beacons and calculate the distance to them via the rssi signal. Currently I face the problem, that I am not able to find any library or implementation of an algorithm, which calculates the estimated location in 2D by using 3 (or more) distances of fixed points with the condition, that these distances are not

Localizing Enum entry on asp.net core

半世苍凉 提交于 2021-02-07 08:18:27
问题 How can I localize the following enum entries on asp.net core? I found few issues on asp.net-core github repository ( https://github.com/aspnet/Mvc/pull/5185 ), but I can't find a proper way to do it. Target enum: public enum TestEnum { [Display(Name = "VALUE1_RESX_ENTRY_KEY")] Value1, [Display(Name = "VALUE3_RESX_ENTRY_KEY")] Value2 } CSHTML code block: <select id="test" asp-items="Html.GetEnumSelectList<TestEnum>()"> </select> Resource files: 回答1: It seems to be a bug which will be fixed in

Localizing Enum entry on asp.net core

允我心安 提交于 2021-02-07 08:17:53
问题 How can I localize the following enum entries on asp.net core? I found few issues on asp.net-core github repository ( https://github.com/aspnet/Mvc/pull/5185 ), but I can't find a proper way to do it. Target enum: public enum TestEnum { [Display(Name = "VALUE1_RESX_ENTRY_KEY")] Value1, [Display(Name = "VALUE3_RESX_ENTRY_KEY")] Value2 } CSHTML code block: <select id="test" asp-items="Html.GetEnumSelectList<TestEnum>()"> </select> Resource files: 回答1: It seems to be a bug which will be fixed in

Localizing Enum entry on asp.net core

自闭症网瘾萝莉.ら 提交于 2021-02-07 08:17:47
问题 How can I localize the following enum entries on asp.net core? I found few issues on asp.net-core github repository ( https://github.com/aspnet/Mvc/pull/5185 ), but I can't find a proper way to do it. Target enum: public enum TestEnum { [Display(Name = "VALUE1_RESX_ENTRY_KEY")] Value1, [Display(Name = "VALUE3_RESX_ENTRY_KEY")] Value2 } CSHTML code block: <select id="test" asp-items="Html.GetEnumSelectList<TestEnum>()"> </select> Resource files: 回答1: It seems to be a bug which will be fixed in

How to achieve localisation with NoSQL

孤街醉人 提交于 2021-02-07 06:18:07
问题 Until now, I've always used relational databases (and was quite happy indeed!). However, recently, I discovered Parse and found it quite nice so decided to give it a try. However, it comes with a NoSQL database. I am still trying to get my head around it. So my question is, how would you recommend achieving localisation? I could think of the following approaches, what do you think? Approach A: Have a single 'strings' field on the document and store all language specific data in that field.

Cannot set the default language in Android Studio

六眼飞鱼酱① 提交于 2021-02-07 06:17:36
问题 I am getting warnings in Android Studio about untranslated strings - it is telling me they have not been translated to English. This appears to be because I have an "en-rGB" resource folder. But I have tried to follow the instructions in lint to specify the default language, but this has not worked. I have the following strings.xml files: values/strings.xml : <resources xmlns:tools="http://schemas.android.com/tools" tools:locale="en"> <string name="string1">Howdy</string> <string name=