How to translate (internationalize, localize) application?

GetText should be able to do, search for “extract” at http://dxgettext.po.dk/documentation/how-to If all you need is to translate GUI and maybe resourcestring in sources, and the inline string constants in Pascal sources are not needed for translation, then you can try Delphi built-in method. However forums say that ITE is buggy. But at least that … Read more

Internationalization in PHP

In addition to gettext already mentioned, PHP 5.3 has native Internationalization support If that’s not an option, consider using Zend Framework’s Zend_Translate, Zend_Locale and related components for that. Zend_Translate supports a number of adapters, including but not limited to simple arrays, gettext, XmlTm and others.

Accessing properties file in a JSF application programmatically

The Class#getResourceAsStream() can take a path which is relative to the location of the Class which you’re using there as starting point. So, for example, if the class is located in the com.example package and you request the path foo/filename.properties, then it will actually load the com/example/foo/filename.properties file. But if you use /foo/filename.properties, then it … Read more

JavaFX: Change application language on the run

You can do something like this. As in your answer, you would either want to implement this as a singleton, or use a DI framework to inject a single instance wherever you need it: public class ObservableResourceFactory { private ObjectProperty<ResourceBundle> resources = new SimpleObjectProperty<>(); public ObjectProperty<ResourceBundle> resourcesProperty() { return resources ; } public final ResourceBundle … Read more

use text-align smartly (if english dir=ltr if arabic dir=rtl)

You’ll need to create a function that has all the letters you know are RTL and check when loading. To display RTL you need the CSS attributes, direction, text-align, and unicode-bidi. Demo: Script function checkRtl( character ) { var RTL = [‘ا’,’ب’,’پ’,’ت’,’س’,’ج’,’چ’,’ح’,’خ’,’د’,’ذ’,’ر’,’ز’,’ژ’,’س’,’ش’,’ص’,’ض’,’ط’,’ظ’,’ع’,’غ’,’ف’,’ق’,’ک’,’گ’,’ل’,’م’,’ن’,’و’,’ه’,’ی’]; return RTL.indexOf( character ) > -1; }; var divs = document.getElementsByTagName( ‘div’ ); … Read more

Rails: store translations in database

i18n has built-in support for using the database as a translation backend. Create a table using this code in a migration: create_table :translations do |t| t.string :locale t.string :key t.text :value t.text :interpolations t.boolean :is_proc, :default => false end Then add an initializer in config/initializers/i18n.rb with contents: I18n.backend = I18n::Backend::ActiveRecord.new And last… put translations in … Read more