搜尋
· One min read
The main rationale was that the world is more complicated. Now programmers spend more time researching libraries than writing everything from scratch.
The main rationale was that the world is more complicated. Now programmers spend more time researching libraries than writing everything from scratch.
Pinax 是一套可重用的 Django app,看起來真是方便。
第二台 Android 手機,一樣的 HVGA,機身變薄、512 MB 記憶體、虛擬鍵盤(無實體 鍵盤)。
mmm... 太普通了。
在 Android 1.5 版發佈之後,我們就可以用官方文件中教的方法來定義不同語系的資源文件,並根據語言設定,在使用者螢幕上顯示出對應的語言。在此之前,我們可以在 onCreate 中加入下面的程式片段,來測試不同語系的介面:
Resources res = getResources();
Configuration conf = res.getConfiguration();
conf.locale = Locale.TRADITIONAL_CHINESE;
DisplayMetrics dm = res.getDisplayMetrics();
res.updateConfiguration(conf, dm);
這段程式碼還可以搭配 Preference 設定,讓使用者在程式中自己選擇想要的語系。
update: 要針對不同語系做處理時,可以直接判斷
if (conf.locale == Locale.TRADITIONAL_CHINESE)