日曜日, 1月 13, 2008

InputContext and IME

I had such an unpleasant time looking through pages about IME -- as if everybody is using languages that use alphabets only. But for the most of us who use not only alphabets but also other scripts, here are some pieces of advice. Just a few lines -- but you can control IME from Java applications.

InputContext inputContext=null;
inputContext=frame.getInputContext();
inputContext.selectInputMethod(Locale.JAPAN);

This turns on Japanese IME. If you alter the locale to Locale.TAIWAN, or instantiate the class with language and country codes as:
Locale locale=new Locale("hi","IN");

then you can turn on the IME of your choice from your Java application.

Flask の Blueprint のテンプレート問題

  Flask の Blueprint は、ルート、静的ファイル、テンプレートをまとめて管理できます。しかし、テンプレートが指定できません。 ここでは、Blueprint の template_folder の問題点と回避策を説明します。 Blueprint のテンプレート問題...