internationalization

Does my Base Internationalization storyboard have to correspond to a fallback language for all unlocalized languages and strings?

僤鯓⒐⒋嵵緔 提交于 2019-12-05 01:26:30
I've looked through some internationalization documentation and videos on apple developer, but I never found an explicit answer to that question. In Apple's tutorials I see the Base.lproj folder alongside en.lproj and zh.lproj -- the example translation (localization) is from English to Chinese. But they tell me that there's a file en.lproj/myStoryboard.strings , and that is confusing. I can't see the point in creating an English localization for the storyboard (that is already in English). So my questions are if the user will ever see the strings in the Base.lproj/myStoryboard.storyboard ? Do

Filtering a list of strings based on user locale

被刻印的时光 ゝ 提交于 2019-12-05 01:07:58
When working on a JavaScript project with AngularJS 1.6, I have a list of strings which I'd like to filter. For instance, assume my list contains árbol , cigüeña , nido and tubo . When filtering strings in Spanish, if I filtered for "u", I'd expect both cigüeña and tubo to appear, which would be the most natural result for a Spaniard. However, this is not the case in German - u and ü are different letters and thus a German will not want to see cigüeña on the list. So I am looking for a way to make my list filtering aware of the user's locale. I happen to have an object containing lots of

How to convert float or currency to a localized string?

青春壹個敷衍的年華 提交于 2019-12-05 00:59:12
In Delphi 1 , using FloatToStrF or CurrToStrF will automatically use the DecimalSeparator character to represent a decimal mark. Unfortunately DecimalSeparator is declared in SysUtils as Char 1,2 : var DecimalSeparator: Char; While the LOCALE_SDECIMAL is allowed to be up to three characters: Character(s) used for the decimal separator, for example, "." in "3.14" or "," in "3,14". The maximum number of characters allowed for this string is four, including a terminating null character. This causes Delphi to fail to read the decimal separator correctly; falling back to assume a default decimal

How can I translate the ActiveRecord attribute name in Rails 3.2?

蹲街弑〆低调 提交于 2019-12-05 00:58:16
I have the following validation in my model ( User ): validates :first_name,:length => {:minimum => 2,:maximum => 50},:format => { :with => /[a-zA-Z]+/ } I have the following in my yml locales file: attributes: first_name: too_short: "First name is too short" too_long: "First name is too long" invalid: "First name is not valid" Now, if I start a rails console , and write the following: a = User.new a.valid? a.errors.full_messages I will see the following errors: ["First name First name is too short", "First name First name is not valid"] As you can see, the attribute name is also prepended to

Django i18n and python locales (and dates)

烈酒焚心 提交于 2019-12-05 00:53:04
问题 I've been playing with Django's i18n system and it seems to be mostly working. However, dates in model code seem to be causing a problem. I use datetime.strftime to populate a few CHOICES tuples which are then used in forms. From what I understood, django will set the locale to the user's choice so that datetime.strftime() will output in the appropriate language, but this doesn't seem to happen. What am I missing here? If I set the locale manually (eg. locale.setlocale(locale.LC_TIME,'de_DE

Anyone know a source for translated Time Zone descriptions?

余生长醉 提交于 2019-12-05 00:51:38
问题 Does anyone know of a compiled list of translations for the time zone names in Windows? I need all 75 or so of them in German, French and Spanish. Alternatively, how would I use .Net to compile such a list? Example format: (GMT+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague 回答1: There is a list of all the time zones in the registry at: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones Which can be loaded using: ArrayList zones = new ArrayList(); using(

Internationalization of distances in java

帅比萌擦擦* 提交于 2019-12-05 00:47:04
Is it possible in Java without any extra library to internationalize distances? I mean it is possible to handle that with date, time, currencies, numbers... I would have expected to find a NumberFormat.getDistanceInstance or something. Is there something like that already embedded or should i make my own internationalization system for distances (mostly miles vs kilometers) I would love to hear about such formatter but unfortunately I never did. The problem is, there is no such data in CLDR yet, so it is not to easy to do. That is to say that people actually think about this for quite a while

Cyrillic alphabet validation

孤者浪人 提交于 2019-12-05 00:42:26
I came across an interesting defect today the issue is I have a deployment of my web application in Russia and the name value "Наталья" is not returning true as alphaNumeric in the method below. Curious for some input on how people would approach a problem like this! - Duncan private boolean isAlphaNumeric(String str) { return str.matches("[\\w-']+"); } You have to use Unicode regex . for example \p{L}+ for any unicode letter. For more look in the java doc for java.util.Pattern there is section called unicode support . Also, there are details here: link In my case I have to check whether it's

FuelPHP ORM database schema for i18n, opinions/suggestions

倾然丶 夕夏残阳落幕 提交于 2019-12-05 00:30:19
问题 While this question might be similar to many others, I'd like to ask for opinions/suggestions on the best approach for i18n specificaly on FuelPHP. So, here is what I've got so far: Database schema #1: models (id, name_pt, name_es, name_en, description_pt, description_es, description_en) Sample data #1: (1, 'Modelo', 'Modelo', 'Model', 'Descrição do modelo', 'Descripción del modelo', 'Model description') Pros: Straight and simple One table per model No need to use JOIN Use of a magic method

How to Integrate Qt4 qm files into binary using cmake and QRC?

≡放荡痞女 提交于 2019-12-05 00:10:53
I have a Qt4 CMake project and I'd like to integrate the QM files for i18n into the output binary. These are the rules I have so far for generating the TS and QM files: set(myapp_TRANSLATIONS i18n/myapp_de.ts ) set(FILES_TO_TRANSLATE ${myapp_SRCS} ${myapp_MOC_HDRS} ) QT4_CREATE_TRANSLATION(QM_FILES ${FILES_TO_TRANSLATE} ${myapp_TRANSLATIONS}) QT4_ADD_TRANSLATION(QM ${myapp_TRANSLATIONS}) I tried the following to add the QM files to the executable: add_executable(myapp ${myapp_SRCS} ${myapp_MOC_SRCS} ${myapp_RCC_SRCS} ${QM}) This is the initialization from main.cpp: QTranslator qtTranslator;