internationalization

Malformed Farsi characters on AWT

浪子不回头ぞ 提交于 2019-12-10 08:17:52
问题 When I started programming with the JDK6, I had no problem with text components , neither in AWT nor in Swing. But for labels or titles of AWT components I do have a problem. I can't display Farsi characters on AWTs components (in Swing I type them into the source code). Here's my sample code: import javax.swing.*; import java.awt.*; import java.io.*; import java.util.Properties; public class EmptyFarsiCharsOnAWT extends JFrame{ public EmptyFarsiCharsOnAWT() { super("مثال");

How to implement internationalization in java

谁说我不能喝 提交于 2019-12-10 05:54:57
问题 I have a class called Info , and i have a bunch of static String variables described in it. public class Info{ public static stringOne= "Hello"; public static stringTwo = "world"; } and i'm hoping to access these variables as Info.stringTwo from other classes. 1.) I need to know if this is java-Internationalization that i have applied here ? (I have all the messages that i will display in the application assigned in this class. And, i am hoping to have different languages support to the app

Customizing java.text formatters for different Locales

ε祈祈猫儿з 提交于 2019-12-10 05:21:28
问题 Building a java application that supports different Locales, but would like to customize the DateFormat display beyond what is available between FULL , LONG , MEDIUM , and SHORT DateFormat options. Would like to do things like place a character between the date and time components of a DateFormat.getDateTimeFormat() , lowercase the AM/PM, etc, at least for english. can think of 3 ways to do it: 1) if locale is english, use my custom format string on a new SimpleDateFormat object. 2) modify

Django translations and gettext: The deprecation of the % (string interpolation) operator

為{幸葍}努か 提交于 2019-12-10 05:10:43
问题 Although Django Django does not yet support Python 3, it eventually will, so I want to keep my code the more "future-proof" possible. Since Python 2.7 the string interpolation operator ( % ) is being deprecated. And I realized that every string that needs to be translated is using the % interpolation syntax. And in the Django docs there is no mention of the new str.format method (the "new" official way of string formatting)... Maybe there is a limitation of the gettext library, but I don't

Is there a best-practice approach for internationalization of an application?

点点圈 提交于 2019-12-10 04:10:14
问题 We need to have our apps be translated into other languages. This entails renaming the .text properties of our visible controls as well as other literals found within our apps to whatever language we need to translate into. Is this something that can easily be accomplished with .resx files? I was thinking of creating a master resx key/value list where the key would be the fully qualified name of the control/variable/constant etc. and then refactor our apps to look into this file to get their

Django i18n does not work

被刻印的时光 ゝ 提交于 2019-12-10 03:46:06
问题 I'm trying to activate different languages for my project. English and spanish right now. I'll describe all steps i follow: FIrst of all, i place myself in the directory i want to translate. Or better said, where all {% trans %} tags are: $ cd media/templates/landing/ $ mkdir locale $ django-admin.py makemessages --locale=en Last command creates the directory/file /locale/en/LC_MESSAGES/django.po I open django.po and i proceed to complete all msgstr fields in english language. msgid label is

Angular4: Locale for a user

删除回忆录丶 提交于 2019-12-10 03:36:12
问题 I want to have a LoginForm and after this user enters the application - either with German or English usage. As far as I understand I can set in the app.module.ts something like import { LOCALE_ID } from '@angular/core'; providers: [{ provide: LOCALE_ID, useValue: 'de-DE' },...] But that is at the startup and not when the LoginForm was already displayed :-/ Is there a way to change the locale for the whole app? (Not only for a specific component!) - Would be great if the translations could be

Angular 5 - date - language

时间秒杀一切 提交于 2019-12-10 03:22:25
问题 I use this expression in my Angular 5 application: {{ viewDate | date:'MMM' }} The month abbreviation is shown in English. How do I switch the output to German? [SOLVED] https://angular.io/api/core/LOCALE_ID 回答1: As you pointed in your edit out already you have to define a locale within your app. The documentation for the DatePipe states Formats a date according to locale rules. The pipe has to be used like so {{ date_expression | date[:format[:timezone[:locale]]] }} As you can see, the pipe

Postgresql full text search in postgresql - japanese, chinese, arabic

痴心易碎 提交于 2019-12-10 02:46:57
问题 I'm designing a fulltext search function in postgresql for my current project. It works ok with ispell/myspell dictionaries so far. Now I need to add support for chinese, japanese and arabic search. Where do I start? There are no templates or dictionaries available for those languages as far as I can see. Will it work with pg_catalog.simple configuration? 回答1: Just a hint from the manual: A large list of dictionaries is available on the OpenOffice Wiki. 回答2: Dictionaries won't help you too

How to set locale in JavaScript, for example for toLocaleUpperCase()?

前提是你 提交于 2019-12-10 02:38:17
问题 I'd like to use the JavaScript toLocaleUpperCase() method to make sure that the capitalization works correctly for the Turkish language. I cannot be sure, however, that Turkish will be set as the user's locale. Is there a way in modern browsers to set the locale in run time, if I know for sure that the string is in Turkish? (I ran into this problem while thinking about Turkish, but actually it can be any other language.) 回答1: There isn't really anything much out there but I came across this