localization

Cannot set the default language in Android Studio

不羁岁月 提交于 2021-02-07 06:17:30
问题 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=

Symfony 'trans' domain inside Twig template

强颜欢笑 提交于 2021-02-06 09:41:05
问题 I'd like to do this: $this->get('translator')->trans('notice.unregistered', array(), 'index'); Inside Twig template, so I don't have to pass this as an argument. How? 回答1: You can also do using trans filter : {{ 'translationkey'|trans({},'domain') }} 回答2: The solution is: {% trans from "domain" %}text{% endtrans %} 回答3: You can add custom functions to change domains inside your templates. Add your functions: $getTextdomain = new Twig_SimpleFunction('get_textdomain', function () { return

Germany quotation marks broken in tinytex/rmarkdown - even when using package `csquotes`

烈酒焚心 提交于 2021-02-05 06:09:44
问题 What I want: I'd like to have German quotation marks in my TeX-PDF via rmarkdown and tinytex on MacOS (Catalina). See for example: The problem: It used to work following the guidelines as proposed here. But now, it stopped working. I only get English quotation marks, but not German ones: What I tried, without success : I updated my R packages I updated TeX packages I checked that the TeX package "csquotes" is installed I changed the language from "de" to "de-De" R-Code : --- title: "German

Germany quotation marks broken in tinytex/rmarkdown - even when using package `csquotes`

梦想的初衷 提交于 2021-02-05 06:06:05
问题 What I want: I'd like to have German quotation marks in my TeX-PDF via rmarkdown and tinytex on MacOS (Catalina). See for example: The problem: It used to work following the guidelines as proposed here. But now, it stopped working. I only get English quotation marks, but not German ones: What I tried, without success : I updated my R packages I updated TeX packages I checked that the TeX package "csquotes" is installed I changed the language from "de" to "de-De" R-Code : --- title: "German

Germany quotation marks broken in tinytex/rmarkdown - even when using package `csquotes`

不打扰是莪最后的温柔 提交于 2021-02-05 06:05:34
问题 What I want: I'd like to have German quotation marks in my TeX-PDF via rmarkdown and tinytex on MacOS (Catalina). See for example: The problem: It used to work following the guidelines as proposed here. But now, it stopped working. I only get English quotation marks, but not German ones: What I tried, without success : I updated my R packages I updated TeX packages I checked that the TeX package "csquotes" is installed I changed the language from "de" to "de-De" R-Code : --- title: "German

Is there a simple and preferred way of German number string formatting in Python?

老子叫甜甜 提交于 2021-02-05 05:44:26
问题 I am searching for the proper way of German number formatting (e.g. 1.000,1234 ) in Python under Windows OS. I tried locale.setlocale but did not succeed. Instead, I have written a function to come up with the desired output. Is there a better way? def ger_num(number, precision=3): """ returns german formatted number as string or an empty string """ if number is not None: try: my_number = "{:,f}".format(number) except ValueError: return "" decimals, fraction = my_number.split(".")[0], my

.NET: Parsing localized currency

左心房为你撑大大i 提交于 2021-02-05 02:40:38
问题 Let's say I have a string , and that string 's value is an amount of money, localized. By localized, I mean that if the country may use commas instead of decimal points, for example. (That's just one localization difference I know if.) How can I parse one of these string s into their decimal s numeric equivalents? Will decimal.TryParse() recognize localized formatting? How do I specify the CultureInfo with TryParse() ? 回答1: Here is an example of decimal.TryParse with a specified CultureInfo

.NET: Parsing localized currency

不打扰是莪最后的温柔 提交于 2021-02-05 02:40:13
问题 Let's say I have a string , and that string 's value is an amount of money, localized. By localized, I mean that if the country may use commas instead of decimal points, for example. (That's just one localization difference I know if.) How can I parse one of these string s into their decimal s numeric equivalents? Will decimal.TryParse() recognize localized formatting? How do I specify the CultureInfo with TryParse() ? 回答1: Here is an example of decimal.TryParse with a specified CultureInfo

value from resource bundle as pattern in formatDate

随声附和 提交于 2021-02-04 19:00:31
问题 I want to read pattern for JST formatDate also from resource bundle but this naive approach does not working, what I'm doing wrong ? in com/company/MyPortlet.properties is this key: company.date.format = yyyy-MM-dd HH:mm:ss In page I have: <fmt:setBundle basename="com.company.MyPortlet"/> <fmt:formatDate value="${date}" pattern="${company.date.format}" /> 回答1: You need to give the bundle a variable name. <fmt:setBundle basename="com.company.MyPortlet" var="bundle" /> This way bundle is

How to use jquery-validate localization

社会主义新天地 提交于 2021-02-04 16:46:34
问题 Is there a way to dynamically (i.e. from JS code) set/change the language of error messages, using the existing translations available in the repo? Non-solution #1 : Loading a localization script ( <script type="text/javascript" src="localization/messages_XX.js"> ) won't work because it cannot be changed on the client-side. Non-solution #2 : Setting custom messages with setDefaults requires me to come up with my own strings instead of reusing the existing ones. 回答1: Use jQuery $.extend() to