localization

Changing app locale sometimes doesn't change direction of layouts

萝らか妹 提交于 2020-07-23 07:33:16
问题 I'm changing locale of my app programmatically using the following method. It works fine but when I start an already existing singleTask activity using Intent.FLAG_ACTIVITY_CLEAR_TOP flag. Then application loses the layout direction but translation is correct. For example, if application language is Arabic then all views direction is changed to English locale (left-to-right). What could be the reason? I'm calling following method in attachBaseContext of BaseActivity and Application class.

Changing app locale sometimes doesn't change direction of layouts

泪湿孤枕 提交于 2020-07-23 07:32:08
问题 I'm changing locale of my app programmatically using the following method. It works fine but when I start an already existing singleTask activity using Intent.FLAG_ACTIVITY_CLEAR_TOP flag. Then application loses the layout direction but translation is correct. For example, if application language is Arabic then all views direction is changed to English locale (left-to-right). What could be the reason? I'm calling following method in attachBaseContext of BaseActivity and Application class.

error.localizedDescription always returns English

限于喜欢 提交于 2020-07-22 09:47:26
问题 In Swift/XCode I always get the English error messages as an output and not the translated local message of my device (Simulator or real device doesn't matter). I added the localization countries in the info tap of my project, but do I have to do something else, like translating an English error file manually to e.g. German? I know there are similar old questions on SO, and their answers all sound very simple but don't work. Example code: ContentView.swift @State var errorText: String = ""

error.localizedDescription always returns English

江枫思渺然 提交于 2020-07-22 09:46:28
问题 In Swift/XCode I always get the English error messages as an output and not the translated local message of my device (Simulator or real device doesn't matter). I added the localization countries in the info tap of my project, but do I have to do something else, like translating an English error file manually to e.g. German? I know there are similar old questions on SO, and their answers all sound very simple but don't work. Example code: ContentView.swift @State var errorText: String = ""

Flutter localization without context

淺唱寂寞╮ 提交于 2020-06-27 16:48:09
问题 I am trying to localize my app in flutter. I created the needed string.arb files for the supported languages. Now my question: Why does AppLocalizations.of(context) need a context? I simply want to access the named strings in the files/locales files/classes. At some point in the app I build a List and fill it later via overriding some fields with a separate class. However, this class has no context but I want to use localized strings in it. Can I write a method wich gets me the Localization

Localization (i18N) in ASP.Net Multi-tenant SaaS application

亡梦爱人 提交于 2020-06-25 16:22:06
问题 Problem scenario: Implement ASP.Net localization in a SaaS based application. Additional complexity: The tenant should be able to edit the localized content. Thus, if the hosted application has 10 tenants with each supporting 5 languages, we could end up with 50 units of translation content. Please suggest on what would be an ideal approach given the above scenario. Listed below, are approaches used in the past (for my other applications) and why they are not relevant now: Option 1: ASP.Net

Localization (i18N) in ASP.Net Multi-tenant SaaS application

断了今生、忘了曾经 提交于 2020-06-25 16:21:13
问题 Problem scenario: Implement ASP.Net localization in a SaaS based application. Additional complexity: The tenant should be able to edit the localized content. Thus, if the hosted application has 10 tenants with each supporting 5 languages, we could end up with 50 units of translation content. Please suggest on what would be an ideal approach given the above scenario. Listed below, are approaches used in the past (for my other applications) and why they are not relevant now: Option 1: ASP.Net

Localization (i18N) in ASP.Net Multi-tenant SaaS application

做~自己de王妃 提交于 2020-06-25 16:21:11
问题 Problem scenario: Implement ASP.Net localization in a SaaS based application. Additional complexity: The tenant should be able to edit the localized content. Thus, if the hosted application has 10 tenants with each supporting 5 languages, we could end up with 50 units of translation content. Please suggest on what would be an ideal approach given the above scenario. Listed below, are approaches used in the past (for my other applications) and why they are not relevant now: Option 1: ASP.Net

Get browser language in .AspNetCore2.0?

烈酒焚心 提交于 2020-06-25 07:56:11
问题 I am trying to get the default language from the browser and I use the following code to get it: var languages = HttpContext.Request.UserLanguages; Since the above is not supported with .NET Core 2 I tested with: var requestContext = Request.HttpContext.Features.Get<IRequestCultureFeature>(); However, it returns null. What is the correct way or alternative to get the language? 回答1: IRequestCultureFeature provides the first matched language, which is supported by your application. Declaration

How to display localized time, based on a visitor's location?

℡╲_俬逩灬. 提交于 2020-06-23 06:02:37
问题 We're developing a website, that will be used from people all over the world. There's a chat section in the website and we want the messages to appear with a timestamp. I'm storing in a database a timestamp for each message. What is the way to show the right time for each message to visitor, based on his local time. I don't want to ask the user for his timezone. Is there a way to do this, using only PHP? If not - what is the way to show the current time, based on the visitors' current time,