internationalization

GetText on Windows 10 XAMPP doesn't translate my text

五迷三道 提交于 2021-02-11 14:30:23
问题 GetText drive me crazy since few hours, I can't make it work. Here is the content of my message.po file: msgid "" msgstr "" "Project-Id-Version: TEST\n" "POT-Creation-Date: 2020-06-13 00:44+0200\n" "PO-Revision-Date: 2020-06-13 00:53+0200\n" "Last-Translator: \n" "Language-Team: \n" "Language: nl_BE\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" msgid "foo" msgstr "bar" msgid "fizz" msgstr "buzz" It is stored into ./locale/nl_BE/LC

Why is Intl.NumberFormat formatting 4 digits together on es-ES locale? [duplicate]

半腔热情 提交于 2021-02-10 05:40:02
问题 This question already has answers here : toLocaleString not working on numbers less than 10000 in all browsers (2 answers) Closed 1 year ago . I'm trying to format a number using the Intl.NumberFormat . I have checked MDN WebDocs but I'm not able to get the response I guess it should return. I'm formatting with spanish locale, and I want to get the point separator between thousands (using useGrouping option), however, I'm not getting it Expected result: 1.124,50 € Obtained result: 1124,50 €

Why is Intl.NumberFormat formatting 4 digits together on es-ES locale? [duplicate]

喜欢而已 提交于 2021-02-10 05:37:09
问题 This question already has answers here : toLocaleString not working on numbers less than 10000 in all browsers (2 answers) Closed 1 year ago . I'm trying to format a number using the Intl.NumberFormat . I have checked MDN WebDocs but I'm not able to get the response I guess it should return. I'm formatting with spanish locale, and I want to get the point separator between thousands (using useGrouping option), however, I'm not getting it Expected result: 1.124,50 € Obtained result: 1124,50 €

What is the purpose of half- and full-width characters?

試著忘記壹切 提交于 2021-02-09 00:36:31
问题 What is the purpose of half- and full-width characters and what is the difference between them? I am mostly curious because validator.js (an open-source string validation library) has a couple of functions that evaluate the form of a given input: isFullWidth(str) isHalfWidth(str) isVariableWidth(str) Why might someone want to evaluate the form of a some text? Internally, the library uses this regex pattern to determine if the input is full-width: /[^\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC

Grails 4.0.1 - Spock unit test cases fail because of spaces

点点圈 提交于 2021-02-08 11:20:29
问题 I am testing i18n formatting using unit tests in my Grails 4.0.1 application but seeing strange results. To me, this specs condition should be satisfied, but it is not. I don't suppose anyone has had a similar experience that can be explained, or maybe it's simply a bug? Any help would be appreciated. 回答1: Just as an idea: Can you iterate over both expected and actual values and convert the characters one by one to the ascii so that you'll probably see the difference for( c in ​'123 456,78 $'

How do I parse a translated date in Ruby on Rails?

谁都会走 提交于 2021-02-08 04:51:36
问题 I have configured an application in Ruby on Rails with translations to Spanish. Now I need to parse a translated date, for example: Jueves, 22 de Noviembre del 2012 I'm trying to do it this way: Date.strptime('Jueves, 22 de Noviembre, 2012', '%A, %e de %B, %Y') But it throws an invalid date error. How can I do it? 回答1: Date::parse should understand Spanish. However, that de seems to throw the parser off. If you could get it into this format, this will work Date.parse "Jueves, 22 Noviembre,

UnicodeString to char* (UTF-8)

早过忘川 提交于 2021-02-07 12:11:18
问题 I am using the ICU library in C++ on OS X. All of my strings are UnicodeStrings, but I need to use system calls like fopen, fread and so forth. These functions take const char* or char* as arguments. I have read that OS X supports UTF-8 internally, so that all I need to do is convert my UnicodeString to UTF-8, but I don't know how to do that. UnicodeString has a toUTF8() member function, but it returns a ByteSink. I've also found these examples: http://source.icu-project.org/repos/icu/icu

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.

New root page in wagtail

心不动则不痛 提交于 2021-02-07 09:51:47
问题 I want to change the Root page in Wagtail. I have deleted the default home page Created another page assigned "home" as slug. Created a template my_page_name_home.html But I am getting 404 all the time when I try http://localhost:8000/. Do I have to change the urls.py patterns? I am doing this because of Wagtailtrans add-on. In order to work i have to redirect away from the homepage to my new page ot type TranslatableSiteRootPage 回答1: You need to go to Settings -> Sites in the Wagtail admin,

Set or change the default language dynamically according to the user - Django

时光怂恿深爱的人放手 提交于 2021-02-07 06:53:15
问题 Is there any way to change the value of LANGUAGE_CODE variable in settings.py dynamically on clicking a button (sending a request)? I want the user to have their own "default language" set for their account . Right now the user can select their preferred language using a drop-down list, and the website gets translated perfectly, and because Django picks up the browser's language, the user need not to re-select their language after they reopen the website from the same browser. But when they