internationalization

PHP: case-insensitive preg_replace of a cyrillic string in UTF8

拟墨画扇 提交于 2019-12-04 03:46:24
问题 I have a PHP 5.3 script displaying users of my web site and would like to replace a certain Russian city (stored in UTF8 in PostgreSQL 8.4.7 database + CentOS 5.5/64 bits Linux) by its older name (it is an insider joke): preg_replace('/Волгоград/iu', 'Сталинград', $city); Unfortunately this only works for exact matches: Волгоград . This does not work for other cases, like ВОЛГОГРАД or волгоград . If I modify my source code to preg_replace('/[Вв]олгоград/iu', 'Сталинград', $city); then it will

{% trans “string” %} not working on templates but {% trans variable %} does

送分小仙女□ 提交于 2019-12-04 03:42:32
I'm quite new to Django and I'm working on a project with i18n, the thing is that I have translated some variables using .manage.py makemessages / compilemessages on my template file, but when I use {% trans "my string" %} I got the same "my string" for all the languages. What am I doing wrong? Here's the code for the views.py and the idioma.html views.py: #some code here... def idioma(request): output = _("Mensaje en espanol") return render_to_response( 'idioma/idioma.html', { 'idioma' : output }, context_instance = RequestContext(request) ) idioma.html {% load i18n %} < form action="/i18n

How to localize (i18n) moment.js within meteor.js?

偶尔善良 提交于 2019-12-04 03:33:55
How can moment.js used within a meteor.js app be told to use another language than English? moment.js (installed as an mrt package) works fine with the default English language. Using the demo calls from the moment.js docs at http://momentjs.com/docs/#/i18n/changing-language/ always produces 'en'. I noticed there is a German language file for moment in meteor_project/packages/moment/lib/moment/lang/de.js that doesn't seem to be used though? To specify: within a template helper I tried: moment.lang('de'); return moment.lang() //will result to 'en' and the other options mentioned here: Format a

java.util.MissingResourceException: Can't find bundle for base name

巧了我就是萌 提交于 2019-12-04 03:26:44
I'm testing Java's i18n features and have a problem, I can't load the language file when it's not in the class root. Right now my files are in the /lang directory. Looked several answers here in SO, putting it in a classes subdir and loading it like lang.Messages , used complete location routing /Test/lang/Message (test is the project name), using just /lang/Message and still I'm getting the: java.util.MissingResourceException: Can't find bundle for base name error. Anything else to try? My file structure is: Test/lang/Messages_es.properties Test/src/test/Main.java import java.util.Locale;

How to load all dart DateFormat locale in flutter?

倖福魔咒の 提交于 2019-12-04 03:24:27
问题 In Flutter app, intl package load only 15 languages. However Dart DateFormat support many more. I do not need translation, but need correct DateFormat . How to load all DateFormat locale? 回答1: In your highest StatefulWidget add these imports import 'package:intl/intl.dart'; import 'package:intl/date_symbol_data_local.dart'; in its State, override initState and add @override void initState() { super.initState(); initializeDateFormatting(); } For example import 'package:flutter/material.dart';

Sort list of string with localization in scala

依然范特西╮ 提交于 2019-12-04 02:53:49
i want to sort a list of strings. I know that's not difficult in scala but my problem is, that i need to sort lists in different languages. For example i know that i can sort strings in english very easily. But what's about the russian language or the romanian one? What is the best practice for sorting strings in multiple languages in scala? Does the scala sorting implementation support only english letters? In java i would do something like this: Collator coll = Collator.getInstance(locale); coll.setStrength(Collator.PRIMARY) Collections.sort(words, coll); I hope someone out there can help me

How to call EnumSystemLocales in Delphi?

感情迁移 提交于 2019-12-04 02:48:07
i am trying to call EnumSystemLocales in Delphi. For example: { Called for each supported locale. } function LocalesCallback(Name: PChar): BOOL; stdcall; begin OutputDebugString(Name); Result := Bool(1); //True end; procedure TForm1.Button1Click(Sender: TObject); begin EnumSystemLocales(@LocalesCallback, LCID_SUPPORTED); end; The problem is that the callback is only being called once. Note: EnumSystemLocales is returning true, indicating success. The remarks of EnumSystemLocales says that my callback must return true to continue enumerating (or more correctly, must not return false to continue

angularjs filter 'date' and $locale service

戏子无情 提交于 2019-12-04 02:47:16
问题 it seems that angularjs embed some internationalized resources: Angular supports i18n/l10n for date, number and currency filters. Additionally, Angular supports localizable pluralization support through the ngPluralize directive. All localizable Angular components depend on locale-specific rule sets managed by the $locale service. If found the $locale service but don't kwnow how to specify the locale in fr-fr... The following code : {{article.date_collected | date:'EEEE dd MMMM yyyy'}} Gives

How to hold japanese characters in SPRING MVC POJO's field

余生颓废 提交于 2019-12-04 02:20:13
问题 I am building web application using Spring MVC Spring Security Hibenate MySQl I want to add internationalization support to my application.e.g. I want to store and retrive japanese characters to mySQL db using Hibernate. I have set DB charset to UTF-8 and also added property to hibernate-cfg.xml property name="hibernate.connection.characterEncoding">UTF-8 I have done simple POC in which from java file , I am able to declare some string variable with japanese characters and they are

Localized accelerators (JMenuItem hotkeys) in Swing

感情迁移 提交于 2019-12-04 02:16:19
问题 I am working in an English app on a german laptop, over a spanish OS. Even if I explictly set Locale.setDefault(Locale.ENGLISH) at the beggining of my app, I am seeing the hotkexs in the menu as CTRL + Mayúsculas + C instead of CTRL + SHIFT + C that I passed to the KeyStroke object. Is not only that word does not get localized to english as I specified, but also that it maps SHIFT key to MAYUS (CAPS LOCK in english), so I guess this is not only a language issue, but keymap´s as well. So how