推 chenglap:其實考慮做粵語版. 11/25 11:32
※ 引述《yuanshen (左眼像阿信﹐右眼像怪獸)》之銘言:
: 我剛才仔細想了一下﹐不知道這網站是怎麼實現的﹐似乎是自己搭了個jQuery
: (因為我沒在網上搜到同樣的腳本)
: 不過﹐我想到有很多在線簡繁體轉換的網站﹐所以去查了一下﹐可以參考這個
: http://www.123cha.com/chinese-converter/
: 源代碼很有意思﹐似乎隻是把一些簡繁體的字全部羅列出來然後直接代換
: PS﹕剛又測試了一下好像是基於IE的﹐Opera可以﹐FF不可以﹐奇妙的是chrome
它原碼中有個壞習慣, 直接操作 h1 這個變數,
而沒有透過 document.getElementsByName("h1")[0];
所以才會造成這個現象,猜測作者慣用用ie 開發跟測試。
: 也不可以= =^
jQuery 只是個適合遍歷(iterator)的工具,
具體要代換還是得靠 regex + 資源表轉換,
這是我回在首帖 ptt 推文,舉出來再重回一次。:D
----
這個問題你可以用 google translate 作網站翻譯,
http://translate.google.com/translate_tools 這東西
你可以在步驟三的地方選擇只增加簡體,或者都用。
基本上只要塞 script tag 就好,有需要技術諮詢可以再問我。
------
因為簡轉繁或繁轉簡對映上是比較簡單,原理上大多都是直接用資源表轉換,
若真要自己作多國語系的話,具體作法則多是走 i18n 的路線會來得彈性大些。
--
I am a person, and I am always thinking .
Thinking in love , Thinking in life ,
Thinking in why , Thinking in worth.
I can't believe any of what ,
I am just thinking then thinking ,
but worst of all , most of mine is thinking not actioning...
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 220.133.44.37